From b76270bf9e6dd375e495fec92140a79a79415d27 Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Wed, 19 May 2010 08:58:23 +0000 Subject: Slackware 13.1 Wed May 19 08:58:23 UTC 2010 Slackware 13.1 x86_64 stable is released! Lots of thanks are due -- see the RELEASE_NOTES and the rest of the ChangeLog for credits. The ISOs are on their way to replication, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We are taking pre-orders now at store.slackware.com, and offering a discount if you sign up for a subscription. Consider picking up a copy to help support the project. Thanks again to the Slackware community for testing, contributing, and generally holding us to a high level of quality. :-) Enjoy! --- source/a/eject/eject.SlackBuild | 21 +++++++++++++---- source/a/eject/eject.spaces.diff | 51 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 source/a/eject/eject.spaces.diff (limited to 'source/a/eject') diff --git a/source/a/eject/eject.SlackBuild b/source/a/eject/eject.SlackBuild index 56d1e79fc..c637ef553 100755 --- a/source/a/eject/eject.SlackBuild +++ b/source/a/eject/eject.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2006, 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2006, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,9 +23,17 @@ PKGNAM=eject VERSION=${VERSION:-2.1.5} -ARCH=${ARCH:-x86_64} -BUILD=${BUILD:-1} - +BUILD=${BUILD:-2} + +# 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} @@ -39,6 +47,8 @@ elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" +else + SLKCFLAGS="-O2" fi cd $TMP @@ -46,6 +56,9 @@ rm -rf ${PKGNAM} tar xjvf $CWD/${PKGNAM}-$VERSION.tar.bz2 cd ${PKGNAM} +# Patch a problem with spaces in the pathname: +zcat $CWD/eject.spaces.diff.gz | patch -p0 --verbose || exit 1 + # Make sure ownerships and permissions are sane: chown -R root:root . find . \ diff --git a/source/a/eject/eject.spaces.diff b/source/a/eject/eject.spaces.diff new file mode 100644 index 000000000..2935b24bb --- /dev/null +++ b/source/a/eject/eject.spaces.diff @@ -0,0 +1,51 @@ +--- eject.c 15 Jul 2006 23:28:28 -0000 1.10 ++++ eject.c 2007-02-14 13:57:52.000000000 +0100 +@@ -379,6 +379,30 @@ static int FileExists(const char *name, + + + /* ++ * Linux mangles spaces in mount points by changing them to an octal string ++ * of '\040'. So lets scan the mount point and fix it up by replacing all ++ * occurrences off '\0##' with the ASCII value of 0##. Requires a writable ++ * string as input as we mangle in place. Some of this was taken from the ++ * util-linux package. ++ */ ++#define octalify(a) ((a) & 7) ++#define tooctal(s) (64*octalify(s[1]) + 8*octalify(s[2]) + octalify(s[3])) ++#define isoctal(a) (((a) & ~7) == '0') ++static char *DeMangleMount(char *s) ++{ ++ char *tmp = s; ++ while ((tmp = strchr(tmp, '\\')) != NULL) { ++ if (tmp[1] == '0' && isoctal(tmp[2]) && isoctal(tmp[3])) { ++ tmp[0] = tooctal(tmp); ++ memmove(tmp+1, tmp+4, strlen(tmp)-3); ++ } ++ ++tmp; ++ } ++ return s; ++} ++ ++ ++/* + * Given name, such as foo, see if any of the following exist: + * + * foo (if foo starts with '.' or '/') +@@ -890,6 +914,8 @@ static int MountedDevice(const char *nam + if (rc >= 2) { + int mtabmaj, mtabmin; + GetMajorMinor(s1, &mtabmaj, &mtabmin); ++ DeMangleMount(s1); ++ DeMangleMount(s2); + if (((strcmp(s1, name) == 0) || (strcmp(s2, name) == 0)) || + ((maj != -1) && (maj == mtabmaj) && (min == mtabmin))) { + FCLOSE(fp); +@@ -935,6 +961,8 @@ static int MountableDevice(const char *n + + while (fgets(line, sizeof(line), fp) != 0) { + rc = sscanf(line, "%1023s %1023s", s1, s2); ++ DeMangleMount(s1); ++ DeMangleMount(s2); + if (rc >= 2 && s1[0] != '#' && strcmp(s2, name) == 0) { + FCLOSE(fp); + *deviceName = strdup(s1); -- cgit v1.2.3-65-gdbad