Imported Debian patch 1.2.16rel-3 debian/1.2.16rel-3
authorBdale Garbee <bdale@gag.com>
Tue, 16 Dec 2003 17:04:26 +0000 (10:04 -0700)
committerBdale Garbee <bdale@gag.com>
Thu, 5 Jun 2008 23:26:56 +0000 (17:26 -0600)
debian/changelog [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/rules [new file with mode: 0755]
mtxl.c
scsi_linux.c

diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..22afc9f
--- /dev/null
@@ -0,0 +1,110 @@
+mtx (1.2.16rel-3) unstable; urgency=low
+
+  * apply patch from Torsten Werner <twerner@debian.org> that elminates
+    hard-coding of the value of HZ, closes: #224147
+
+ -- Bdale Garbee <bdale@gag.com>  Tue, 16 Dec 2003 10:04:26 -0700
+
+mtx (1.2.16rel-2) unstable; urgency=low
+
+  * apply patch from R.A.Owen <rao3@leicester.ac.uk> that fixes the "staggered"
+    output from the status command on some changers, closes: #129910
+
+ -- Bdale Garbee <bdale@gag.com>  Tue,  9 Apr 2002 19:30:06 -0600
+
+mtx (1.2.16rel-1) unstable; urgency=low
+
+  * new upstream version, bug-fixing release, reportedly fixes timeout 
+    problem with some drives, closes: #113947
+
+ -- Bdale Garbee <bdale@gag.com>  Mon,  4 Mar 2002 01:27:48 -0700
+
+mtx (1.2.15-1) unstable; urgency=low
+
+  * new upstream source
+  * update standards version, rebuild rules file
+  * man pages all included now, mtx-changer and other pieces from contrib
+    provided as examples, though chg-mtx in the amanda package is probably
+    a better choice for use with amanda, closes: #113728
+  * apply diffs to correct "spelling errors" (actually hyphenation) in the
+    descriptions in the control file, closes: #125160
+
+ -- Bdale Garbee <bdale@gag.com>  Sun, 30 Dec 2001 21:28:46 -0700
+
+mtx (1.2.10-1) unstable; urgency=low
+
+  * new upstream source
+
+ -- Bdale Garbee <bdale@gag.com>  Mon, 11 Dec 2000 17:34:13 -0700
+
+mtx (1.0-10) frozen unstable; urgency=low
+
+  * deliver mtx.doc, lost when the package was made FHS compliant, 
+    closes: #56276  Target frozen since including the documentation
+    is worthwhile for potato, and there is no added risk.
+
+ -- Bdale Garbee <bdale@gag.com>  Wed,  9 Feb 2000 12:27:58 -0700
+
+mtx (1.0-9) unstable; urgency=low
+
+  * fix postinst/postrm scripts to be executable again
+
+ -- Bdale Garbee <bdale@gag.com>  Tue, 11 Jan 2000 23:00:17 -0700
+
+mtx (1.0-8) unstable; urgency=low
+
+  * update to latest standards revision, add Build-Depends
+  * fix all the lintian errors that aren't intentional, override the two
+    permissions warnings since they're precisely what is needed
+
+ -- Bdale Garbee <bdale@gag.com>  Fri,  7 Jan 2000 02:47:08 -0700
+
+mtx (1.0-7) unstable; urgency=low
+
+  * grab a local copy of scsi_ioctl.h from the 2.2.10 kernel source tree.  This
+    doesn't change often in any way we care about, and this is much simpler
+    than having to reference a live kernel tree somewhere...
+  * move to debhelper and CVS
+
+ -- Bdale Garbee <bdale@gag.com>  Sun, 20 Jun 1999 10:42:39 -0600
+
+mtx (1.0-6) unstable; urgency=low
+
+  * put mtx in group backup, setuid root, perms set so that only members of
+    group backup can run mtx.  This makes mtx compatible with amanda.
+
+ -- Bdale Garbee <bdale@gag.com>  Tue, 27 Jan 1998 15:06:13 -0700
+
+mtx (1.0-5) unstable; urgency=low
+
+  * explicit include path to find <scsi/scsi_ioctl.h> in the 
+    /usr/src/linux/include tree.  closes bug 16877
+
+ -- Bdale Garbee <bdale@gag.com>  Sun, 25 Jan 1998 23:02:46 -0700
+
+mtx (1.0-4) unstable; urgency=low
+
+  * actually install the mtx.doc file that's referenced in the man page /o\
+
+ -- Bdale Garbee <bdale@gag.com>  Sun, 21 Sep 1997 02:38:50 -0600
+
+mtx (1.0-3) unstable; urgency=low
+
+  * libc6
+
+ -- Bdale Garbee <bdale@gag.com>  Thu,  4 Sep 1997 02:56:39 -0600
+
+mtx (1.0-2) unstable; urgency=low
+
+  * Add an 'mtx-changer' wrapper script from the amanda-users mailing list
+    to make this more useful with Amanda.
+  * Hack mtx-changer to report 6 slots instead of 4, since I have an HP
+    SureStore 12000e.  Should make it configurable, someday.
+
+ -- Bdale Garbee <bdale@gag.com>  Sun, 10 Aug 1997 03:50:42 -0600
+
+mtx (1.0-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Bdale Garbee <bdale@gag.com>  Sun, 10 Aug 1997 03:05:18 -0600
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..410a6e9
--- /dev/null
@@ -0,0 +1,16 @@
+Source: mtx
+Section: admin
+Priority: extra
+Maintainer: Bdale Garbee <bdale@gag.com>
+Build-Depends: debhelper (>> 3.0.0)
+Standards-Version: 3.6.1.0
+
+Package: mtx
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: controls tape autochangers
+ MTX can be used to manipulate tape auto-changers, also known as "jukeboxes",
+ such that backup software can make use of the multiple tape capabilities of
+ the auto-changer.  In particular, this is necessary glue for using a backup
+ system like Amanda with a DDS auto-changer like the HP Surestore 12000e.
+
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..68d5153
--- /dev/null
@@ -0,0 +1,14 @@
+This package was debianized by Bdale Garbee bdale@gag.com on
+Sun, 10 Aug 1997 03:05:18 -0600.
+
+mtx was downloaded from http://mtx.sourceforge.net/
+
+Copyright:
+
+  Copyright 1997, 1998 Leonard Zubkoff <lnz@dandelion.com>
+  Changes copyright 2000 Eric Green <eric@estinc.com>
+
+  GPL, version 2
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..236670a
--- /dev/null
@@ -0,0 +1 @@
+usr/sbin
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..a6b3ef8
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=3
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       ./configure --prefix=/usr
+       touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+       dh_testdir
+       $(MAKE)
+       touch build-stamp
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+       -$(MAKE) distclean
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       make install bindir=`pwd`/debian/mtx/bin prefix=`pwd`/debian/mtx/usr \
+               mandir=`pwd`/debian/mtx/usr/share/man
+
+# Build architecture-independent files here.
+binary-indep: build install
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installdocs
+       dh_installexamples contrib/*
+       dh_installmenu
+       dh_installcron
+       dh_installman
+       dh_installinfo
+       dh_installchangelogs CHANGES
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/mtxl.c b/mtxl.c
index 1ad050d632c3f0d487186a5cf86174d4e171b972..f2350a49da04196c45da2872d8f2dd2f8e930fb5 100644 (file)
--- a/mtxl.c
+++ b/mtxl.c
@@ -438,7 +438,7 @@ static ElementStatus_T *AllocateElementData(ElementModeSense_T *mode_sense) {
 void copy_barcode(unsigned char *src, unsigned char *dest) {
   int i;
   
-  for (i=0; i < 37; i++) {
+  for (i=0; i < 36; i++) {
     *dest++ = *src++;
   }
   *dest=0; /* null-terminate, sigh. */ 
index e5378d3a15242412e0d8107504a994318c8c1f0b..e6371840e2482fa5d974276542bbc0b5a842732d 100644 (file)
@@ -15,11 +15,15 @@ $Revision: 1.2 $
 
 */
 
+#include <linux/param.h>
+#include <scsi/sg.h>
+
 /* this is the SCSI commands for Linux. Note that <eric@estinc.com> changed 
  * it from using SCSI_IOCTL_SEND_COMMAND to using the SCSI generic interface.
  */
 
 #ifndef HZ
+#warning "HZ is not defined, mtx might not work correctly!"
 #define HZ 100
 #endif
 
@@ -52,7 +56,7 @@ $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 HZ*60*5  /* 5 minutes? */
+#define SG_SCSI_DEFAULT_TIMEOUT SG_DEFAULT_TIMEOUT
 
 DEVICE_TYPE SCSI_OpenDevice(char *DeviceName)
 {