diff options
Diffstat (limited to 'source/a/coreutils')
-rw-r--r-- | source/a/coreutils/coreutils-dircolors.csh | 6 | ||||
-rw-r--r-- | source/a/coreutils/coreutils-dircolors.sh | 47 | ||||
-rwxr-xr-x | source/a/coreutils/coreutils.SlackBuild | 69 | ||||
-rw-r--r-- | source/a/coreutils/coreutils.uname.diff | 183 |
4 files changed, 156 insertions, 149 deletions
diff --git a/source/a/coreutils/coreutils-dircolors.csh b/source/a/coreutils/coreutils-dircolors.csh index 38d73ca2..d7234c85 100644 --- a/source/a/coreutils/coreutils-dircolors.csh +++ b/source/a/coreutils/coreutils-dircolors.csh @@ -18,8 +18,8 @@ setenv COLOR auto # simply setting the LS_OPTIONS variable using the information # already given above: setenv LS_OPTIONS " $OPTIONS --color=$COLOR " -unset COLOR -unset OPTIONS +unsetenv COLOR +unsetenv OPTIONS # Set up aliases to use color ls by default. A few additional # aliases like 'dir', 'vdir', etc, are some ancient artifacts @@ -30,7 +30,7 @@ alias dir '/bin/ls $LS_OPTIONS --format=vertical'; alias vdir '/bin/ls $LS_OPTIONS --format=long'; alias d dir; alias v vdir; -unset noglob; +unsetenv noglob; # Set up the LS_COLORS environment: [ -f $HOME/.dir_colors ] diff --git a/source/a/coreutils/coreutils-dircolors.sh b/source/a/coreutils/coreutils-dircolors.sh index 728ea745..fc848c6f 100644 --- a/source/a/coreutils/coreutils-dircolors.sh +++ b/source/a/coreutils/coreutils-dircolors.sh @@ -6,13 +6,7 @@ # -F = show '/' for dirs, '*' for executables, etc. # -T 0 = don't trust tab spacing when formatting ls output. # -b = better support for special characters -if [ "$SHELL" != "/bin/zsh" ]; then - # Edit options below for all sh-like shells except zsh: - OPTIONS="-F -b -T 0" -else - # If you use zsh, edit the options below instead: - OPTIONS=( -F -b -T 0 ) -fi +OPTIONS="-F -b -T 0" # COLOR needs one of these arguments: # 'auto' colorizes output to ttys, but not pipes. @@ -20,14 +14,11 @@ fi # 'never' shuts colorization off. COLOR=auto + # This section shouldn't require any user adjustment since it is # simply setting the LS_OPTIONS variable using the information # already given above: -if [ "$SHELL" = "/bin/zsh" ]; then - LS_OPTIONS=( $OPTIONS --color=$COLOR ); -else - LS_OPTIONS=" $OPTIONS --color=$COLOR "; -fi +LS_OPTIONS="$OPTIONS --color=$COLOR"; export LS_OPTIONS; unset COLOR unset OPTIONS @@ -36,23 +27,21 @@ unset OPTIONS # aliases like 'dir', 'vdir', etc, are some ancient artifacts # from 1992 or so... possibly they should be disabled, but maybe # someone out there is actually using them? :-) -# Assume shell aliases are supported. Ash is going to freak out -# when it sees zsh syntax anyway, so whatever. -alias ls='/bin/ls $LS_OPTIONS'; -alias dir='/bin/ls $LS_OPTIONS --format=vertical'; -alias vdir='/bin/ls $LS_OPTIONS --format=long'; -alias d=dir; -alias v=vdir; - -# Just for fun, here are the old sh/ash style shell functions. -# this script isn't currently working with ash (and makes some noisy -# error messages), but perhaps these will still be of use to -# someone... -#ls () { /bin/ls $LS_OPTIONS "$@" ; }; -#dir () { /bin/ls $LS_OPTIONS --format=vertical "$@" ; }; -#vdir () { /bin/ls $LS_OPTIONS --format=long "$@" ; }; -#d () { dir "$@" ; }; -#v () { vdir "$@" ; }; +# Assume shell aliases are supported. +if [ "$SHELL" = "/bin/zsh" ] ; then + # By default, zsh doesn't split parameters into separate words + # when it encounters whitespace. The '=' flag will fix this. + # see zshexpn(1) man-page regarding SH_WORD_SPLIT. + alias ls='/bin/ls ${=LS_OPTIONS}' + alias dir='/bin/ls ${=LS_OPTIONS} --format=vertical' + alias vdir='/bin/ls ${=LS_OPTIONS} --format=long' +else + alias ls='/bin/ls $LS_OPTIONS' + alias dir='/bin/ls $LS_OPTIONS --format=vertical' + alias vdir='/bin/ls $LS_OPTIONS --format=long' +fi +alias d=dir +alias v=vdir # Set up the LS_COLORS environment: if [ -f $HOME/.dir_colors ]; then diff --git a/source/a/coreutils/coreutils.SlackBuild b/source/a/coreutils/coreutils.SlackBuild index bc043427..3d31bf9f 100755 --- a/source/a/coreutils/coreutils.SlackBuild +++ b/source/a/coreutils/coreutils.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2005-2009 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2005-2010 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -20,47 +20,64 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -PRGNAM=coreutils -VERSION=${VERSION:-7.4} -ARCH=${ARCH:-x86_64} -BUILD=${BUILD:-1} +PKGNAM=coreutils +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | cut -d - -f 2 | rev | cut -f 3- -d . | rev)} +BUILD=${BUILD:-3} NUMJOBS=${NUMJOBS:--j6} +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + CWD=$(pwd) TMP=${TMP:-/tmp} -PKG=$TMP/package-$PRGNAM +PKG=$TMP/package-$PKGNAM if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" + LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" elif [ "$ARCH" = "arm" ]; then SLKCFLAGS="-O2 -march=armv4 -mtune=xscale" + LIBDIRSUFFIX="" elif [ "$ARCH" = "armel" ]; then SLKCFLAGS="-O2 -march=armv4t" + LIBDIRSUFFIX="" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi rm -rf $PKG mkdir -p $TMP $PKG cd $TMP -rm -rf $PRGNAM-$VERSION -if [ -r $CWD/$PRGNAM-$VERSION.tar.gz ]; then - tar xf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1 -elif [ -r $CWD/$PRGNAM-$VERSION.tar.bz2 ]; then - tar xf $CWD/$PRGNAM-$VERSION.tar.bz2 || exit 1 -elif [ -r $CWD/$PRGNAM-$VERSION.tar.xz ]; then - tar xf $CWD/$PRGNAM-$VERSION.tar.xz || exit 1 -elif [ -r $CWD/$PRGNAM-$VERSION.tar.lzma ]; then - tar xf $CWD/$PRGNAM-$VERSION.tar.lzma || exit 1 +rm -rf $PKGNAM-$VERSION +if [ -r $CWD/$PKGNAM-$VERSION.tar.gz ]; then + tar xf $CWD/$PKGNAM-$VERSION.tar.gz || exit 1 +elif [ -r $CWD/$PKGNAM-$VERSION.tar.bz2 ]; then + tar xf $CWD/$PKGNAM-$VERSION.tar.bz2 || exit 1 +elif [ -r $CWD/$PKGNAM-$VERSION.tar.xz ]; then + tar xf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1 +elif [ -r $CWD/$PKGNAM-$VERSION.tar.lzma ]; then + tar xf $CWD/$PKGNAM-$VERSION.tar.lzma || exit 1 else exit 1 fi -cd $PRGNAM-$VERSION +cd $PKGNAM-$VERSION chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ @@ -68,8 +85,8 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# Patch in the uname for Linux enhancements -zcat $CWD/$PRGNAM.uname.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 +# Patch uname to correctly display CPU information: +zcat $CWD/$PKGNAM.uname.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 # Compilation with glibc version later than 2.3.2 needs the environment # variable DEFAULT_POSIX2_VERSION set to 199209. @@ -87,6 +104,8 @@ DEFAULT_POSIX2_VERSION=199209 \ --mandir=/usr/man \ --infodir=/usr/info \ --sysconfdir=/etc \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --without-gmp \ --build=$ARCH-slackware-linux make $NUMJOBS || make || exit 1 @@ -153,10 +172,18 @@ done rm -f $PKG/usr/info/dir gzip -9 $PKG/usr/info/* -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION cp -a \ ABOUT-NLS AUTHORS COPYING* NEWS README THANKS THANKS-to-translators TODO \ - $PKG/usr/doc/$PRGNAM-$VERSION + $PKG/usr/doc/$PKGNAM-$VERSION + +# If there's a ChangeLog, installing at least part of the recent history +# is useful, but don't let it get totally out of control: +if [ -r ChangeLog ]; then + DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION) + cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog + touch -r ChangeLog $DOCSDIR/ChangeLog +fi mkdir -p $PKG/install zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh @@ -164,5 +191,5 @@ cat $CWD/slack-desc > $PKG/install/slack-desc # Build the package: cd $PKG -/sbin/makepkg -l y -c n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.txz +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz diff --git a/source/a/coreutils/coreutils.uname.diff b/source/a/coreutils/coreutils.uname.diff index bd39221c..69911031 100644 --- a/source/a/coreutils/coreutils.uname.diff +++ b/source/a/coreutils/coreutils.uname.diff @@ -1,15 +1,6 @@ -Submitted By: Jim Gifford <jim at linuxfromscratch dot org> -Date: 2006-08-24 -Initial Package Version: 5.97 -Upstream Status: Not Accepted -Origin: Gentoo - http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/coreutils -Description: Display CPU Information from /proc/cpuinfo or /proc/sysinfo - -Original Patch by - Matthew Burgess and Scot McPherson - -diff -Nur coreutils-7.1.orig/src/uname.c coreutils-7.1/src/uname.c ---- coreutils-7.1/src/uname.c 2008-09-18 02:06:57.000000000 -0500 -+++ coreutils-7.1/src/uname.c 2009-02-22 21:23:02.209219703 -0600 +diff -Nur coreutils-7.6.orig/src/uname.c coreutils-7.6/src/uname.c +--- coreutils-7.6.orig/src/uname.c 2009-09-01 06:01:16.000000000 -0500 ++++ coreutils-7.6/src/uname.c 2009-09-15 08:55:26.239452858 -0500 @@ -50,6 +50,11 @@ # include <mach-o/arch.h> #endif @@ -41,87 +32,87 @@ diff -Nur coreutils-7.1.orig/src/uname.c coreutils-7.1/src/uname.c + +static void __eat_cpuinfo_space(char *buf) +{ -+ /* first eat trailing space */ -+ char *tmp = buf + strlen(buf) - 1; -+ while (tmp > buf && isspace(*tmp)) -+ *tmp-- = '\0'; -+ /* then eat leading space */ -+ tmp = buf; -+ while (*tmp && isspace(*tmp)) -+ tmp++; -+ if (tmp != buf) -+ memmove(buf, tmp, strlen(tmp)+1); ++ /* first eat trailing space */ ++ char *tmp = buf + strlen(buf) - 1; ++ while (tmp > buf && isspace(*tmp)) ++ *tmp-- = '\0'; ++ /* then eat leading space */ ++ tmp = buf; ++ while (*tmp && isspace(*tmp)) ++ tmp++; ++ if (tmp != buf) ++ memmove(buf, tmp, strlen(tmp)+1); +} + +static int __linux_procinfo (int x, char *fstr, size_t s) +{ -+ FILE *fp; ++ FILE *fp; + -+ char *procinfo_keys[] = { -+ /* --processor --hardware-platform */ -+ #if defined(__alpha__) -+ "cpu model", "system type" -+ #elif defined(__arm__) -+ "Processor", "Hardware" -+ #elif defined(bfin) -+ "CPU", "BOARD Name" -+ #elif defined(__cris__) -+ "cpu", "cpu model" -+ #elif defined(__frv__) -+ "CPU-Core", "System" -+ #elif defined(__i386__) || defined(__x86_64__) -+ "model name", "vendor_id" -+ #elif defined(__ia64__) -+ "family", "vendor" -+ #elif defined(__hppa__) -+ "cpu", "model" -+ #elif defined(__m68k__) -+ "CPU", "MMU" -+ #elif defined(__mips__) -+ "cpu model", "system type" -+ #elif defined(__powerpc__) || defined(__powerpc64__) -+ "cpu", "machine" -+ #elif defined(__s390__) || defined(__s390x__) -+ "Type", "Manufacturer" -+ #elif defined(__sh__) -+ "cpu type", "machine" -+ #elif defined(sparc) || defined(__sparc__) -+ "type", "cpu" -+ #elif defined(__vax__) -+ "cpu type", "cpu" -+ #else -+ "unknown", "unknown" -+ #endif -+ }; ++ char *procinfo_keys[] = { ++ /* --processor --hardware-platform */ ++ #if defined(__alpha__) ++ "cpu model", "system type" ++ #elif defined(__arm__) ++ "Processor", "Hardware" ++ #elif defined(bfin) ++ "CPU", "BOARD Name" ++ #elif defined(__cris__) ++ "cpu", "cpu model" ++ #elif defined(__frv__) ++ "CPU-Core", "System" ++ #elif defined(__i386__) || defined(__x86_64__) ++ "model name", "vendor_id" ++ #elif defined(__ia64__) ++ "family", "vendor" ++ #elif defined(__hppa__) ++ "cpu", "model" ++ #elif defined(__m68k__) ++ "CPU", "MMU" ++ #elif defined(__mips__) ++ "cpu model", "system type" ++ #elif defined(__powerpc__) || defined(__powerpc64__) ++ "cpu", "machine" ++ #elif defined(__s390__) || defined(__s390x__) ++ "Type", "Manufacturer" ++ #elif defined(__sh__) ++ "cpu type", "machine" ++ #elif defined(sparc) || defined(__sparc__) ++ "type", "cpu" ++ #elif defined(__vax__) ++ "cpu type", "cpu" ++ #else ++ "unknown", "unknown" ++ #endif ++ }; + -+ if ((fp = fopen(CPUINFO_FILE, "r")) != NULL) { -+ char key[65], value[257], eol, *ret = NULL; ++ if ((fp = fopen(CPUINFO_FILE, "r")) != NULL) { ++ char key[65], value[257], eol, *ret = NULL; + -+ while (fscanf(fp, CPUINFO_FORMAT, key, value, &eol) != EOF) { -+ __eat_cpuinfo_space(key); -+ if (!strcmp(key, procinfo_keys[x])) { -+ __eat_cpuinfo_space(value); -+ ret = value; -+ break; -+ } -+ if (eol != '\n') { -+ /* we need two fscanf's here in case the previous -+ * length limit caused us to read right up to the -+ * newline ... doing "%*[^\n]\n" wont eat the newline -+ */ -+ fscanf(fp, "%*[^\n]"); -+ fscanf(fp, "\n"); -+ } -+ } -+ fclose(fp); ++ while (fscanf(fp, CPUINFO_FORMAT, key, value, &eol) != EOF) { ++ __eat_cpuinfo_space(key); ++ if (!strcmp(key, procinfo_keys[x])) { ++ __eat_cpuinfo_space(value); ++ ret = value; ++ break; ++ } ++ if (eol != '\n') { ++ /* we need two fscanf's here in case the previous ++ * length limit caused us to read right up to the ++ * newline ... doing "%*[^\n]\n" wont eat the newline ++ */ ++ fscanf(fp, "%*[^\n]"); ++ fscanf(fp, "\n"); ++ } ++ } ++ fclose(fp); + -+ if (ret) { -+ strncpy(fstr, ret, s); -+ return 0; -+ } -+ } ++ if (ret) { ++ strncpy(fstr, ret, s); ++ return 0; ++ } ++ } + -+ return -1; ++ return -1; +} + +#endif @@ -136,26 +127,26 @@ diff -Nur coreutils-7.1.orig/src/uname.c coreutils-7.1/src/uname.c -#if HAVE_SYSINFO && defined SI_ARCHITECTURE +#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO) { - static char processor[257]; + static char processor[257]; +#if defined(USE_PROCINFO) -+ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor)) ++ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor)) +#else - if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) + if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) +#endif - element = processor; + element = processor; } #endif @@ -358,9 +467,13 @@ if (element == unknown) - { - static char hardware_platform[257]; + { + static char hardware_platform[257]; +#if defined(USE_PROCINFO) -+ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform)) ++ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform)) +#else - size_t s = sizeof hardware_platform; - static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM }; - if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0) + size_t s = sizeof hardware_platform; + static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM }; + if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0) +#endif - element = hardware_platform; - } + element = hardware_platform; + } #endif |