From bf800994d6598a56ee0690be95967dcee3b861d1 Mon Sep 17 00:00:00 2001 From: Bernd Eckenfels Date: Tue, 20 Nov 2001 19:03:24 +0100 Subject: [PATCH] Imported Debian patch 1.01b-12 --- debian/changelog | 36 ++++++++++++++++++++++++++++++++++++ debian/control | 3 ++- debian/copyright | 4 ++++ debian/postinst | 9 +++++++++ debian/prerm | 7 +++++++ debian/rules | 46 ++++++++++++++++++++++++++++++---------------- mmv.1 | 11 +++++++---- mmv.c | 27 ++++++++++++++++----------- 8 files changed, 111 insertions(+), 32 deletions(-) create mode 100644 debian/postinst create mode 100644 debian/prerm diff --git a/debian/changelog b/debian/changelog index 871ff32..04f1fcd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,39 @@ +mmv (1.01b-12) unstable; urgency=low + + * LFS support! (not sure if this breaks something :) (Closes: Bug #106822) + * support -- as option terminator (Closes: Bug #52417) + + -- Bernd Eckenfels Tue, 20 Nov 2001 19:03:24 +0100 + +mmv (1.01b-11) unstable; urgency=medium + + * added Build-Depends (Closes: Bug #105025) + * bumped Standards Version from 3.0.1 to 3.6.5 + * make strig/-g depending on environemnt variable + * added a comment about quoting 'to' patter (Closes: Bug #106076) + + -- Bernd Eckenfels Sat, 10 Nov 2001 18:28:56 +0100 + +mmv (1.01b-10.1) unstable; urgency=LOW + + * reupload cause it was rejected + + -- Bernd Eckenfels Thu, 3 Aug 2000 02:38:20 +0200 + +mmv (1.01b-10) unstable; urgency=LOW + + * debian/rules clean will now kill *~ files + + -- Bernd Eckenfels Sun, 23 Jul 2000 04:28:46 +0200 + +mmv (1.01b-9) unstable; urgency=LOW + + * closes: #67605 (no special handling for char > 127 anymore) + * clsoes: #60128 (i think it was fixed by hartmut already) + * man page and doc now in /usr/share, new standards version + + -- Bernd Eckenfels Sun, 23 Jul 2000 04:08:19 +0200 + mmv (1.01b-8.1) unstable; urgency=LOW * NMU diff --git a/debian/control b/debian/control index 944e4f4..7260474 100644 --- a/debian/control +++ b/debian/control @@ -1,8 +1,9 @@ Source: mmv Maintainer: Bernd Eckenfels Section: utils +Build-Depends: debhelper Priority: optional -Standards-Version: 2.4.0.1 +Standards-Version: 3.5.6 Package: mmv Architecture: any diff --git a/debian/copyright b/debian/copyright index 148273f..1bee46c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,6 +3,10 @@ This is the Debian GNU/Linux prepackaged version of mmv. This package was put together by Michael Meskes , from sources obtained from USENET. +It is now maintained by Bernd Eckenfels with some +enhancements (NLS Char Support, glibc compiles) from Bernd and kind +contributions from Hartmut Koptein . + Copyright (c) 1989 Vladimir Lanin Mmv is freeware. That means that the entire package of software and diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..cb38ac8 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/mmv -a -d /usr/share/doc/mmv ]; then + ln -sf ../share/doc/mmv /usr/doc/mmv + fi +fi diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..206acd8 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/mmv ]; then + rm -f /usr/doc/mmv +fi diff --git a/debian/rules b/debian/rules index 6f5373c..de490b2 100755 --- a/debian/rules +++ b/debian/rules @@ -1,8 +1,20 @@ #! /usr/bin/make -f +INSTALL_PROGRAM=install CC = gcc -LDFLAGS = -s -CFLAGS = -O2 -g -Wall +LDFLAGS = +CFLAGS = -O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 + + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +CFLAGS += -g +endif + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +INSTALL_PROGRAM += -s +LDFLAGS += -s +endif + # The package p = mmv @@ -23,7 +35,7 @@ clean: # Undoes the effect of `make -f debian/rules build'. $(checkdir) -make clean - -rm -f debian/files* debian/substvars* debian/*~ + -rm -f debian/files* debian/substvars* debian/*~ core */core *~ -rm -rf debian/tmp build binary: binary-arch binary-indep @@ -41,30 +53,32 @@ binary-arch: build chmod g-s debian/tmp install -d -g root -m 755 -o root debian/tmp/DEBIAN install -d -g root -m 755 -o root debian/tmp/usr/bin - install -d -g root -m 755 -o root debian/tmp/usr/man/man1 - install -g root -o root -m 755 -s mmv debian/tmp/usr/bin - install -g root -o root -m 644 mmv.1 debian/tmp/usr/man/man1 - gzip -9f debian/tmp/usr/man/man1/mmv.1 + install -d -g root -m 755 -o root debian/tmp/usr/share/man/man1 + $(INSTALL_PROGRAM) -g root -o root -m 755 mmv debian/tmp/usr/bin + install -g root -o root -m 644 mmv.1 debian/tmp/usr/share/man/man1 + gzip -9f debian/tmp/usr/share/man/man1/mmv.1 (cd debian/tmp/usr/bin;\ ln -s mmv mcp; \ ln -s mmv mad; \ ln -s mmv mln;) - (cd debian/tmp/usr/man/man1;\ + (cd debian/tmp/usr/share/man/man1;\ ln -s mmv.1.gz mcp.1.gz; \ ln -s mmv.1.gz mad.1.gz; \ ln -s mmv.1.gz mln.1.gz;) - install -d -g root -m 755 -o root debian/tmp/usr/doc/$(p) + install -d -g root -m 755 -o root debian/tmp/usr/share/doc/$(p) install -g root -m 644 -o root READ.ME \ - debian/tmp/usr/doc/$(p) + debian/tmp/usr/share/doc/$(p) install -g root -m 644 -o root debian/changelog \ - debian/tmp/usr/doc/$(p)/changelog.Debian - gzip -f9 debian/tmp/usr/doc/$(p)/* + debian/tmp/usr/share/doc/$(p)/changelog.Debian + gzip -f9 debian/tmp/usr/share/doc/$(p)/* install -g root -m 644 -o root debian/copyright \ - debian/tmp/usr/doc/$(p) - chmod -R g-sw debian/tmp/usr/doc/$(p) - chown -R root.root debian/tmp/usr/doc/$(p) + debian/tmp/usr/share/doc/$(p) + install -g root -m 755 -o root debian/postinst debian/prerm \ + debian/tmp/DEBIAN + chmod -R g-sw debian/tmp/usr/share/doc/$(p) + chown -R root.root debian/tmp/usr/share/doc/$(p) dpkg-shlibdeps debian/tmp/usr/bin/mmv - dpkg-gencontrol + dpkg-gencontrol -isp dh_md5sums dpkg --build debian/tmp && dpkg-name -o -s .. debian/tmp.deb diff --git a/mmv.1 b/mmv.1 index e23c5ae..4c707a3 100644 --- a/mmv.1 +++ b/mmv.1 @@ -2,7 +2,7 @@ .\" To print the MS-DOS version, use option -rO2. .\" Under System V, take out the '.\" ' from the next line. .\" .nr O 1 -.TH MMV 1 "November 20, 1989 (v1.0)" +.TH MMV 1 "November 20, 2001 (v1.0lfs)" .ie !'\nO'2' \{\ .SH NAME mmv \- move/copy/append/link multiple files by wildcard patterns @@ -28,6 +28,7 @@ mmv \- move/copy/append multiple files by wildcard patterns [\fB-d\fP|\fBp\fP] [\fB-g\fP|\fBt\fP] [\fB-v\fP|\fBn\fP] +[\fB--\fP] [\fBfrom to\fP] .if '\nO'2' \{\ .br @@ -56,7 +57,8 @@ from the entire set of actions specified and gives the user the choice of either proceeding by avoiding the offending parts or aborting. - +.I mmv does support large files (LFS) but it does *NOT* support +sparse files (i.e. it explodes them). .ce The Task Options .PP @@ -332,8 +334,9 @@ before passing the command-line arguments to .IR mmv , it is usually necessary to enclose the command-line .I from -pattern -in quotes. +and +.I to +patterns in quotes. \} .ce diff --git a/mmv.c b/mmv.c index 8dc9ccb..1215984 100644 --- a/mmv.c +++ b/mmv.c @@ -62,7 +62,8 @@ static char USAGE[] = %s [-m|x%s|c|o|a|z] [-h] [-d|p] [-g|t] [-v|n] [from to]\n\ \n\ Use #N in the ``to'' pattern to get the string matched\n\ -by the N'th ``from'' pattern wildcard.\n"; +by the N'th ``from'' pattern wildcard.\n\ +Use -- as the end of options.\n"; #define OTHEROPT (_osmajor < 3 ? "" : "|r") @@ -75,7 +76,9 @@ Use #[l|u]N in the ``to'' pattern to get the [lowercase|uppercase of the]\n\ string matched by the N'th ``from'' pattern wildcard.\n\ \n\ A ``from'' pattern containing wildcards should be quoted when given\n\ -on the command line.\n"; +on the command line. Also you may need to quote ``to'' pattern.\n\ +\n\ +Use -- as the end of options.\n"; #ifdef IS_SYSV #define OTHEROPT "" @@ -577,6 +580,11 @@ static void procargs(argc, argv, pfrompat, ptopat) for (argc--, argv++; argc > 0 && **argv == '-'; argc--, argv++) for (p = *argv + 1; *p != '\0'; p++) { c = mylower(*p); + if (c == '-') { + argc--; + argv++; + goto endargs; + } if (c == 'v' && !noex) verbose = 1; else if (c == 'n' && !verbose) @@ -620,6 +628,7 @@ static void procargs(argc, argv, pfrompat, ptopat) } } +endargs: if (op == DFLT) if (strcmp(cmdname, MOVENAME) == 0) op = XMOVE; @@ -1001,20 +1010,16 @@ static int parsepat() printf(TRAILESC, from, to, ESC); return(-1); } +#ifdef IS_MSDOS default: if ( -#ifdef IS_MSDOS c <= ' ' || c >= 127 || strchr(":/\\*?[]=+;,\"|<>", c) != NULL -#else - c & 0x80 -#endif ) { printf("%s -> %s : illegal character '%c' (0x%02X).\n", from, to, c, c); return(-1); } -#ifdef IS_MSDOS if (isupper(c)) *p = c + ('a' - 'A'); #endif @@ -2626,7 +2631,7 @@ static int copymove(p) static int copy(ff, len) FILEINFO *ff; - long len; + off_t len; { char buf[BUFSIZE], c; int f, t, k, mode, perm; @@ -2674,7 +2679,7 @@ static int copy(ff, len) return(-1); } if (op & APPEND) - lseek(t, 0L, 2); + lseek(t, (off_t)0, SEEK_END); #ifdef IS_MSDOS if (op & ZAPPEND && filelength(t) != 0) { if (lseek(t, -1L, 1) == -1L || read(t, &c, 1) != 1) { @@ -2686,10 +2691,10 @@ static int copy(ff, len) lseek(t, -1L, 1); } #endif - if ((op & APPEND) && len != -1L) { + if ((op & APPEND) && len != (off_t)-1) { while ( len != 0 && - (k = read(f, buf, len > BUFSIZE ? BUFSIZE : (unsigned)len)) > 0 && + (k = read(f, buf, (len > BUFSIZE) ? BUFSIZE : (size_t)len)) > 0 && write(t, buf, k) == k ) len -= k; -- 2.39.2