
Hello community, here is the log from the commit of package ksh checked in at Mon May 29 18:07:40 CEST 2006. -------- --- ksh/ksh.changes 2006-05-09 11:40:55.000000000 +0200 +++ ksh/ksh.changes 2006-05-29 15:17:06.000000000 +0200 @@ -1,0 +2,5 @@ +Mon May 29 15:16:03 CEST 2006 - werner@suse.de + +- Make -i and -p option of uname builtin work (bug #178962) + +------------------------------------------------------------------- New: ---- ksh93-uname.dif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ksh.spec ++++++ --- /var/tmp/diff_new_pack.daspnx/_old 2006-05-29 18:07:11.000000000 +0200 +++ /var/tmp/diff_new_pack.daspnx/_new 2006-05-29 18:07:11.000000000 +0200 @@ -17,7 +17,7 @@ PreReq: /bin/ln /etc/bash.bashrc Autoreqprov: on Version: 93r -Release: 11 +Release: 12 Summary: Korn Shell BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: INIT.2006-02-14.tar.bz2 @@ -29,6 +29,7 @@ Patch2: ksh-qemu.patch Patch3: ksh93-shift_ijs.dif Patch4: ksh93-gmt2utc.dif +Patch5: ksh93-uname.dif %description The original Korn Shell. The ksh is an sh-compatible command @@ -71,6 +72,7 @@ %endif %patch3 %patch4 +%patch5 %build # @@ -211,6 +213,8 @@ /usr/include/ast/ %changelog -n ksh +* Mon May 29 2006 - werner@suse.de +- Make -i and -p option of uname builtin work (bug #178962) * Tue May 09 2006 - werner@suse.de - Change PreRequire /bin/bash to /etc/bash.bashrc (bug #172633) * Mon May 08 2006 - werner@suse.de ++++++ ksh93-uname.dif ++++++ --- src/lib/libcmd/uname.c +++ src/lib/libcmd/uname.c 2006-05-29 13:11:43.000000000 +0000 @@ -82,9 +82,11 @@ #define MAXHOSTNAME 64 #if _lib_uname && _sys_utsname +# include <sys/utsname.h> +#endif -#include <sys/utsname.h> - +#ifdef __linux__ +# include <sys/sysctl.h> #endif #if defined(__STDPP__directive) && defined(__STDPP__hide) @@ -186,7 +188,11 @@ #define OPT_version (1<<3) #define OPT_machine (1<<4) -#define OPT_ALL 5 +#ifdef __linux__ +# define OPT_ALL 6 +#else +# define OPT_ALL 5 +#endif #define OPT_processor (1<<5) #define OPT_hostid (1<<6) @@ -258,6 +264,9 @@ { case 'a': flags |= OPT_all|((1L<<OPT_ALL)-1); +#ifdef __linux__ + flags |= OPT_implementation; +#endif continue; case 'b': flags |= OPT_base; @@ -311,7 +320,11 @@ sethost = opt_info.arg; continue; case ':': +#ifdef __linux__ + s = "/bin/uname"; +#else s = "/usr/bin/uname"; +#endif if (!streq(argv[0], s) && (!eaccess(s, X_OK) || !eaccess(s+=4, X_OK))) { argv[0] = s; @@ -380,7 +393,35 @@ output(OPT_machine, ut.machine, "machine"); if (flags & OPT_processor) { - if (!*(s = astconf("ARCHITECTURE", NiL, NiL))) + s = NULL; +#ifdef __linux__ +# ifdef UNAME_PROCESSOR + if (!s) { + size_t len = sizeof(buf) - 1; + int ctl[] = {CTL_HW, UNAME_PROCESSOR}; + if (sysctl(ctl, 2, buf, &len, 0, 0) == 0) + s = buf; + } +# endif + if (!s) { + strcpy((s = buf), ut.machine); + if (strcmp(s, "i686") == 0) { + char line[1024]; + Sfio_t *io = sfopen((Sfio_t*)0, "/proc/cpuinfo", "r"); + if (io) { + while (fgets(line, sizeof(line), io) > 0) { + if (strncmp(line, "vendor_id", 9) == 0) { + if (strstr(line, "AuthenticAMD")) + s = "athlon"; + break; + } + } + sfclose(io); + } + } + } +#endif + if (!s && !*(s = astconf("ARCHITECTURE", NiL, NiL))) { if (t = strchr(hosttype, '.')) t++; @@ -392,7 +433,15 @@ } if (flags & OPT_implementation) { - if (!*(s = astconf("PLATFORM", NiL, NiL))) + s = NULL; +#ifdef __linux__ + if (!s) { + strcpy((s = buf), ut.machine); + if (s[0] == 'i' && s[2] == '8' && s[3] == '6' && s[4] == '\0') + s[1] = '3'; + } +#endif + if (!s && !*(s = astconf("PLATFORM", NiL, NiL))) s = astconf("HW_NAME", NiL, NiL); output(OPT_implementation, s, "implementation"); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de