From: Bdale Garbee Date: Wed, 16 Apr 2008 06:26:26 +0000 (-0600) Subject: Imported Debian patch 2.5.2-4 X-Git-Tag: debian/2.5.2-4^0 X-Git-Url: https://git.gag.com/?p=debian%2Fdds2tar;a=commitdiff_plain;h=00437ec8f1a757dff18ad2a76562c058c8394c6c Imported Debian patch 2.5.2-4 --- diff --git a/Makefile b/Makefile index 6b75897..8b5f5f3 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ HPDAT=-DHPDAT # Default tape device is: /dev/nst0 # edit or uncomment the following line to change the default device -DEVICE=/dev/rmt0 +DEVICE=/dev/nst0 # Enable trace mode -- for debugging only # TRACE=-DDDS_TRACE=1 @@ -31,22 +31,22 @@ DEVICE=/dev/rmt0 # # To configure the buffer size of dds2tar # change or uncomment the following line : -# BUFFER=-DST_BUFFER_BLOCKS=32 -BUFFER=-DST_BUFFER_BLOCKS=0 +BUFFER=-DST_BUFFER_BLOCKS=32 +# BUFFER=-DST_BUFFER_BLOCKS=0 # To include some experimental stuff # uncomment the following line : # EXP_STUFF=-DEXP_STUFF # change this to where you want to install: -BINDIR=/usr/bin -MANDIR=/usr/man +BINDIR=$(DESTDIR)/usr/bin +MANDIR=$(DESTDIR)/usr/share/man MANEXT=1 # place here your favorite C compiler and options CC=cc -g CCOPT=$(HPDAT) $(HPDAT4) $(EXP_STUFF) $(MATCH) $(BUFFER) \ - -DDEVICE=\"$(DEVICE)\" -O4 -Wall $(TRACE) + -DDEVICE=\"$(DEVICE)\" -O4 -Wall $(TRACE) -D_GNU_SOURCE # -Wall \ # -Wstrict-prototypes \ @@ -139,7 +139,7 @@ dds-dd: dds-dd.o $(OBJ) install: dds2tar ddstool \ dds2tar.$(MANEXT) mt-dds.$(MANEXT) dds2index.$(MANEXT) dds-dd.$(MANEXT) - install -c -s dds2tar $(BINDIR) + install -c dds2tar $(BINDIR) install scsi_vendor $(BINDIR) install -c ddstool $(BINDIR) ls -l $(BINDIR)/dds2tar $(BINDIR)/ddstool @@ -191,7 +191,7 @@ clean: -rm -f dds2tar dds2index mt-dds dds-dd fio_test -rm -f *~ *.$(MANEXT) *.ps -rm -f tags *.bak - chmod 644 * +# chmod 644 * doc: a2ps -p -nP [A-Z]* *.h *.c *.lsm > a.ps diff --git a/dds-dd.man b/dds-dd.man index d8ad7d5..8e65453 100644 --- a/dds-dd.man +++ b/dds-dd.man @@ -1,4 +1,4 @@ -.TH dds-dd 1L 2.4 \" -*- nroff -*- +.TH dds-dd 1 2.4 \" -*- nroff -*- .\"---------- .SH NAME .\"---------- diff --git a/dds2index.man b/dds2index.man index e836388..5cce904 100644 --- a/dds2index.man +++ b/dds2index.man @@ -1,4 +1,4 @@ -.TH dds2index 1L 2.4 \" -*- nroff -*- +.TH dds2index 1 2.4 \" -*- nroff -*- .\"---------- .SH NAME .\"---------- diff --git a/dds2tar.man b/dds2tar.man index af262f8..0f1791e 100644 --- a/dds2tar.man +++ b/dds2tar.man @@ -1,4 +1,4 @@ -.TH dds2tar 1L 2.3 \" -*- nroff -*- +.TH dds2tar 1 2.3 \" -*- nroff -*- .SH NAME dds2tar \- tool for fast tape access .SH SYNOPSIS @@ -58,6 +58,7 @@ A patch for .B GNU tar-1.12 is available, adding the option .B --record-file. +This patch is not included in the version of tar that ships with Debian. Alternatively there are some tricks to get the missing information. .PP diff --git a/dds_extract.c b/dds_extract.c index 45e7daf..1c1face 100644 --- a/dds_extract.c +++ b/dds_extract.c @@ -410,21 +410,37 @@ dds_cmp(char const *const *const pattern_list) */ dds_unquote(cur_line); - /* - * Set scanoffset - */ - so = (0 == strncmp(cur_line, "block", 5))? 2 : 0 ; - - recno = atoi(cur_line + 4 + so ); - /* - * tar-1.13 writes now the block number: - */ - if ( so == 0 ){ - int x ; - int n ; + if (0 == strncmp(cur_line, "block ", 6)) + { + int x; + int n; char c; + + so = 6; + if (2 == sscanf(cur_line + so, "%d%c%n", + &x, &c, &n)) { + so += n + 1; + recno = x; +#ifdef DDS_TRACE + fprintf(stderr,"Blocks found:%d\n",x); +#endif + } + else + { + recno = 0; + } + } + else + { + int x; + int n; + char c; + + recno = atoi(cur_line + 4); + + so = 16; if ( 2 == sscanf( - cur_line+16,"block %d%c%n",&x,&c,&n + cur_line+so,"block %d%c%n",&x,&c,&n ) && c == ':' ) { so += n + 1 ; recno = x ; @@ -433,6 +449,7 @@ dds_cmp(char const *const *const pattern_list) #endif } } + /* * Now we are fixing a bug of gnu tar ... * The first number should be zero, othewise we @@ -459,47 +476,40 @@ dds_cmp(char const *const *const pattern_list) #ifdef DDS_TRACE fprintf(stderr,"file-loc(%d:%d,%d)\n",tar_bs,blkno,recno); #endif - if (name == NULL) { /* calculate only once */ - if ( strlen(cur_line) >= (66) ) { - name = cur_line + (65); - while ( ( name[ 0] != '\0' ) - && (( ( name[-1] != ' ' ) - || ( name[-6] != ' ' ) - || ( name[-9] != ':' ) - )&&( ( name[-1] != ' ' ) - || ( name[-4] != ':' ) - || ( name[-7] != ' ' ) - || ( name[-10] != '-' ) - || ( name[-13] != '-' ) - )) - ) name++ ; - if ( name[0] == '\0' ) { - name = cur_line + (16+so); - } - } else { - if ( strlen(cur_line) <= (16+so) ) { - strcat(cur_line, - " "); - } - name = cur_line + (16+so); + + /* skip file permissions */ + name = strchr(cur_line + so, ' '); + if (name) { + /* skip owner/group */ + name = strchr(name + 1, ' '); + if (name) { + /* skip size */ + while (*++name == ' '); + name = strchr(name, ' '); + if (name) { + /* skip date */ + name = strchr(name + 1, ' '); + if (name) { + /* skip time */ + name = strchr(name + 1, ' '); + + if (name) { + ++name; } + } + } + } + } + + if (!name || (name[-4] != ':')) + { + name = cur_line + so; + } + #ifdef DDS_TRACE - fprintf(stderr,"%d\n",__LINE__); - fprintf(stderr,"filename=%s\n",name); + fprintf(stderr,"%d\n",__LINE__); + fprintf(stderr,"filename=%s\n",name); #endif - } - while ( ( name[ 0] != '\0' ) - && ( name != ( cur_line + (16+so) ) ) - && (( ( name[-1] != ' ' ) - || ( name[-6] != ' ' ) - || ( name[-9] != ':' ) - )&&( ( name[-1] != ' ' ) - || ( name[-4] != ':' ) - || ( name[-7] != ' ' ) - || ( name[-10] != '-' ) - || ( name[-13] != '-' ) - )) - ) name++ ; } #ifdef DDS_TRACE fprintf(stderr,"%d\n",__LINE__); diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..41a634e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,108 @@ +dds2tar (2.5.2-4) unstable; urgency=low + + * don't let Makefile strip binaries, closes: #436710 + * update man pages to make it clear that Debian does not include the + --record-file option in our package of tar, so some of the functionality + of the dds2tar package will only work with a locally modified version + of the tar executable, closes: #220228, #285796 + * accept patch for scsi_vendor csh->bash translation bugs, closes: #292066 + + -- Bdale Garbee Wed, 16 Apr 2008 00:26:26 -0600 + +dds2tar (2.5.2-3) unstable; urgency=low + + * correct Kieren's email address here and in scsi_vendor script + + -- Bdale Garbee Wed, 2 Jul 2003 09:04:43 -0600 + +dds2tar (2.5.2-2) unstable; urgency=low + + * update control file to direct this to optional, not extra + * accept bash port of scsi_vendor script from Kieren Hynd + to eliminate dependency on tcsh for this script to be useful. + + -- Bdale Garbee Tue, 1 Jul 2003 20:27:40 -0600 + +dds2tar (2.5.2-1) unstable; urgency=low + + * new upstream version + * apply fix for parsing of indexes from current Debian tar provided by + Christof Meerwald , closes: #119692 + + -- Bdale Garbee Mon, 11 Mar 2002 19:17:56 -0700 + +dds2tar (2.4.21-3) unstable; urgency=low + + * update to current policy + + -- Bdale Garbee Wed, 1 Dec 1999 23:27:00 -0700 + +dds2tar (2.4.21-2) frozen unstable; urgency=low + + * update dependencies, since scsi_vendor apparently needs tcsh, not just + c-shell... closes 30895 + + -- Bdale Garbee Mon, 18 Jan 1999 22:38:05 -0700 + +dds2tar (2.4.21-1) unstable; urgency=low + + * new upstream version, closes 27551 + + -- Bdale Garbee Wed, 7 Oct 1998 23:13:37 -0600 + +dds2tar (2.4.15-3) frozen unstable; urgency=high + + * another attempt to get this into hamm, rebuilding to get a good changes + file + + -- Bdale Garbee Tue, 23 Jun 1998 16:04:30 -0600 + +dds2tar (2.4.15-2) frozen unstable; urgency=low + + * reinstate package after having requested it be removed from the archive, + since the utilities here are still needed by DDS tape users to take + advantage of the patch which is now part of the base tar package... /o\ + * update rules file to reflect debhelper changes and get a clean lintian + report + + -- Bdale Garbee Sat, 25 Apr 1998 22:28:41 -0600 + +dds2tar (2.4.15-1) unstable; urgency=low + + * new upstream version + * dds2tar now depends on tar being patched instead of providing a new tar + + -- Bdale Garbee Wed, 4 Feb 1998 04:20:37 -0700 + +dds2tar (2.4.13-4) unstable; urgency=low + + * make copyright reference the GPL instead of including it. Closes 14909. + + -- Bdale Garbee Fri, 21 Nov 1997 21:36:48 -0700 + +dds2tar (2.4.13-3) unstable; urgency=low + + * New maintainer. + * libc6 + + -- Bdale Garbee Mon, 27 Oct 1997 08:08:41 -0700 + +dds2tar (2.4.13-2) frozen unstable; urgency=low + + * Rebuilt to change name of upstream changelog (#9641). + * Fixed source package to compile with bash 2.0 + * Changed section to utils. + * Fixed typo in description. + * Upgrade to package standard 2.1.3.2. + + -- Christian Schwarz Sun, 11 May 1997 13:57:07 +0200 + +dds2tar (2.4.13-1) unstable; urgency=low + + * Initial Release. + + -- Christian Schwarz Thu, 9 Jan 1997 13:40:02 +0100 + +Local variables: +mode: debian-changelog +End: diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..1a6f229 --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: dds2tar +Section: utils +Priority: optional +Maintainer: Bdale Garbee +Build-Depends: debhelper (>= 5) +Standards-Version: 3.7.3 + +Package: dds2tar +Architecture: any +Depends: ${shlibs:Depends} +Description: Tools for using DDS features of DAT drives with GNU tar + This tool makes use of the fast seek command of DAT devices. + Files from a selected file archive can be extracted within one minute. + . + A script scsi_vendor is provided which may help in learning more about + an unknown SCSI device. It is used by the mt-dds tool. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..b1bf765 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,8 @@ +Package built from sources acquired at + http://ibiblio.org/pub/Linux/system/backup/dds2tar-2.5.2.tar.gz + +Copyright 2000 by J"org Weule + +This package is licensed under the GNU GENERAL PUBLIC LICENSE. A copy of the +GPL is provided on Debian systems in the /usr/share/common-licenses directory. + diff --git a/debian/ddstool.1 b/debian/ddstool.1 new file mode 100644 index 0000000..0b2c7d9 --- /dev/null +++ b/debian/ddstool.1 @@ -0,0 +1,50 @@ +.TH DDSTOOL 1 "9 Januar 1997" +.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection +.\" other parms are allowed: see man(7), man(1) +.SH NAME +ddstool \- simple shell script to manage dds tapes +.SH SYNOPSIS +.B ddstool +.I " " +.SH "DESCRIPTION" +This manual page documents briefly the +.BR ddstool +command. +This manual page was written for the Debian GNU/Linux distribution +(but may be used by others), because the original program does not +have a manual page. +.PP +Since the version of tar now shipping in Debian does not contain the +patch necessary to support the \-\-record-file option, this program +will do nothing useful unless you're running a locally patched version +of tar. +.PP +First label a tape: +.RS +.sp +ddstool create-label 'unique-string and more' +.sp +.RE +To archive something: +.RS +.sp +ddstool append pathnames... +.sp +.RE +To delete the old index-files and make a new label: +.RS +.sp +ddstool new-label 'unique-string and more strings' +.sp +.RE +Each index is stored by the pathnames: +.RS +.sp +$A/$unique-string.$file-number (soft link) + +$A/$timestamp-of-the-tapelabel.$file-number (file) +.sp +.RE +.SH AUTHOR +This manual page was written by Christian Schwarz +for the Debian GNU/Linux system. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..98d1583 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/man/man1 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..7924dbc --- /dev/null +++ b/debian/rules @@ -0,0 +1,48 @@ +#!/usr/bin/make -f + +export DH_VERBOSE=1 + +build: build-stamp +build-stamp: + dh_testdir + make CFLAGS="-O2 -g -Wall" + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + [ ! -f Makefile ] || make clean + dh_clean + +binary-indep: build + +binary-arch: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + make install DESTDIR=`pwd`/debian/dds2tar + install debian/scsi_vendor.bash debian/dds2tar/usr/bin/scsi_vendor + dh_installdocs + dh_installexamples + dh_installmenu + dh_installcron + dh_installmanpages + dh_undocumented + dh_installchangelogs + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_makeshlibs + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary diff --git a/debian/scsi_vendor.1 b/debian/scsi_vendor.1 new file mode 100644 index 0000000..12571fa --- /dev/null +++ b/debian/scsi_vendor.1 @@ -0,0 +1,21 @@ +.TH SCSI_VENDOR 1 +.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection +.\" other parms are allowed: see man(7), man(1) +.SH NAME +scsi_vendor \- script displays SCSI vendors +.SH SYNOPSIS +.B scsi_vendor +.I "[disk|tape|cd] [] " +.SH "DESCRIPTION" +This manual page documents briefly the +.BR scsi_vendor +command. +This manual page was written for the Debian GNU/Linux distribution +(but may be used by others), because the original program does not +have a manual page. +.PP +When run, the script will report the vendors of all or the specified types of +SCSI devices on the system. +.SH AUTHOR +This manual page was written by Bdale Garbee +for the Debian GNU/Linux system. diff --git a/debian/scsi_vendor.bash b/debian/scsi_vendor.bash new file mode 100644 index 0000000..4a840b7 --- /dev/null +++ b/debian/scsi_vendor.bash @@ -0,0 +1,88 @@ +#!/bin/bash +# +# Determine the Vendor of a device +# +# csh-Example: +# +# <1>scsi_vendor +# Disks: SEAGATE SAMSUNG +# Cdroms: TOSHIBA PHILIPS +# Tapes: HP +# <2>scsi_vendor disk +# SEAGATE SAMSUNG +# <383>scsi_vendor cd +# TOSHIBA PHILIPS +# <3>scsi_vendor tape +# HP +# <4>scsi_vendor tape 1 +# HP +# <5>scsi_vendor disk 1 +# <6>scsi_vendor disk 1 +# SEAGATE +# <7>scsi_vendor disk 2 +# SAMSUNG +# +# Ported to bash 01.07.03 + +s=( ) +c=( ) +d=( ) +o='' +v='' + +SCSIINFO=`grep '^ ' /proc/scsi/scsi | cut -c3-18` + +for i in $SCSIINFO +do + if [ "$o" = "Vendor:" ]; then + v=$i + fi + if [[ "$o" == 'Type:' && "$i" == 'Sequenti' ]]; then + s=( $s $v ) + fi + if [[ "$o" == 'Type:' && "$i" == 'CD-ROM' ]]; then + c=( $c $v ) + fi + if [[ "$o" == 'Type:' && "$i" == 'Direct-A' ]]; then + d=( $d $v ) + fi + o=$i +done +if [ $# == 0 ]; then + echo Disks: $d + echo Cdroms: $c + echo Tapes: $s + exit 0 +fi +if [ $# == 1 ]; then + v='' ; + if [ "$1" == "disk" ]; then + echo $d + fi + if [ "$1" == "cd" ]; then + echo $c + fi + if [ "$1" == "tape" ]; then + echo $s + fi + exit 0 +fi +if [ $# -eq 2 ]; then + v='' + if [[ "$1" == "disk" && ${#d[@]} -ge $2 ]]; then + v=$d[$2] + fi + if [[ "$1" == "cd" && ${#c[@]} -ge $2 ]]; then + v=$c[$2] + fi + if [[ "$1" == "tape" && ${#s[@]} -ge $2 ]]; then + v=${s[$2]} + fi + echo $v + exit 0 +fi +if [ "$v" == "$3" ]; then + exit 2 +fi +exit 1 + diff --git a/mt-dds.man b/mt-dds.man index c4fef84..8cad023 100644 --- a/mt-dds.man +++ b/mt-dds.man @@ -1,4 +1,4 @@ -.TH mt-dds 1L 2.4 \" -*- nroff -*- +.TH mt-dds 1 2.4 \" -*- nroff -*- .\"---------- .SH NAME .\"----------