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
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-06-11 06:49:24 +0000
3+++ debian/changelog 2010-09-27 17:18:45 +0000
4@@ -1,3 +1,12 @@
5+coreutils (8.5-1ubuntu4) maverick; urgency=low
6+
7+ [ C de-Avillez <hggdh2@ubuntu.com> ]
8+ * debian/patches/80_fedora_sysinfo.dpatch: make 'uname -i -p' return the
9+ real processor/hardware, instead of unknown. Patch cherry-picked from
10+ Fedora 12. (LP: #470550)
11+
12+ -- Artur Rona <ari-tczew@ubuntu.com> Mon, 27 Sep 2010 18:48:46 +0200
13+
14 coreutils (8.5-1ubuntu3) maverick; urgency=low
15
16 * Maybe test that the package builds first before uploading; dpatch is a
17
18=== modified file 'debian/patches/00list'
19--- debian/patches/00list 2010-06-11 03:20:49 +0000
20+++ debian/patches/00list 2010-09-27 17:18:45 +0000
21@@ -1,6 +1,7 @@
22 61_whoips
23 63_dd-appenderrors
24 72_id_checkngroups
25+80_fedora_sysinfo
26 99_disable_tests.misc.ls-time
27 99_kfbsd_build_tests
28 99_kfbsd_fstat_patch
29
30=== added file 'debian/patches/80_fedora_sysinfo.dpatch'
31--- debian/patches/80_fedora_sysinfo.dpatch 1970-01-01 00:00:00 +0000
32+++ debian/patches/80_fedora_sysinfo.dpatch 2010-09-27 17:18:45 +0000
33@@ -0,0 +1,82 @@
34+#! /bin/sh /usr/share/dpatch/dpatch-run
35+## From: Artur Rona
36+## Description: Fix reporting `unknown' by uname -p and uname -i.
37+## Bug: https://launchpad.net/bugs/470550
38+## Origin: debdiff, https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/470550/+attachment/1020161/+files/coreutils_7.4-2ubuntu2.debdiff
39+## Author: Carlos de-Avillez
40+
41+@DPATCH@
42+
43+diff -pruN -x '*~' coreutils-8.5.orig/src/uname.c coreutils-8.5/src/uname.c
44+--- coreutils-8.5.orig/src/uname.c 2010-01-01 14:06:47.000000000 +0100
45++++ coreutils-8.5/src/uname.c 2010-09-27 18:20:50.000000000 +0200
46+@@ -260,7 +260,7 @@ decode_switches (int argc, char **argv)
47+ int
48+ main (int argc, char **argv)
49+ {
50+- static char const unknown[] = "unknown";
51++ static char unknown[] = "unknown";
52+
53+ /* Mask indicating which elements to print. */
54+ unsigned int toprint = 0;
55+@@ -301,13 +301,35 @@ main (int argc, char **argv)
56+
57+ if (toprint & PRINT_PROCESSOR)
58+ {
59+- char const *element = unknown;
60++ char *element = unknown;
61+ #if HAVE_SYSINFO && defined SI_ARCHITECTURE
62+ {
63+ static char processor[257];
64+ if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
65+ element = processor;
66+ }
67++#else
68++ {
69++ struct utsname u;
70++ uname(&u);
71++ element = u.machine;
72++#ifdef linux
73++ if(!strcmp(element, "i686")) { /* Check for Athlon */
74++ char cinfo[1024];
75++ FILE *f=fopen("/proc/cpuinfo", "r");
76++ if(f) {
77++ while(fgets(cinfo, 1024, f)) {
78++ if(!strncmp(cinfo, "vendor_id", 9)) {
79++ if(strstr(cinfo, "AuthenticAMD"))
80++ element="athlon";
81++ break;
82++ }
83++ }
84++ fclose(f);
85++ }
86++ }
87++#endif
88++ }
89+ #endif
90+ #ifdef UNAME_PROCESSOR
91+ if (element == unknown)
92+@@ -345,7 +367,7 @@ main (int argc, char **argv)
93+
94+ if (toprint & PRINT_HARDWARE_PLATFORM)
95+ {
96+- char const *element = unknown;
97++ char *element = unknown;
98+ #if HAVE_SYSINFO && defined SI_PLATFORM
99+ {
100+ static char hardware_platform[257];
101+@@ -363,6 +385,14 @@ main (int argc, char **argv)
102+ if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
103+ element = hardware_platform;
104+ }
105++#else
106++ {
107++ struct utsname u;
108++ uname(&u);
109++ element = u.machine;
110++ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
111++ element[1]='3';
112++ }
113+ #endif
114+ if (! (toprint == UINT_MAX && element == unknown))
115+ print_element (element);

Subscribers

People subscribed via source and target branches

to all changes: