=== modified file 'debian/changelog'
--- debian/changelog	2010-06-11 06:49:24 +0000
+++ debian/changelog	2010-09-27 17:18:45 +0000
@@ -1,3 +1,12 @@
+coreutils (8.5-1ubuntu4) maverick; urgency=low
+
+  [ C de-Avillez <hggdh2@ubuntu.com> ]
+  * debian/patches/80_fedora_sysinfo.dpatch: make 'uname -i -p' return the
+    real processor/hardware, instead of unknown. Patch cherry-picked from
+    Fedora 12. (LP: #470550)
+
+ -- Artur Rona <ari-tczew@ubuntu.com>  Mon, 27 Sep 2010 18:48:46 +0200
+
 coreutils (8.5-1ubuntu3) maverick; urgency=low
 
   * Maybe test that the package builds first before uploading; dpatch is a

=== modified file 'debian/patches/00list'
--- debian/patches/00list	2010-06-11 03:20:49 +0000
+++ debian/patches/00list	2010-09-27 17:18:45 +0000
@@ -1,6 +1,7 @@
 61_whoips
 63_dd-appenderrors
 72_id_checkngroups
+80_fedora_sysinfo
 99_disable_tests.misc.ls-time
 99_kfbsd_build_tests
 99_kfbsd_fstat_patch

=== added file 'debian/patches/80_fedora_sysinfo.dpatch'
--- debian/patches/80_fedora_sysinfo.dpatch	1970-01-01 00:00:00 +0000
+++ debian/patches/80_fedora_sysinfo.dpatch	2010-09-27 17:18:45 +0000
@@ -0,0 +1,82 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## From: Artur Rona
+## Description: Fix reporting `unknown' by uname -p and uname -i.
+## Bug: https://launchpad.net/bugs/470550
+## Origin: debdiff, https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/470550/+attachment/1020161/+files/coreutils_7.4-2ubuntu2.debdiff
+## Author: Carlos de-Avillez
+
+@DPATCH@
+
+diff -pruN -x '*~' coreutils-8.5.orig/src/uname.c coreutils-8.5/src/uname.c
+--- coreutils-8.5.orig/src/uname.c	2010-01-01 14:06:47.000000000 +0100
++++ coreutils-8.5/src/uname.c	2010-09-27 18:20:50.000000000 +0200
+@@ -260,7 +260,7 @@ decode_switches (int argc, char **argv)
+ 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 @@ main (int argc, char **argv)
+ 
+   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 @@ main (int argc, char **argv)
+ 
+   if (toprint & PRINT_HARDWARE_PLATFORM)
+     {
+-      char const *element = unknown;
++      char *element = unknown;
+ #if HAVE_SYSINFO && defined SI_PLATFORM
+       {
+         static char hardware_platform[257];
+@@ -363,6 +385,14 @@ main (int argc, char **argv)
+           if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
+             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
+       if (! (toprint == UINT_MAX && element == unknown))
+         print_element (element);

