From 77154539d8115a3fd49d4e0a6376919fa64b2a6f Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Fri, 14 Jan 2011 08:53:45 -0300 Subject: coreutils: bump to version 8.9 Signed-off-by: Gustavo Zacarias Signed-off-by: Peter Korsgaard --- package/coreutils/coreutils-8.5-hostname-man.patch | 51 ------ package/coreutils/coreutils-8.5-uname.patch | 173 --------------------- package/coreutils/coreutils-8.9-hostname-man.patch | 51 ++++++ package/coreutils/coreutils-uname.patch | 173 +++++++++++++++++++++ package/coreutils/coreutils.mk | 2 +- 5 files changed, 225 insertions(+), 225 deletions(-) delete mode 100644 package/coreutils/coreutils-8.5-hostname-man.patch delete mode 100644 package/coreutils/coreutils-8.5-uname.patch create mode 100644 package/coreutils/coreutils-8.9-hostname-man.patch create mode 100644 package/coreutils/coreutils-uname.patch (limited to 'package/coreutils') diff --git a/package/coreutils/coreutils-8.5-hostname-man.patch b/package/coreutils/coreutils-8.5-hostname-man.patch deleted file mode 100644 index 6025f56eb..000000000 --- a/package/coreutils/coreutils-8.5-hostname-man.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- /dev/null 2010-09-18 00:21:07.280000001 -0700 -+++ b/man/hostname.1 2010-09-23 12:08:06.000000000 -0700 -@@ -0,0 +1,48 @@ -+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -+.TH HOSTNAME "1" "September 2010" "GNU coreutils 8.5" "User Commands" -+.SH NAME -+hostname \- set or print the name of the current host system -+.SH SYNOPSIS -+.B hostname -+[\fINAME\fR] -+.br -+.B hostname -+\fIOPTION\fR -+.SH DESCRIPTION -+.\" Add any additional description here -+.PP -+Print or set the hostname of the current system. -+.TP -+\fB\-\-help\fR -+display this help and exit -+.TP -+\fB\-\-version\fR -+output version information and exit -+.SH AUTHOR -+Written by Jim Meyering. -+.SH "REPORTING BUGS" -+Report hostname bugs to bug\-coreutils@gnu.org -+.br -+GNU coreutils home page: -+.br -+General help using GNU software: -+.br -+Report hostname translation bugs to -+.SH COPYRIGHT -+Copyright \(co 2010 Free Software Foundation, Inc. -+License GPLv3+: GNU GPL version 3 or later . -+.br -+This is free software: you are free to change and redistribute it. -+There is NO WARRANTY, to the extent permitted by law. -+.SH "SEE ALSO" -+The full documentation for -+.B hostname -+is maintained as a Texinfo manual. If the -+.B info -+and -+.B hostname -+programs are properly installed at your site, the command -+.IP -+.B info coreutils \(aqhostname invocation\(aq -+.PP -+should give you access to the complete manual. diff --git a/package/coreutils/coreutils-8.5-uname.patch b/package/coreutils/coreutils-8.5-uname.patch deleted file mode 100644 index b458abeba..000000000 --- a/package/coreutils/coreutils-8.5-uname.patch +++ /dev/null @@ -1,173 +0,0 @@ -On linux platforms, grok /proc/cpuinfo for the CPU/vendor info. - -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 , but -heavily reworked to suck less. - -To add support for additional platforms, check out the show_cpuinfo() -func in the linux/arch// source tree of the kernel. - ---- coreutils/src/uname.c -+++ coreutils/src/uname.c -@@ -50,6 +50,11 @@ - # include - #endif - -+#if defined(__linux__) -+# define USE_PROCINFO -+# define UNAME_HARDWARE_PLATFORM -+#endif -+ - #include "system.h" - #include "error.h" - #include "quote.h" -@@ -138,6 +143,117 @@ - exit (status); - } - -+#if defined(USE_PROCINFO) -+ -+# if defined(__s390__) || defined(__s390x__) -+# define CPUINFO_FILE "/proc/sysinfo" -+# define CPUINFO_FORMAT "%64[^\t :]%*[ :]%256[^\n]%c" -+# else -+# define CPUINFO_FILE "/proc/cpuinfo" -+# define CPUINFO_FORMAT "%64[^\t:]\t:%256[^\n]%c" -+# endif -+ -+# define PROCINFO_PROCESSOR 0 -+# define PROCINFO_HARDWARE_PLATFORM 1 -+ -+static void __eat_cpuinfo_space(char *buf) -+{ -+ /* first eat trailing space */ -+ char *tmp = buf + strlen(buf) - 1; -+ while (tmp > buf && isspace(*tmp)) -+ *tmp-- = '\0'; -+ /* then eat leading space */ -+ tmp = buf; -+ while (*tmp && isspace(*tmp)) -+ tmp++; -+ if (tmp != buf) -+ 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)); -+ continue; -+ } -+ ++tmp; -+ } -+} -+ -+static int __linux_procinfo(int x, char *fstr, size_t s) -+{ -+ FILE *fp; -+ -+ char *procinfo_keys[] = { -+ /* --processor --hardware-platform */ -+ #if defined(__alpha__) -+ "cpu model", "system type" -+ #elif defined(__arm__) -+ "Processor", "Hardware" -+ #elif defined(__avr32__) -+ "processor", "cpu family" -+ #elif defined(__bfin__) -+ "CPU", "BOARD Name" -+ #elif defined(__cris__) -+ "cpu", "cpu model" -+ #elif defined(__frv__) -+ "CPU-Core", "System" -+ #elif defined(__i386__) || defined(__x86_64__) -+ "model name", "vendor_id" -+ #elif defined(__ia64__) -+ "family", "vendor" -+ #elif defined(__hppa__) -+ "cpu", "model" -+ #elif defined(__m68k__) -+ "CPU", "MMU" -+ #elif defined(__mips__) -+ "cpu model", "system type" -+ #elif defined(__powerpc__) || defined(__powerpc64__) -+ "cpu", "machine" -+ #elif defined(__s390__) || defined(__s390x__) -+ "Type", "Manufacturer" -+ #elif defined(__sh__) -+ "cpu type", "machine" -+ #elif defined(sparc) || defined(__sparc__) -+ "type", "cpu" -+ #elif defined(__vax__) -+ "cpu type", "cpu" -+ #else -+ "unknown", "unknown" -+ #endif -+ }; -+ -+ 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); -+ ret = value; -+ 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 -+ */ -+ fscanf(fp, "%*[^\n]"); -+ fscanf(fp, "\n"); -+ } -+ } -+ fclose(fp); -+ -+ if (ret) { -+ strncpy(fstr, ret, s); -+ return 0; -+ } -+ } -+ -+ return -1; -+} -+ -+#endif -+ - /* Print ELEMENT, preceded by a space if something has already been - printed. */ - -@@ -250,10 +344,14 @@ main (int argc, char **argv) - if (toprint & PRINT_PROCESSOR) - { - char const *element = unknown; --#if HAVE_SYSINFO && defined SI_ARCHITECTURE -+#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO) - { - static char processor[257]; -+#if defined(USE_PROCINFO) -+ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor)) -+#else - if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) -+#endif - element = processor; - } - #endif -@@ -306,9 +404,13 @@ main (int argc, char **argv) - if (element == unknown) - { - static char hardware_platform[257]; -+#if defined(USE_PROCINFO) -+ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform)) -+#else - size_t s = sizeof hardware_platform; - static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM }; - if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0) -+#endif - element = hardware_platform; - } - #endif diff --git a/package/coreutils/coreutils-8.9-hostname-man.patch b/package/coreutils/coreutils-8.9-hostname-man.patch new file mode 100644 index 000000000..5f8fa1ee2 --- /dev/null +++ b/package/coreutils/coreutils-8.9-hostname-man.patch @@ -0,0 +1,51 @@ +--- /dev/null 2010-09-18 00:21:07.280000001 -0700 ++++ b/man/hostname.1 2010-09-23 12:08:06.000000000 -0700 +@@ -0,0 +1,48 @@ ++.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. ++.TH HOSTNAME "1" "January 2011" "GNU coreutils 8.9" "User Commands" ++.SH NAME ++hostname \- set or print the name of the current host system ++.SH SYNOPSIS ++.B hostname ++[\fINAME\fR] ++.br ++.B hostname ++\fIOPTION\fR ++.SH DESCRIPTION ++.\" Add any additional description here ++.PP ++Print or set the hostname of the current system. ++.TP ++\fB\-\-help\fR ++display this help and exit ++.TP ++\fB\-\-version\fR ++output version information and exit ++.SH AUTHOR ++Written by Jim Meyering. ++.SH "REPORTING BUGS" ++Report hostname bugs to bug\-coreutils at gnu.org ++.br ++GNU coreutils home page: ++.br ++General help using GNU software: ++.br ++Report hostname translation bugs to ++.SH COPYRIGHT ++Copyright \(co 2010 Free Software Foundation, Inc. ++License GPLv3+: GNU GPL version 3 or later . ++.br ++This is free software: you are free to change and redistribute it. ++There is NO WARRANTY, to the extent permitted by law. ++.SH "SEE ALSO" ++The full documentation for ++.B hostname ++is maintained as a Texinfo manual. If the ++.B info ++and ++.B hostname ++programs are properly installed at your site, the command ++.IP ++.B info coreutils \(aqhostname invocation\(aq ++.PP ++should give you access to the complete manual. diff --git a/package/coreutils/coreutils-uname.patch b/package/coreutils/coreutils-uname.patch new file mode 100644 index 000000000..faa890881 --- /dev/null +++ b/package/coreutils/coreutils-uname.patch @@ -0,0 +1,173 @@ +On linux platforms, grok /proc/cpuinfo for the CPU/vendor info. + +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 , but +heavily reworked to suck less. + +To add support for additional platforms, check out the show_cpuinfo() +func in the linux/arch// source tree of the kernel. + +--- coreutils/src/uname.c ++++ coreutils/src/uname.c +@@ -50,6 +50,11 @@ + # include + #endif + ++#if defined(__linux__) ++# define USE_PROCINFO ++# define UNAME_HARDWARE_PLATFORM ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" +@@ -138,6 +143,117 @@ + exit (status); + } + ++#if defined(USE_PROCINFO) ++ ++# if defined(__s390__) || defined(__s390x__) ++# define CPUINFO_FILE "/proc/sysinfo" ++# define CPUINFO_FORMAT "%64[^\t :]%*[ :]%256[^\n]%c" ++# else ++# define CPUINFO_FILE "/proc/cpuinfo" ++# define CPUINFO_FORMAT "%64[^\t:]\t:%256[^\n]%c" ++# endif ++ ++# define PROCINFO_PROCESSOR 0 ++# define PROCINFO_HARDWARE_PLATFORM 1 ++ ++static void __eat_cpuinfo_space(char *buf) ++{ ++ /* first eat trailing space */ ++ char *tmp = buf + strlen(buf) - 1; ++ while (tmp > buf && isspace(*tmp)) ++ *tmp-- = '\0'; ++ /* then eat leading space */ ++ tmp = buf; ++ while (*tmp && isspace(*tmp)) ++ tmp++; ++ if (tmp != buf) ++ 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)); ++ continue; ++ } ++ ++tmp; ++ } ++} ++ ++static int __linux_procinfo(int x, char *fstr, size_t s) ++{ ++ FILE *fp; ++ ++ char *procinfo_keys[] = { ++ /* --processor --hardware-platform */ ++ #if defined(__alpha__) ++ "cpu model", "system type" ++ #elif defined(__arm__) ++ "Processor", "Hardware" ++ #elif defined(__avr32__) ++ "processor", "cpu family" ++ #elif defined(__bfin__) ++ "CPU", "BOARD Name" ++ #elif defined(__cris__) ++ "cpu", "cpu model" ++ #elif defined(__frv__) ++ "CPU-Core", "System" ++ #elif defined(__i386__) || defined(__x86_64__) ++ "model name", "vendor_id" ++ #elif defined(__ia64__) ++ "family", "vendor" ++ #elif defined(__hppa__) ++ "cpu", "model" ++ #elif defined(__m68k__) ++ "CPU", "MMU" ++ #elif defined(__mips__) ++ "cpu model", "system type" ++ #elif defined(__powerpc__) || defined(__powerpc64__) ++ "cpu", "machine" ++ #elif defined(__s390__) || defined(__s390x__) ++ "Type", "Manufacturer" ++ #elif defined(__sh__) ++ "cpu type", "machine" ++ #elif defined(sparc) || defined(__sparc__) ++ "type", "cpu" ++ #elif defined(__vax__) ++ "cpu type", "cpu" ++ #else ++ "unknown", "unknown" ++ #endif ++ }; ++ ++ 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); ++ ret = value; ++ 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 ++ */ ++ fscanf(fp, "%*[^\n]"); ++ fscanf(fp, "\n"); ++ } ++ } ++ fclose(fp); ++ ++ if (ret) { ++ strncpy(fstr, ret, s); ++ return 0; ++ } ++ } ++ ++ return -1; ++} ++ ++#endif ++ + /* Print ELEMENT, preceded by a space if something has already been + printed. */ + +@@ -250,10 +344,14 @@ main (int argc, char **argv) + if (toprint & PRINT_PROCESSOR) + { + char const *element = unknown; +-#if HAVE_SYSINFO && defined SI_ARCHITECTURE ++#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO) + { + static char processor[257]; ++#if defined(USE_PROCINFO) ++ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor)) ++#else + if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) ++#endif + element = processor; + } + #endif +@@ -306,9 +404,13 @@ main (int argc, char **argv) + if (element == unknown) + { + static char hardware_platform[257]; ++#if defined(USE_PROCINFO) ++ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform)) ++#else + size_t s = sizeof hardware_platform; + static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM }; + if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0) ++#endif + element = hardware_platform; + } + #endif diff --git a/package/coreutils/coreutils.mk b/package/coreutils/coreutils.mk index d934ae896..fed5e90e3 100644 --- a/package/coreutils/coreutils.mk +++ b/package/coreutils/coreutils.mk @@ -3,7 +3,7 @@ # coreutils # ############################################################# -COREUTILS_VERSION = 8.5 +COREUTILS_VERSION = 8.9 COREUTILS_SOURCE = coreutils-$(COREUTILS_VERSION).tar.gz COREUTILS_SITE = $(BR2_GNU_MIRROR)/coreutils -- cgit v1.2.3