From: Bdale Garbee Date: Sun, 15 Feb 2004 05:36:23 +0000 (-0700) Subject: Imported Debian patch 1.2.16rel-4 X-Git-Tag: debian/1.2.16rel-4^0 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a1832dcca7c9a1d8a23a8b327d693c95f5bb98c5;p=debian%2Fmtx Imported Debian patch 1.2.16rel-4 --- diff --git a/debian/bash_completion b/debian/bash_completion new file mode 100644 index 0000000..2b29ac8 --- /dev/null +++ b/debian/bash_completion @@ -0,0 +1,45 @@ +# mtx completion by Jon Middleton +# +# $Id: bash_completion,v 1.1 2004/02/15 05:43:25 bdale Exp $ + +_mtx() +{ + local cur prev options tapes drives + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + options="-f nobarcode invert noattach --version inquiry noattach \ + inventory status load unload eepos first last next" + + tapes=$(mtx status | \ + awk '/Storage Element [0-9]+:Full/ { printf "%s ", $3 }') + tapes=${tapes//:Full} + + drives=$(mtx status | \ + awk '/Data Transfer Element [0-9]+:(Full|Empty)/ { printf "%s ", $4 }') + drives=${drives//:Full} + drives=${drives//:Empty} + + if [ $COMP_CWORD -gt 1 ]; then + case $prev in + load) + COMPREPLY=( $( compgen -W "$tapes" -- $cur ) ) + ;; + unload|first|last|next) + COMPREPLY=( $( compgen -W "$drives" -- $cur ) ) + ;; + -f) + true + ;; + *) + true + ;; + esac + else + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + fi + return 0 +} +complete -F _mtx mtx diff --git a/debian/changelog b/debian/changelog index 22afc9f..a9222e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +mtx (1.2.16rel-4) unstable; urgency=medium + + * revert SG_SCSI_DEFAULT_TIMEOUT to 5 minutes since at least the Sony + TLS-9000 takes more than a minute to load sometimes, closes: #229169 + * remove 'previous' from command summary, since it's not actually + implemented in the program, closes: #230041 + * include bash_completion file from Jon Middleton, closes: #227456 + + -- Bdale Garbee Sat, 14 Feb 2004 22:36:23 -0700 + mtx (1.2.16rel-3) unstable; urgency=low * apply patch from Torsten Werner that elminates diff --git a/debian/dirs b/debian/dirs index 236670a..ce5d4fb 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1 +1,2 @@ +etc/bash_completion.d usr/sbin diff --git a/debian/rules b/debian/rules index a6b3ef8..6e2a299 100755 --- a/debian/rules +++ b/debian/rules @@ -36,6 +36,8 @@ install: build make install bindir=`pwd`/debian/mtx/bin prefix=`pwd`/debian/mtx/usr \ mandir=`pwd`/debian/mtx/usr/share/man + install -o root -g root -m 0644 debian/bash_completion \ + debian/mtx/etc/bash_completion.d/mtx # Build architecture-independent files here. binary-indep: build install diff --git a/mtx.c b/mtx.c index 7390566..7eed0ba 100644 --- a/mtx.c +++ b/mtx.c @@ -157,7 +157,6 @@ static void Usage() mtx [ -f ] first []\n\ mtx [ -f ] last []\n\ mtx [ -f ] next []\n\ - mtx [ -f ] previous []\n\ mtx [ -f ] [invert] load []\n\ mtx [ -f ] [invert] unload [][]\n\ mtx [ -f ] [eepos eepos-number] transfer \n\ diff --git a/scsi_linux.c b/scsi_linux.c index e637184..c5a3508 100644 --- a/scsi_linux.c +++ b/scsi_linux.c @@ -56,11 +56,11 @@ $Revision: 1.2 $ #define STILL_A_VALID_READ(s) (HIT_FILEMARK(s) || SHORT_READ(s) || HIT_EOD(s) || HIT_EOP(s) || HIT_EOM(s)) -#define SG_SCSI_DEFAULT_TIMEOUT SG_DEFAULT_TIMEOUT +#define SG_SCSI_DEFAULT_TIMEOUT HZ*60*5 /* 5 minutes */ DEVICE_TYPE SCSI_OpenDevice(char *DeviceName) { - int timeout=SG_SCSI_DEFAULT_TIMEOUT; /* 5 minutes */ + int timeout=SG_SCSI_DEFAULT_TIMEOUT; int DeviceFD = open(DeviceName, O_RDWR); if (DeviceFD < 0) FatalError("cannot open SCSI device '%s' - %m\n", DeviceName);