diff -u coreutils-7.4/debian/changelog coreutils-7.4/debian/changelog --- coreutils-7.4/debian/changelog +++ coreutils-7.4/debian/changelog @@ -1,3 +1,13 @@ +coreutils (7.4-2ubuntu2) lucid; urgency=low + + * debian/patches/80_fedora_sysinfo.dpatch: make 'uname -i -p' return the + real processor/hardware, instead of unknown. Patch cherry-picked from + Fedora 12 (original: coreutils-4.5.3-sysinfo.patch, from the + coreutils-7.6-5.src.rpm). + * debian/patches/00list: add the above patch to dpatch. + + -- C de-Avillez Tue, 10 Nov 2009 12:38:24 -0600 + coreutils (7.4-2ubuntu1) karmic; urgency=low * debian/rules: Do not install dangling LC_TIME symlinks, they are not diff -u coreutils-7.4/debian/patches/00list coreutils-7.4/debian/patches/00list --- coreutils-7.4/debian/patches/00list +++ coreutils-7.4/debian/patches/00list @@ -4,0 +5 @@ +80_fedora_sysinfo only in patch2: unchanged: --- coreutils-7.4.orig/debian/patches/80_fedora_sysinfo.dpatch +++ coreutils-7.4/debian/patches/80_fedora_sysinfo.dpatch @@ -0,0 +1,75 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ +--- coreutils-7.4/src/uname-saved.c 2009-11-10 13:29:20.000000000 -0600 ++++ coreutils-7.4/src/uname.c 2009-11-10 13:29:29.000000000 -0600 +@@ -260,7 +260,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; +@@ -301,13 +301,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) +@@ -345,7 +367,7 @@ + + if (toprint & PRINT_HARDWARE_PLATFORM) + { +- char const *element = unknown; ++ char *element = unknown; + #if HAVE_SYSINFO && defined SI_PLATFORM + { + static char hardware_platform[257]; +@@ -353,6 +375,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)