diff options
Diffstat (limited to 'source/a/eject')
-rw-r--r-- | source/a/eject/eject.CDROM_DRIVE_STATUS.diff | 76 | ||||
-rwxr-xr-x | source/a/eject/eject.SlackBuild | 123 | ||||
-rw-r--r-- | source/a/eject/eject.spaces.diff | 51 | ||||
-rw-r--r-- | source/a/eject/slack-desc | 19 |
4 files changed, 0 insertions, 269 deletions
diff --git a/source/a/eject/eject.CDROM_DRIVE_STATUS.diff b/source/a/eject/eject.CDROM_DRIVE_STATUS.diff deleted file mode 100644 index 0a80739f..00000000 --- a/source/a/eject/eject.CDROM_DRIVE_STATUS.diff +++ /dev/null @@ -1,76 +0,0 @@ -# Make CDROM tray toggle more robust by using CDS_TRAY_OPEN -# when avaiable. -# Also includes Slackware's eject_for_mac.patch -# -diff -Nurp eject.old/eject.c eject.new/eject.c ---- eject.old/eject.c 2013-02-19 10:18:36.041669514 +0000 -+++ eject.new/eject.c 2013-02-19 10:33:04.289392780 +0000 -@@ -564,34 +564,45 @@ static void ToggleTray(int fd) - { - struct timeval time_start, time_stop; - int time_elapsed; -+ int status; - - #ifdef CDROMCLOSETRAY -+ -+ status = ioctl(fd, CDROM_DRIVE_STATUS, 0); -+ if (status == CDS_TRAY_OPEN) { -+ CloseTray(fd); -+ } else { - -- /* Try to open the CDROM tray and measure the time therefor -- * needed. In my experience the function needs less than 0.05 -- * seconds if the tray was already open, and at least 1.5 seconds -- * if it was closed. */ -- gettimeofday(&time_start, NULL); -+ /* Try to open the CDROM tray and measure the time therefor -+ * needed. In my experience the function needs less than 0.05 -+ * seconds if the tray was already open, and at least 1.5 seconds -+ * if it was closed. */ -+ gettimeofday(&time_start, NULL); - -- /* Send the CDROMEJECT command to the device. */ -- if (ioctl(fd, CDROMEJECT, 0) < 0) { -- perror("ioctl"); -- exit(1); -+ /* Send the CDROMEJECT command to the device. */ -+ if (ioctl(fd, CDROMEJECT, 0) < 0 && errno != EIO) { -+ perror("ioctl CDROMEJECT"); -+ exit(1); -+ } -+ -+ /* Get the second timestamp, to measure the time needed to open -+ * the tray. */ -+ gettimeofday(&time_stop, NULL); -+ -+ /* If the ioctl returns CDS_TRAY_OPEN now then we can ignore -+ * the guess based on elapsed-time */ -+ status = ioctl(fd, CDROM_DRIVE_STATUS, 0); -+ if (status != CDS_TRAY_OPEN) { -+ time_elapsed = (time_stop.tv_sec * 1000000 + time_stop.tv_usec) - -+ (time_start.tv_sec * 1000000 + time_start.tv_usec); -+ -+ /* If the tray "opened" too fast, we can be nearly sure, that it -+ * was already open. In this case, close it now. Else the tray was -+ * closed before. This would mean that we are done. */ -+ if (time_elapsed < TRAY_WAS_ALREADY_OPEN_USECS) -+ CloseTray(fd); -+ } - } -- -- /* Get the second timestamp, to measure the time needed to open -- * the tray. */ -- gettimeofday(&time_stop, NULL); -- -- time_elapsed = (time_stop.tv_sec * 1000000 + time_stop.tv_usec) - -- (time_start.tv_sec * 1000000 + time_start.tv_usec); -- -- /* If the tray "opened" too fast, we can be nearly sure, that it -- * was already open. In this case, close it now. Else the tray was -- * closed before. This would mean that we are done. */ -- if (time_elapsed < TRAY_WAS_ALREADY_OPEN_USECS) -- CloseTray(fd); -- - #else - fprintf(stderr, _("%s: CD-ROM tray toggle command not supported by this kernel\n"), programName); - #endif diff --git a/source/a/eject/eject.SlackBuild b/source/a/eject/eject.SlackBuild deleted file mode 100755 index 7d2c0982..00000000 --- a/source/a/eject/eject.SlackBuild +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh - -# Copyright 2006, 2008, 2009, 2010, 2012, 2013 Patrick J. Volkerding, Sebeka, MN, USA -# All rights reserved. -# -# Redistribution and use of this script, with or without modification, is -# permitted provided that the following conditions are met: -# -# 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -PKGNAM=eject -VERSION=${VERSION:-2.1.5} -BUILD=${BUILD:-4} - -# 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-${PKGNAM} -rm -rf $PKG -mkdir -p $TMP $PKG - -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" -elif [ "$ARCH" = "s390" ]; then - SLKCFLAGS="-O2" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" -else - SLKCFLAGS="-O2" -fi - -cd $TMP -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 - -# Fix "eject -T": -zcat $CWD/eject.CDROM_DRIVE_STATUS.diff.gz | patch -p1 --verbose || exit 1 - -# Make sure ownerships and permissions are sane: -chown -R root:root . -find . \ - \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; - -# Configure: -CFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - $ARCH-slackware-linux - -# Build and install: -make -j4 || exit 1 -make install DESTDIR=$PKG || exit 1 - -# Strip binaries: -( cd $PKG - find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null - find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null -) - -# Compress and link manpages, if any: -if [ -d $PKG/usr/man ]; then - ( cd $PKG/usr/man - for manpagedir in $(find . -type d -name "man*") ; do - ( cd $manpagedir - for eachpage in $( find . -type l -maxdepth 1) ; do - ln -s $( readlink $eachpage ).gz $eachpage.gz - rm $eachpage - done - gzip -9 *.? - ) - done - ) -fi - -# Compress info files, if any: -if [ -d $PKG/usr/info ]; then - ( cd $PKG/usr/info - rm -f dir - gzip -9 * - ) -fi - -# Add a documentation directory: -mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION -cp -a \ - AUTHORS COPYING NEWS PORTING PROBLEMS README TODO eject-$VERSION.lsm \ - $PKG/usr/doc/${PKGNAM}-$VERSION - -mkdir -p $PKG/install -cat $CWD/slack-desc > $PKG/install/slack-desc - -cd $TMP/package-${PKGNAM} -makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz - diff --git a/source/a/eject/eject.spaces.diff b/source/a/eject/eject.spaces.diff deleted file mode 100644 index 2935b24b..00000000 --- a/source/a/eject/eject.spaces.diff +++ /dev/null @@ -1,51 +0,0 @@ ---- 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); diff --git a/source/a/eject/slack-desc b/source/a/eject/slack-desc deleted file mode 100644 index 624b05b7..00000000 --- a/source/a/eject/slack-desc +++ /dev/null @@ -1,19 +0,0 @@ -# HOW TO EDIT THIS FILE: -# The "handy ruler" below makes it easier to edit a package description. Line -# up the first '|' above the ':' following the base package name, and the '|' -# on the right side marks the last column you can put a character in. You must -# make exactly 11 lines for the formatting to be correct. It's also -# customary to leave one space after the ':'. - - |-----handy-ruler------------------------------------------------------| -eject: eject (a tool to eject removable media) -eject: -eject: Eject allows removable media (typically a DVD, CD, floppy disk, tape, -eject: etc.) to be ejected under software control. The command can also -eject: control some multi-disc changers, the auto-eject feature supported by -eject: some devices, and can close the disc tray of some drives. -eject: -eject: The 'eject' program was written by Jeff Tranter. -eject: -eject: -eject: |