public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/patchsets/coreutils/8.24: 003_all_coreutils-gentoo-uname.patch
@ 2015-08-05  6:56 Mike Frysinger (vapier)
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2015-08-05  6:56 UTC (permalink / raw
  To: gentoo-commits

vapier      15/08/05 06:56:59

  Modified:             003_all_coreutils-gentoo-uname.patch
  Log:
  make procinfo_keys const

Revision  Changes    Path
1.2                  src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?r1=1.1&r2=1.2

Index: 003_all_coreutils-gentoo-uname.patch
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 003_all_coreutils-gentoo-uname.patch	6 Jul 2015 15:16:07 -0000	1.1
+++ 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 06:56:59 -0000	1.2
@@ -67,7 +67,7 @@
 +{
 +	FILE *fp;
 +
-+	char *procinfo_keys[] = {
++	const char * const procinfo_keys[] = {
 +		/* --processor --hardware-platform */
 +		#if defined(__alpha__)
 +			"cpu model", "system type"





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-commits] gentoo commit in src/patchsets/coreutils/8.24: 003_all_coreutils-gentoo-uname.patch
@ 2015-08-05  7:31 Mike Frysinger (vapier)
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2015-08-05  7:31 UTC (permalink / raw
  To: gentoo-commits

vapier      15/08/05 07:31:10

  Modified:             003_all_coreutils-gentoo-uname.patch
  Log:
  switch to using GNU style

Revision  Changes    Path
1.4                  src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?r1=1.3&r2=1.4

Index: 003_all_coreutils-gentoo-uname.patch
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 07:26:52 -0000	1.3
+++ 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 07:31:10 -0000	1.4
@@ -3,7 +3,7 @@
 Prob not suitable for upstream seeing as how it's 100% linux-specific
 http://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html
 
-Patch originally by Carlos E. Gorges <carlos@techlinux.com.br>, but 
+Patch originally by Carlos E. Gorges <carlos@techlinux.com.br>, but
 heavily reworked to suck less.
 
 To add support for additional platforms, check out the show_cpuinfo()
@@ -15,7 +15,7 @@
  # include <mach-o/arch.h>
  #endif
  
-+#if defined(__linux__)
++#if defined (__linux__)
 +# define USE_PROCINFO
 +# define UNAME_HARDWARE_PLATFORM
 +#endif
@@ -27,9 +27,9 @@
    exit (status);
  }
  
-+#if defined(USE_PROCINFO)
++#if defined (USE_PROCINFO)
 +
-+# if defined(__s390__) || defined(__s390x__)
++# if defined (__s390__) || defined (__s390x__)
 +#  define CPUINFO_FILE    "/proc/sysinfo"
 +#  define CPUINFO_FORMAT  "%64[^\t :]%*[ :]%256[^\n]%c"
 +# else
@@ -40,81 +40,81 @@
 +# define PROCINFO_PROCESSOR      0
 +# define PROCINFO_HARDWARE_PLATFORM 1
 +
-+static void __eat_cpuinfo_space(char *buf)
++static void __eat_cpuinfo_space (char *buf)
 +{
 +	/* first eat trailing space */
-+	char *tmp = buf + strlen(buf) - 1;
-+	while (tmp > buf && isspace(*tmp))
++	char *tmp = buf + strlen (buf) - 1;
++	while (tmp > buf && isspace (*tmp))
 +		*tmp-- = '\0';
 +	/* then eat leading space */
 +	tmp = buf;
-+	while (*tmp && isspace(*tmp))
++	while (*tmp && isspace (*tmp))
 +		tmp++;
 +	if (tmp != buf)
-+		memmove(buf, tmp, strlen(tmp)+1);
++		memmove (buf, tmp, strlen (tmp) + 1);
 +	/* finally collapse whitespace */
 +	tmp = buf;
 +	while (tmp[0] && tmp[1]) {
-+		if (isspace(tmp[0]) && isspace(tmp[1])) {
-+			memmove(tmp, tmp+1, strlen(tmp));
++		if (isspace (tmp[0]) && isspace (tmp[1])) {
++			memmove (tmp, tmp + 1, strlen (tmp));
 +			continue;
 +		}
 +		++tmp;
 +	}
 +}
 +
-+static int __linux_procinfo(int x, char *fstr, size_t s)
++static int __linux_procinfo (int x, char *fstr, size_t s)
 +{
 +	FILE *fp;
 +
 +	const char * const procinfo_keys[] = {
 +		/* --processor --hardware-platform */
-+		#if defined(__alpha__)
++		#if defined (__alpha__)
 +			"cpu model", "system type"
-+		#elif defined(__arm__)
++		#elif defined (__arm__)
 +			"Processor", "Hardware"
-+		#elif defined(__avr32__)
++		#elif defined (__avr32__)
 +			"processor", "cpu family"
-+		#elif defined(__bfin__)
++		#elif defined (__bfin__)
 +			"CPU", "BOARD Name"
-+		#elif defined(__cris__)
++		#elif defined (__cris__)
 +			"cpu", "cpu model"
-+		#elif defined(__frv__)
++		#elif defined (__frv__)
 +			"CPU-Core", "System"
-+		#elif defined(__i386__) || defined(__x86_64__)
++		#elif defined (__i386__) || defined (__x86_64__)
 +			"model name", "vendor_id"
-+		#elif defined(__ia64__)
++		#elif defined (__ia64__)
 +			"model name", "vendor"
-+		#elif defined(__hppa__)
++		#elif defined (__hppa__)
 +			"cpu", "model"
-+		#elif defined(__m68k__)
++		#elif defined (__m68k__)
 +			"CPU", "MMU"
-+		#elif defined(__microblaze__)
++		#elif defined (__microblaze__)
 +			"CPU-Ver", "FPGA-Arch"
-+		#elif defined(__mips__)
++		#elif defined (__mips__)
 +			"cpu model", "system type"
-+		#elif defined(__powerpc__) || defined(__powerpc64__)
++		#elif defined (__powerpc__) || defined (__powerpc64__)
 +			"cpu", "machine"
-+		#elif defined(__s390__) || defined(__s390x__)
++		#elif defined (__s390__) || defined (__s390x__)
 +			"Type", "Manufacturer"
-+		#elif defined(__sh__)
++		#elif defined (__sh__)
 +			"cpu type", "machine"
-+		#elif defined(sparc) || defined(__sparc__)
++		#elif defined (sparc) || defined (__sparc__)
 +			"type", "cpu"
-+		#elif defined(__vax__)
++		#elif defined (__vax__)
 +			"cpu type", "cpu"
 +		#else
 +			"unknown", "unknown"
 +		#endif
 +	};
 +
-+	if ((fp = fopen(CPUINFO_FILE, "r")) != NULL) {
++	if ((fp = fopen (CPUINFO_FILE, "r")) != NULL) {
 +		char key[65], value[257], eol, *ret = NULL;
 +
-+		while (fscanf(fp, CPUINFO_FORMAT, key, value, &eol) != EOF) {
-+			__eat_cpuinfo_space(key);
-+			if (!strcmp(key, procinfo_keys[x])) {
-+				__eat_cpuinfo_space(value);
++		while (fscanf (fp, CPUINFO_FORMAT, key, value, &eol) != EOF) {
++			__eat_cpuinfo_space (key);
++			if (!strcmp (key, procinfo_keys[x])) {
++				__eat_cpuinfo_space (value);
 +				ret = value;
 +				break;
 +			}
@@ -123,14 +123,14 @@
 +				 * length limit caused us to read right up to the
 +				 * newline ... doing "%*[^\n]\n" wont eat the newline
 +				 */
-+				fscanf(fp, "%*[^\n]");
-+				fscanf(fp, "\n");
++				fscanf (fp, "%*[^\n]");
++				fscanf (fp, "\n");
 +			}
 +		}
-+		fclose(fp);
++		fclose (fp);
 +
 +		if (ret) {
-+			strncpy(fstr, ret, s);
++			strncpy (fstr, ret, s);
 +			return 0;
 +		}
 +	}
@@ -148,10 +148,10 @@
      {
        char const *element = unknown;
 -#if HAVE_SYSINFO && defined SI_ARCHITECTURE
-+#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO)
++#if (HAVE_SYSINFO && defined SI_ARCHITECTURE) || defined (USE_PROCINFO)
        {
          static char processor[257];
-+#if defined(USE_PROCINFO)
++#if defined (USE_PROCINFO)
 +        if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor))
 +#else
          if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
@@ -163,7 +163,7 @@
        if (element == unknown)
          {
            static char hardware_platform[257];
-+#if defined(USE_PROCINFO)
++#if defined (USE_PROCINFO)
 +          if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform))
 +#else
            size_t s = sizeof hardware_platform;





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-commits] gentoo commit in src/patchsets/coreutils/8.24: 003_all_coreutils-gentoo-uname.patch
@ 2015-08-05  7:32 Mike Frysinger (vapier)
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2015-08-05  7:32 UTC (permalink / raw
  To: gentoo-commits

vapier      15/08/05 07:32:19

  Modified:             003_all_coreutils-gentoo-uname.patch
  Log:
  fix build failures when using -Werror

Revision  Changes    Path
1.5                  src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?r1=1.4&r2=1.5

Index: 003_all_coreutils-gentoo-uname.patch
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 07:31:10 -0000	1.4
+++ 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 07:32:19 -0000	1.5
@@ -11,7 +11,7 @@
 
 --- coreutils/src/uname.c
 +++ coreutils/src/uname.c
-@@ -50,6 +50,11 @@
+@@ -50,6 +50,12 @@
  # include <mach-o/arch.h>
  #endif
  
@@ -20,10 +20,11 @@
 +# define UNAME_HARDWARE_PLATFORM
 +#endif
 +
++#include "ignore-value.h"
  #include "system.h"
  #include "error.h"
  #include "quote.h"
-@@ -138,6 +143,119 @@
+@@ -138,6 +144,119 @@
    exit (status);
  }
  
@@ -123,8 +124,8 @@
 +				 * length limit caused us to read right up to the
 +				 * newline ... doing "%*[^\n]\n" wont eat the newline
 +				 */
-+				fscanf (fp, "%*[^\n]");
-+				fscanf (fp, "\n");
++				ignore_value (fscanf (fp, "%*[^\n]"));
++				ignore_value (fscanf (fp, "\n"));
 +			}
 +		}
 +		fclose (fp);
@@ -143,7 +144,7 @@
  /* Print ELEMENT, preceded by a space if something has already been
     printed.  */
  
-@@ -250,10 +368,14 @@ main (int argc, char **argv)
+@@ -250,10 +369,14 @@ main (int argc, char **argv)
    if (toprint & PRINT_PROCESSOR)
      {
        char const *element = unknown;
@@ -159,7 +160,7 @@
            element = processor;
        }
  #endif
-@@ -306,9 +428,13 @@ main (int argc, char **argv)
+@@ -306,9 +429,13 @@ main (int argc, char **argv)
        if (element == unknown)
          {
            static char hardware_platform[257];





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-commits] gentoo commit in src/patchsets/coreutils/8.24: 003_all_coreutils-gentoo-uname.patch
@ 2015-08-05  7:35 Mike Frysinger (vapier)
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2015-08-05  7:35 UTC (permalink / raw
  To: gentoo-commits

vapier      15/08/05 07:35:34

  Modified:             003_all_coreutils-gentoo-uname.patch
  Log:
  switch to using GNU style for comments too

Revision  Changes    Path
1.6                  src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?r1=1.5&r2=1.6

Index: 003_all_coreutils-gentoo-uname.patch
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 07:32:19 -0000	1.5
+++ 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 07:35:34 -0000	1.6
@@ -24,7 +24,7 @@
  #include "system.h"
  #include "error.h"
  #include "quote.h"
-@@ -138,6 +144,119 @@
+@@ -138,6 +144,118 @@
    exit (status);
  }
  
@@ -43,17 +43,17 @@
 +
 +static void __eat_cpuinfo_space (char *buf)
 +{
-+	/* first eat trailing space */
++	/* First eat trailing space.  */
 +	char *tmp = buf + strlen (buf) - 1;
 +	while (tmp > buf && isspace (*tmp))
 +		*tmp-- = '\0';
-+	/* then eat leading space */
++	/* Then eat leading space.  */
 +	tmp = buf;
 +	while (*tmp && isspace (*tmp))
 +		tmp++;
 +	if (tmp != buf)
 +		memmove (buf, tmp, strlen (tmp) + 1);
-+	/* finally collapse whitespace */
++	/* Finally collapse whitespace.  */
 +	tmp = buf;
 +	while (tmp[0] && tmp[1]) {
 +		if (isspace (tmp[0]) && isspace (tmp[1])) {
@@ -120,10 +120,9 @@
 +				break;
 +			}
 +			if (eol != '\n') {
-+				/* we need two fscanf's here in case the previous
-+				 * length limit caused us to read right up to the
-+				 * newline ... doing "%*[^\n]\n" wont eat the newline
-+				 */
++				/* We need two fscanf's here in case the previous length limit
++				 * caused us to read right up to the newline.  Doing something
++				 * like "%*[^\n]\n" won't eat the newline.  */
 +				ignore_value (fscanf (fp, "%*[^\n]"));
 +				ignore_value (fscanf (fp, "\n"));
 +			}
@@ -144,7 +143,7 @@
  /* Print ELEMENT, preceded by a space if something has already been
     printed.  */
  
-@@ -250,10 +369,14 @@ main (int argc, char **argv)
+@@ -250,10 +368,14 @@ main (int argc, char **argv)
    if (toprint & PRINT_PROCESSOR)
      {
        char const *element = unknown;
@@ -160,7 +159,7 @@
            element = processor;
        }
  #endif
-@@ -306,9 +429,13 @@ main (int argc, char **argv)
+@@ -306,9 +428,13 @@ main (int argc, char **argv)
        if (element == unknown)
          {
            static char hardware_platform[257];





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-commits] gentoo commit in src/patchsets/coreutils/8.24: 003_all_coreutils-gentoo-uname.patch
@ 2015-08-05  7:45 Mike Frysinger (vapier)
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger (vapier) @ 2015-08-05  7:45 UTC (permalink / raw
  To: gentoo-commits

vapier      15/08/05 07:45:29

  Modified:             003_all_coreutils-gentoo-uname.patch
  Log:
  switch arm processor key name to match the v3.8+ behavior -- this breaks parsing on older kernels, but it has been two years now, and adding uname() calls in the code would make things more bothersome.  we can see if anyone even notices before looking into the issue further.  reported via crbug.com/p/43365

Revision  Changes    Path
1.7                  src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch?r1=1.6&r2=1.7

Index: 003_all_coreutils-gentoo-uname.patch
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/coreutils/8.24/003_all_coreutils-gentoo-uname.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 07:35:34 -0000	1.6
+++ 003_all_coreutils-gentoo-uname.patch	5 Aug 2015 07:45:29 -0000	1.7
@@ -24,7 +24,7 @@
  #include "system.h"
  #include "error.h"
  #include "quote.h"
-@@ -138,6 +144,118 @@
+@@ -138,6 +144,119 @@
    exit (status);
  }
  
@@ -73,7 +73,8 @@
 +		#if defined (__alpha__)
 +			"cpu model", "system type"
 +		#elif defined (__arm__)
-+			"Processor", "Hardware"
++			/* linux-3.8+ uses "model name", but older uses "Processor".  */
++			"model name", "Hardware"
 +		#elif defined (__avr32__)
 +			"processor", "cpu family"
 +		#elif defined (__bfin__)
@@ -143,7 +144,7 @@
  /* Print ELEMENT, preceded by a space if something has already been
     printed.  */
  
-@@ -250,10 +368,14 @@ main (int argc, char **argv)
+@@ -250,10 +369,14 @@ main (int argc, char **argv)
    if (toprint & PRINT_PROCESSOR)
      {
        char const *element = unknown;
@@ -159,7 +160,7 @@
            element = processor;
        }
  #endif
-@@ -306,9 +428,13 @@ main (int argc, char **argv)
+@@ -306,9 +429,13 @@ main (int argc, char **argv)
        if (element == unknown)
          {
            static char hardware_platform[257];





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-05  7:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05  6:56 [gentoo-commits] gentoo commit in src/patchsets/coreutils/8.24: 003_all_coreutils-gentoo-uname.patch Mike Frysinger (vapier)
  -- strict thread matches above, loose matches on Subject: below --
2015-08-05  7:31 Mike Frysinger (vapier)
2015-08-05  7:32 Mike Frysinger (vapier)
2015-08-05  7:35 Mike Frysinger (vapier)
2015-08-05  7:45 Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox