# HG changeset patch # User Christopher Rogers # Date 1293067698 0 # Node ID fd7062885ec9074836f3dad6bb78bb898fd40735 # Parent 662ed282dc0c77c2be467c0e8e20283744cb4976 Up: coreutils to 8.8. diff -r 662ed282dc0c -r fd7062885ec9 coreutils-character/receipt --- a/coreutils-character/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-character/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-character" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that operate on characters." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-command/receipt --- a/coreutils-command/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-command/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-command" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU command utilities." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-conditions/receipt --- a/coreutils-conditions/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-conditions/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-conditions" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities for conditions." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-context-system/receipt --- a/coreutils-context-system/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-context-system/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-context-system" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities related to the system context." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-context-user/receipt --- a/coreutils-context-user/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-context-user/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-context-user" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities related to the user context." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-context-working/receipt --- a/coreutils-context-working/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-context-working/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-context-working" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities related to the working context." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-directory/receipt --- a/coreutils-directory/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-directory/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-directory" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that list directories." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-disk/receipt --- a/coreutils-disk/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-disk/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-disk" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that work with disks." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-file-attributes/receipt --- a/coreutils-file-attributes/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-file-attributes/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-file-attributes" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that change file attributes." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-file-format/receipt --- a/coreutils-file-format/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-file-format/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-file-format" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that format file contents." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-file-output-full/receipt --- a/coreutils-file-output-full/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-file-output-full/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-file-output-full" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that output entire files." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-file-output-part/receipt --- a/coreutils-file-output-part/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-file-output-part/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-file-output-part" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that output file parts." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-file-sort/receipt --- a/coreutils-file-sort/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-file-sort/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-file-sort" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that operate on sorted files." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-file-special/receipt --- a/coreutils-file-special/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-file-special/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-file-special" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that work with special file types." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-file-summarize/receipt --- a/coreutils-file-summarize/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-file-summarize/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-file-summarize" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that summarize files." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-line/receipt --- a/coreutils-line/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-line/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-line" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that operate on fields within a line." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-numeric/receipt --- a/coreutils-numeric/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-numeric/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-numeric" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU numeric utilities." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-operations/receipt --- a/coreutils-operations/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-operations/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-operations" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that perform basic operations." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-path/receipt --- a/coreutils-path/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-path/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-path" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that perform path manipulation." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-print/receipt --- a/coreutils-print/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-print/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-print" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that print text." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils-redirection/receipt --- a/coreutils-redirection/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils-redirection/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils-redirection" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="GNU utilities that work with disks." MAINTAINER="rcx@zoominternet.net" diff -r 662ed282dc0c -r fd7062885ec9 coreutils/receipt --- a/coreutils/receipt Thu Dec 23 01:15:54 2010 +0000 +++ b/coreutils/receipt Thu Dec 23 01:28:18 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="coreutils" -VERSION="8.7" +VERSION="8.8" CATEGORY="system-tools" SHORT_DESC="Utilities for using and setting the basic system." MAINTAINER="pankso@slitaz.org" @@ -19,6 +19,7 @@ # NOTE: There does not seem to be a problem with sigcontext.h in Linux 2.6.29.3 # Hack to fix ls: expected specifier-qualifier-list before '__u64' + # Hack to change uname: so can see the cpu type your running on with uname while read patch_file; do if [ -f done.$patch_file ]; then echo "Skipping $patch_file" @@ -29,6 +30,7 @@ touch done.$patch_file done <, 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