Merge lp:~ari-tczew/ubuntu/maverick/coreutils/lp-470550 into lp:ubuntu/maverick/coreutils

Proposed by Artur Rona
Status: Needs review
Proposed branch: lp:~ari-tczew/ubuntu/maverick/coreutils/lp-470550
Merge into: lp:ubuntu/maverick/coreutils
Diff against target: 115 lines (+92/-0)
3 files modified
debian/changelog (+9/-0)
debian/patches/00list (+1/-0)
debian/patches/80_fedora_sysinfo.dpatch (+82/-0)
To merge this branch: bzr merge lp:~ari-tczew/ubuntu/maverick/coreutils/lp-470550
Reviewer Review Type Date Requested Status
Artur Rona (community) Disapprove
Daniel Holbach (community) Needs Information
Review via email: mp+36760@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Where was this cherry-picked from? Is this upstream already? If so, can the info please be added to the patch header?

review: Needs Information
Revision history for this message
Artur Rona (ari-tczew) wrote :

Upstream didn't accept this patch.

review: Disapprove
Revision history for this message
C de-Avillez (hggdh2) wrote :

I picked this patch from Fedora, per feedback from doko.

Unmerged revisions

18. By Artur Rona

Set bug to close (LP: #470550).

17. By Artur Rona

[ C de-Avillez <email address hidden> ]
debian/patches/80_fedora_sysinfo.dpatch: make 'uname -i -p' return the
real processor/hardware, instead of unknown. Patch cherry-picked from
Fedora 12.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
1coreutils (8.5-1ubuntu4) maverick; urgency=low
2
3 [ C de-Avillez <hggdh2@ubuntu.com> ]
4 * debian/patches/80_fedora_sysinfo.dpatch: make 'uname -i -p' return the
5 real processor/hardware, instead of unknown. Patch cherry-picked from
6 Fedora 12. (LP: #470550)
7
8 -- Artur Rona <ari-tczew@ubuntu.com> Mon, 27 Sep 2010 18:48:46 +0200
9
1coreutils (8.5-1ubuntu3) maverick; urgency=low10coreutils (8.5-1ubuntu3) maverick; urgency=low
211
3 * Maybe test that the package builds first before uploading; dpatch is a12 * Maybe test that the package builds first before uploading; dpatch is a
413
=== 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 @@
161_whoips161_whoips
263_dd-appenderrors263_dd-appenderrors
372_id_checkngroups372_id_checkngroups
480_fedora_sysinfo
499_disable_tests.misc.ls-time599_disable_tests.misc.ls-time
599_kfbsd_build_tests699_kfbsd_build_tests
699_kfbsd_fstat_patch799_kfbsd_fstat_patch
78
=== 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 @@
1#! /bin/sh /usr/share/dpatch/dpatch-run
2## From: Artur Rona
3## Description: Fix reporting `unknown' by uname -p and uname -i.
4## Bug: https://launchpad.net/bugs/470550
5## Origin: debdiff, https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/470550/+attachment/1020161/+files/coreutils_7.4-2ubuntu2.debdiff
6## Author: Carlos de-Avillez
7
8@DPATCH@
9
10diff -pruN -x '*~' coreutils-8.5.orig/src/uname.c coreutils-8.5/src/uname.c
11--- coreutils-8.5.orig/src/uname.c 2010-01-01 14:06:47.000000000 +0100
12+++ coreutils-8.5/src/uname.c 2010-09-27 18:20:50.000000000 +0200
13@@ -260,7 +260,7 @@ decode_switches (int argc, char **argv)
14 int
15 main (int argc, char **argv)
16 {
17- static char const unknown[] = "unknown";
18+ static char unknown[] = "unknown";
19
20 /* Mask indicating which elements to print. */
21 unsigned int toprint = 0;
22@@ -301,13 +301,35 @@ main (int argc, char **argv)
23
24 if (toprint & PRINT_PROCESSOR)
25 {
26- char const *element = unknown;
27+ char *element = unknown;
28 #if HAVE_SYSINFO && defined SI_ARCHITECTURE
29 {
30 static char processor[257];
31 if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
32 element = processor;
33 }
34+#else
35+ {
36+ struct utsname u;
37+ uname(&u);
38+ element = u.machine;
39+#ifdef linux
40+ if(!strcmp(element, "i686")) { /* Check for Athlon */
41+ char cinfo[1024];
42+ FILE *f=fopen("/proc/cpuinfo", "r");
43+ if(f) {
44+ while(fgets(cinfo, 1024, f)) {
45+ if(!strncmp(cinfo, "vendor_id", 9)) {
46+ if(strstr(cinfo, "AuthenticAMD"))
47+ element="athlon";
48+ break;
49+ }
50+ }
51+ fclose(f);
52+ }
53+ }
54+#endif
55+ }
56 #endif
57 #ifdef UNAME_PROCESSOR
58 if (element == unknown)
59@@ -345,7 +367,7 @@ main (int argc, char **argv)
60
61 if (toprint & PRINT_HARDWARE_PLATFORM)
62 {
63- char const *element = unknown;
64+ char *element = unknown;
65 #if HAVE_SYSINFO && defined SI_PLATFORM
66 {
67 static char hardware_platform[257];
68@@ -363,6 +385,14 @@ main (int argc, char **argv)
69 if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
70 element = hardware_platform;
71 }
72+#else
73+ {
74+ struct utsname u;
75+ uname(&u);
76+ element = u.machine;
77+ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
78+ element[1]='3';
79+ }
80 #endif
81 if (! (toprint == UINT_MAX && element == unknown))
82 print_element (element);

Subscribers

People subscribed via source and target branches

to all changes: