revert chg-multi.sh.in and apply patch from svn for typos
authorBdale Garbee <bdale@gag.com>
Sat, 16 Aug 2008 17:24:37 +0000 (14:24 -0300)
committerBdale Garbee <bdale@gag.com>
Sat, 16 Aug 2008 17:24:37 +0000 (14:24 -0300)
changer-src/chg-multi.sh.in
debian/changelog

index a5d3fdbbe14a068a74ebc4b5da1c25a163c33e83..af324327a1e79a6a11d54fc89e41c5be45e68138 100644 (file)
 # chg-multi.sh - generic tape changer script
 #
 
-# source utility functions and values from configure
+prefix=@prefix@
 exec_prefix=@exec_prefix@
+sbindir=@sbindir@
 libexecdir=@libexecdir@
-. ${libexecdir}/chg-lib.sh
 
 pname="chg-multi"
 
+PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
+export PATH
+
 if [ -d "@AMANDA_DBGDIR@" ]; then
        logfile=@AMANDA_DBGDIR@/changer.debug
 else
        logfile=/dev/null
 fi
 
+# support simultaneous development with and without gettext
+_() {
+        fmt="$1"
+        shift
+        printf "$fmt" $*
+}
+
 echo `_ "arguments ->"` "$@" >> $logfile
 
-ourconf=`amgetconf changerfile`
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+       SUF="-@VERSION@"
+else
+       SUF=
+fi
+
+ourconf=`amgetconf$SUF changerfile`
 
-if ! error=try_find_mt; then
-    echo <none> $error
-    exit 2
+if [ -x $sbindir/ammt$SUF ]; then
+       MT=$sbindir/ammt$SUF
+       MTF=-f
+elif [ -x "@MT@" ]; then
+       MT=@MT@
+       MTF=@MT_FILE_FLAG@
+else
+       answer=`_ '<none> %s: mt program not found' "$myname"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 1
 fi
+echo "MT ->" $MT $MTF >> $logfile
 
 EXPR=expr
 # EXPR=/usr/local/bin/expr # in case you need a more powerful expr...
@@ -300,7 +326,8 @@ then
                exit 2
            fi
            echo `_ '     -> offline'` "$device" >> $logfile
-            if ! try_eject_device $device; then
+           $MT $MTF $device offline >> $logfile 2>&1
+           if [ $? -ne 0 ]; then
                answer=`_ '%s %s: %s: unable to change to slot %s' "$newslot" "$pname" "$device" "$curslot"`
                echo `_ 'Exit ->'` $answer >> $logfile
                echo $answer
@@ -343,7 +370,7 @@ then
                exit 2
        fi
        echo `_ '     -> offline'` $device >> $logfile
-        try_eject_device $device
+       $MT $MTF $device offline >> $logfile 2>&1
        if [ $? -ne 0 ]; then
                #
                # XXX if the changer-specific eject command can distinguish
@@ -382,7 +409,8 @@ if [ $loadslot -eq 1 ]; then        # load the tape from the slot
                echo $answer
                exit 2
        fi
-        amdevcheck_status $device
+       echo `_ '     -> rewind'` $device >> $logfile
+       $MT $MTF $device rewind >> $logfile 2>&1
        if [ $? -ne 0 ]; then
                #
                # XXX if the changer-specific load command can distinguish
index 268906e7074f04a7881202152ebf10f8b7c108bb..38d7f2a9347fa931188285d5b6192ed8ae7ee2b6 100644 (file)
@@ -4,6 +4,8 @@ amanda (1:2.5.2p1-4) UNRELEASED; urgency=high
   * update version thresholds in Replaces to ease upgrades, closes: #476583
   * don't set maxdumpsize in the default amanda.conf, closes: #475524
   * freshen to latest standards version
+  * revert chg-multi.sh.in and patch since the new version previously pulled 
+    in caused more problems than it solved, closes: #486384
 
  -- Bdale Garbee <bdale@gag.com>  Sat, 16 Aug 2008 12:05:05 -0300