diffstat for coreutils_8.13-3.5 coreutils_8.13-3.5boss1 coreutils-8.13/debian/changelog | 6 ++ coreutils-8.13/debian/patches/00list | 1 debian/patches/80_fedora_sysinfo.dpatch | 75 ++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) diff -u coreutils-8.13/debian/changelog coreutils-8.13/debian/changelog --- coreutils-8.13/debian/changelog +++ coreutils-8.13/debian/changelog @@ -1,3 +1,9 @@ +coreutils (8.13-3.5boss1) anokha; urgency=low + + * patches/80_fedora_sysinfo.dpatch: Make 'uname -i- p' to display real processor type. + + -- Prema S Tue, 15 Jul 2014 16:10:17 +0530 + coreutils (8.13-3.5) wheezy; urgency=low * Non-maintainer upload. diff -u coreutils-8.13/debian/patches/00list coreutils-8.13/debian/patches/00list --- coreutils-8.13/debian/patches/00list +++ coreutils-8.13/debian/patches/00list @@ -18,0 +19 @@ +80_fedora_sysinfo.dpatch only in patch2: unchanged: --- coreutils-8.13.orig/debian/patches/80_fedora_sysinfo.dpatch +++ coreutils-8.13/debian/patches/80_fedora_sysinfo.dpatch @@ -0,0 +1,75 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ +--- a/src/uname.c ++++ b/src/uname.c +@@ -258,7 +258,7 @@ + int + main (int argc, char **argv) + { +- static char const unknown[] = "unknown"; ++ static char unknown[] = "unknown"; + + /* Mask indicating which elements to print. */ + unsigned int toprint = 0; +@@ -299,13 +299,35 @@ + + if (toprint & PRINT_PROCESSOR) + { +- char const *element = unknown; ++ char *element = unknown; + #if HAVE_SYSINFO && defined SI_ARCHITECTURE + { + static char processor[257]; + if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) + element = processor; + } ++#else ++ { ++ struct utsname u; ++ uname(&u); ++ element = u.machine; ++#ifdef linux ++ if(!strcmp(element, "i686")) { /* Check for Athlon */ ++ char cinfo[1024]; ++ FILE *f=fopen("/proc/cpuinfo", "r"); ++ if(f) { ++ while(fgets(cinfo, 1024, f)) { ++ if(!strncmp(cinfo, "vendor_id", 9)) { ++ if(strstr(cinfo, "AuthenticAMD")) ++ element="athlon"; ++ break; ++ } ++ } ++ fclose(f); ++ } ++ } ++#endif ++ } + #endif + #ifdef UNAME_PROCESSOR + if (element == unknown) +@@ -343,7 +365,7 @@ + + if (toprint & PRINT_HARDWARE_PLATFORM) + { +- char const *element = unknown; ++ char *element = unknown; + #if HAVE_SYSINFO && defined SI_PLATFORM + { + static char hardware_platform[257]; +@@ -351,6 +373,14 @@ + hardware_platform, sizeof hardware_platform)) + element = hardware_platform; + } ++#else ++ { ++ struct utsname u; ++ uname(&u); ++ element = u.machine; ++ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6') ++ element[1]='3'; ++ } + #endif + #ifdef UNAME_HARDWARE_PLATFORM + if (element == unknown)