diff options
author | Travis Tilley <lv@gentoo.org> | 2004-08-15 18:16:21 +0000 |
---|---|---|
committer | Travis Tilley <lv@gentoo.org> | 2004-08-15 18:16:21 +0000 |
commit | a00b5ec668fe78a98ee92a6686c178480a7ac7d0 (patch) | |
tree | 12ff1edc7ac230a23f3d81bd0c2f155923e9497b /sys-apps/coreutils | |
parent | Moved from net-www/visitors to www-misc/visitors. (diff) | |
download | gentoo-2-a00b5ec668fe78a98ee92a6686c178480a7ac7d0.tar.gz gentoo-2-a00b5ec668fe78a98ee92a6686c178480a7ac7d0.tar.bz2 gentoo-2-a00b5ec668fe78a98ee92a6686c178480a7ac7d0.zip |
fixed uname -p on amd64
Diffstat (limited to 'sys-apps/coreutils')
-rw-r--r-- | sys-apps/coreutils/ChangeLog | 7 | ||||
-rw-r--r-- | sys-apps/coreutils/coreutils-5.2.1-r1.ebuild | 5 | ||||
-rw-r--r-- | sys-apps/coreutils/coreutils-5.2.1.ebuild | 5 | ||||
-rw-r--r-- | sys-apps/coreutils/files/003_all_coreutils-gentoo-uname.patch | 140 |
4 files changed, 154 insertions, 3 deletions
diff --git a/sys-apps/coreutils/ChangeLog b/sys-apps/coreutils/ChangeLog index 90069948987e..222021e9a3e3 100644 --- a/sys-apps/coreutils/ChangeLog +++ b/sys-apps/coreutils/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-apps/coreutils # Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/ChangeLog,v 1.106 2004/07/23 20:55:53 seemant Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/ChangeLog,v 1.107 2004/08/15 18:16:21 lv Exp $ + + 15 Aug 2004; Travis Tilley <lv@gentoo.org> + +files/003_all_coreutils-gentoo-uname.patch, coreutils-5.2.1-r1.ebuild, + coreutils-5.2.1.ebuild: + fixed uname -p on amd64 23 Jul 2004; Seemant Kulleen <seemant@gentoo.org> coreutils-5.2.0-r2.ebuild, coreutils-5.2.1-r1.ebuild: diff --git a/sys-apps/coreutils/coreutils-5.2.1-r1.ebuild b/sys-apps/coreutils/coreutils-5.2.1-r1.ebuild index b3df89edc2e4..2dcc213c6e82 100644 --- a/sys-apps/coreutils/coreutils-5.2.1-r1.ebuild +++ b/sys-apps/coreutils/coreutils-5.2.1-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-5.2.1-r1.ebuild,v 1.3 2004/07/23 20:55:53 seemant Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-5.2.1-r1.ebuild,v 1.4 2004/08/15 18:16:21 lv Exp $ inherit eutils flag-o-matic @@ -39,6 +39,9 @@ src_unpack() { cd ${S} + # the version of this patch in the patch tarball is broken on amd64 + cp ${FILESDIR}/003_all_coreutils-gentoo-uname.patch ${PATCHDIR}/generic + # Mandrake's lsw patch caused issues on ia64 and amd64 with ls # Reported upstream, but we don't apply it for now # mv ${PATCHDIR}/mandrake/019* ${PATCHDIR}/excluded diff --git a/sys-apps/coreutils/coreutils-5.2.1.ebuild b/sys-apps/coreutils/coreutils-5.2.1.ebuild index 471f9ca6fc18..23a35e4071b7 100644 --- a/sys-apps/coreutils/coreutils-5.2.1.ebuild +++ b/sys-apps/coreutils/coreutils-5.2.1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-5.2.1.ebuild,v 1.11 2004/07/03 22:31:20 gmsoft Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-5.2.1.ebuild,v 1.12 2004/08/15 18:16:21 lv Exp $ inherit eutils flag-o-matic @@ -40,6 +40,9 @@ src_unpack() { cd ${S} + # the version of this patch in the patch tarball is broken on amd64 + cp ${FILESDIR}/003_all_coreutils-gentoo-uname.patch ${PATCHDIR}/generic + # Mandrake's lsw patch caused issues on ia64 and amd64 with ls # Reported upstream, but we don't apply it for now # mv ${PATCHDIR}/mandrake/019* ${PATCHDIR}/excluded diff --git a/sys-apps/coreutils/files/003_all_coreutils-gentoo-uname.patch b/sys-apps/coreutils/files/003_all_coreutils-gentoo-uname.patch new file mode 100644 index 000000000000..6bc500e1c1b9 --- /dev/null +++ b/sys-apps/coreutils/files/003_all_coreutils-gentoo-uname.patch @@ -0,0 +1,140 @@ +diff -urN coreutils-5.0.91.old/src/uname.c coreutils-5.0.91/src/uname.c +--- coreutils-5.0.91.old/src/uname.c 2003-07-23 00:26:48.000000000 -0700 ++++ coreutils-5.0.91/src/uname.c 2003-12-27 13:42:18.000000000 -0800 +@@ -44,6 +44,11 @@ + # endif + #endif + ++#if defined (__linux__) ++#define USE_PROCINFO ++#define UNAME_HARDWARE_PLATFORM ++#endif ++ + #include "system.h" + #include "error.h" + +@@ -129,6 +134,84 @@ + exit (status); + } + ++/* Carlos E. Gorges <carlos@techlinux.com.br> - return vendor_id from proc cpuinfo */ ++#if defined(USE_PROCINFO) ++/* x==0, processor type | x==1, hardware-platform */ ++int ++__linux_procinfo (int x, char *fstr) ++{ ++ FILE *ffd; ++ char *cstr=calloc(64,sizeof(char)), ++ *dstr=calloc(257,sizeof(char)), ++ *retr=NULL; ++ ++ if ( ffd=fopen( ++#if defined(__s390__) || defined(__s390x__) ++ "/proc/sysinfo" ++#else ++ "/proc/cpuinfo" ++#endif ++ ,"r") ) ++ { ++ while ( fscanf(ffd, ++#if defined(__s390__) || defined(__s390x__) ++ "%[^ :]%*[ :]%[^\n]\n" ++#else ++ "%[^:\t]\t: %[^\n]\n" ++#endif ++ , cstr, dstr) != EOF ) ++ { ++ char *sdata[] = ++ { ++ #if defined(__i386__) || defined(__x86_64__) ++ "model name", "vendor_id" ++ #elif defined(__ia64__) ++ "model", "vendor" ++ #elif defined(__alpha__) ++ "cpu model", "system type" ++ #elif defined(sparc) || defined(__sparc__) ++ "type", "cpu" ++ #elif defined(__hppa__) ++ "cpu", "model" ++ #elif defined(__mips__) ++ "cpu model", "system type" ++ #elif defined(PPC) ++ "cpu", "machine" ++ #elif defined(__arm__) ++ "Processor", "Hardware" ++ #elif defined(__s390__) || defined(__s390x__ ++ "Type", "Manufacturer" ++ #else ++ "???", "???" ++ #endif ++ }; ++ ++ if(!retr) ++ { ++ if (!strcmp(cstr, sdata[x])) ++ retr = strdup(dstr); ++ } else ++ break; ++ ++ } ++ fclose(ffd); ++ ++ if(retr) ++ { ++#if defined(__s390__) || defined(__s390x__) ++ while (strlen(retr) && isblank(retr[strlen(retr)-1])) ++ retr[strlen(retr)-1] = 0; ++#endif ++ strncpy(fstr,retr,257); ++ return 1; ++ } ++ } ++ return 0; ++} ++ ++#endif ++ ++ + /* Print ELEMENT, preceded by a space if something has already been + printed. */ + +@@ -243,13 +310,19 @@ + if (toprint & PRINT_PROCESSOR) + { + char const *element = unknown; +-#if HAVE_SYSINFO && defined SI_ARCHITECTURE ++#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO) + { + static char processor[257]; ++#if HAVE_SYSINFO && defined SI_ARCHITECTURE + if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) ++#endif ++#if defined(USE_PROCINFO) ++ if( 0 <= __linux_procinfo(0, processor)) ++#endif + element = processor; + } + #endif ++ + #ifdef UNAME_PROCESSOR + if (element == unknown) + { +@@ -278,9 +351,13 @@ + if (element == unknown) + { + static char hardware_platform[257]; ++#if ! defined (USE_PROCINFO) + size_t s = sizeof hardware_platform; + static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM }; + if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0) ++#else ++ if( 0 <= __linux_procinfo(1, hardware_platform)) ++#endif + element = hardware_platform; + } + #endif +@@ -294,3 +371,4 @@ + + exit (EXIT_SUCCESS); + } ++ |