Skip site navigation (1)Skip section navigation (2)
Date:      Mon,  4 Sep 2006 22:57:01 +0200
From:      "Simon Olofsson" <simon@olofsson.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/102869: [PATCH] misc/mmv: update to 1.01b.14, take maintainership
Message-ID:  <20060904205701.CCD951E6CD9@mail-in-01.arcor-online.net>
Resent-Message-ID: <200609042100.k84L0Zxt054857@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         102869
>Category:       ports
>Synopsis:       [PATCH] misc/mmv: update to 1.01b.14, take maintainership
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 04 21:00:34 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Simon Olofsson
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
>Environment:
System: FreeBSD gul.lan.gath3n.de 6.1-STABLE FreeBSD 6.1-STABLE #29: Sat Aug 19 22:24:49 CEST 2006
>Description:
- Update to 1.01b.14
- Take maintainership

Added file(s):
- files/patch-mmv.1
- files/patch-mmv.c

Removed file(s):
- files/patch-aa
- pkg-plist

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- mmv-1.01b.14.patch begins here ---
diff -ruN -ruN --exclude=CVS /usr/ports/misc/mmv/Makefile /usr/home/simon/src/ports/misc/mmv/Makefile
--- /usr/ports/misc/mmv/Makefile	Mon Sep  4 02:03:18 2006
+++ /usr/home/simon/src/ports/misc/mmv/Makefile	Mon Sep  4 22:48:07 2006
@@ -6,35 +6,25 @@
 #
 
 PORTNAME=	mmv
-PORTVERSION=	1.01b
+PORTVERSION=	1.01b.14
 CATEGORIES=	misc
-MASTER_SITES=	ftp://ftp.unicamp.br/pub/unix-c/file-mgmt/
-DISTNAME=	mmv
-EXTRACT_SUFX=	.tar.Z
+MASTER_SITES=	${MASTER_SITE_DEBIAN_POOL}
+DISTNAME=	${PORTNAME}_1.01b.orig
 
-MAINTAINER=	ports@FreeBSD.org
-COMMENT=	Move/copy/append/link multiple files with sophisticated wildcard matching
+MAINTAINER=	simon@olofsson.de
+COMMENT=	Move/Copy/Append/Link multiple files
 
-BROKEN=		Unfetchable
-DEPRECATED=	${BROKEN}
-EXPIRATION_DATE=2006-12-01
-
-RESTRICTED=	No modification or redistribution for charge
-CFLAGS+=	-DDIRENT
-MAKE_FLAGS=	-e
+CFLAGS+=	-DHAS_DIRENT
 MAN1=		mmv.1
+PLIST_FILES=	bin/mmv
+WRKSRC=		${WRKDIR}/${PORTNAME}-1.01b.orig
 
-post-extract:
-	(cd ${WRKSRC} ; \
-	 ${CAT} mmv.c.? >mmv.c ; \
-	 ${PATCH} mmv.c < mmv.patch1 ; )
+do-build:
+	@(cd ${WRKSRC} ; \
+	${CC} ${CFLAGS} -o ${PORTNAME} ${PORTNAME}.c ; )
 
 do-install:
-	(cd ${PREFIX}/bin ; ${RM} -f mmv mad mcp mln ; \
-	 ${INSTALL_PROGRAM} ${WRKSRC}/mmv ${PREFIX}/bin ; \
-	 ${LN} -fs ${PREFIX}/bin/mmv ${PREFIX}/bin/mad ; \
-	 ${LN} -fs ${PREFIX}/bin/mmv ${PREFIX}/bin/mcp ; \
-	 ${LN} -fs ${PREFIX}/bin/mmv ${PREFIX}/bin/mln ; \
-	 ${INSTALL_MAN} ${WRKSRC}/mmv.1 ${PREFIX}/man/man1 ; )
+	@${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/${PORTNAME}
+	@${INSTALL_MAN} ${WRKSRC}/mmv.1 ${PREFIX}/man/man1/mmv.1
 
 .include <bsd.port.mk>
diff -ruN -ruN --exclude=CVS /usr/ports/misc/mmv/distinfo /usr/home/simon/src/ports/misc/mmv/distinfo
--- /usr/ports/misc/mmv/distinfo	Sat Nov 26 01:42:01 2005
+++ /usr/home/simon/src/ports/misc/mmv/distinfo	Mon Sep  4 21:04:30 2006
@@ -1,3 +1,3 @@
-MD5 (mmv.tar.Z) = bc6dd229efc513140ec4d1caa364cab1
-SHA256 (mmv.tar.Z) = c933f27d4826435d20468abc1aa0d2c8bd6860863daaf61f020643d75934cffd
-SIZE (mmv.tar.Z) = 44773
+MD5 (mmv_1.01b.orig.tar.gz) = 1b2135ab2f17bdfa9e08debbb3c46ad8
+SHA256 (mmv_1.01b.orig.tar.gz) = 0399c027ea1e51fd607266c1e33573866d4db89f64a74be8b4a1d2d1ff1fdeef
+SIZE (mmv_1.01b.orig.tar.gz) = 25656
diff -ruN -ruN --exclude=CVS /usr/ports/misc/mmv/files/patch-aa /usr/home/simon/src/ports/misc/mmv/files/patch-aa
--- /usr/ports/misc/mmv/files/patch-aa	Fri Jun 14 20:14:16 2002
+++ /usr/home/simon/src/ports/misc/mmv/files/patch-aa	Thu Jan  1 01:00:00 1970
@@ -1,125 +0,0 @@
-*** mmv.c.old	Wed Mar  1 05:23:56 1995
---- mmv.c	Thu Jun 13 13:34:25 2002
-***************
-*** 88,94 ****
-  #endif
-  
-  #include <stdio.h>
-- #include <ctype.h>
-  
-  #ifdef MSDOS
-  /* for MS-DOS (under Turbo C 1.5)*/
---- 88,93 ----
-***************
-*** 126,132 ****
-  #include <sys/file.h>
-  
-  extern char *getenv();
-- extern long lseek();
-  extern char *malloc();
-  
-  #ifdef DIRENT
---- 125,130 ----
-***************
-*** 176,182 ****
-  
-  #else
-  /* for System V and BSD */
-- #include <string.h>
-  #include <sys/signal.h>
-  #include <fcntl.h>
-  #endif
---- 174,179 ----
-***************
-*** 370,376 ****
-  static int snap(/* REP *first, REP *p */);
-  static void showdone(/* REP *fin */);
-  static void breakout(/*  */);
-! static int breakrep(/* */);
-  static void breakstat(/* */);
-  static void quit(/*  */);
-  static int copymove(/* REP *p */);
---- 367,373 ----
-  static int snap(/* REP *first, REP *p */);
-  static void showdone(/* REP *fin */);
-  static void breakout(/*  */);
-! static void breakrep(/* */);
-  static void breakstat(/* */);
-  static void quit(/*  */);
-  static int copymove(/* REP *p */);
-***************
-*** 389,395 ****
-  static int getstat(/* char *full, FILEINFO *f */);
-  static int dwritable(/* HANDLE *h */);
-  static int fwritable(/* char *hname, FILEINFO *f */);
-- static void memmove(/* void *to, void *from, int k */);
-  #endif
-  #ifndef RENAME
-  static int rename(/* char *from, char *to */);
---- 386,391 ----
-***************
-*** 410,416 ****
-  static SLICER slicer[2] = {{NULL, NULL, 0}, {NULL, NULL, 0}};
-  
-  static int badreps = 0, paterr = 0, direrr, failed = 0, gotsig = 0, repbad;
-! static FILE *outfile = stdout;
-  
-  static char IDF[] = "$$mmvdid.";
-  static char TEMP[] = "$$mmvtmp.";
---- 406,412 ----
-  static SLICER slicer[2] = {{NULL, NULL, 0}, {NULL, NULL, 0}};
-  
-  static int badreps = 0, paterr = 0, direrr, failed = 0, gotsig = 0, repbad;
-! static FILE *outfile;
-  
-  static char IDF[] = "$$mmvdid.";
-  static char TEMP[] = "$$mmvtmp.";
-***************
-*** 471,476 ****
---- 467,473 ----
-  {
-  	char *frompat, *topat;
-  
-+ 	outfile = stdout;
-  	init();
-  	procargs(argc, argv, &frompat, &topat);
-  	domatch(frompat, topat);
-***************
-*** 2550,2559 ****
-  }
-  
-  
-! static int breakrep()
-  {
-  	gotsig = 1;
-- 	return(1);
-  }
-  
-  
---- 2547,2555 ----
-  }
-  
-  
-! static void breakrep()
-  {
-  	gotsig = 1;
-  }
-  
-  
-***************
-*** 2832,2838 ****
-  }
-  
-  
-! #ifndef MSDOS
-  static void memmove(to, from, k)
-  	char *to, *from;
-  	unsigned k;
---- 2828,2834 ----
-  }
-  
-  
-! #if 0
-  static void memmove(to, from, k)
-  	char *to, *from;
-  	unsigned k;
diff -ruN -ruN --exclude=CVS /usr/ports/misc/mmv/files/patch-mmv.1 /usr/home/simon/src/ports/misc/mmv/files/patch-mmv.1
--- /usr/ports/misc/mmv/files/patch-mmv.1	Thu Jan  1 01:00:00 1970
+++ /usr/home/simon/src/ports/misc/mmv/files/patch-mmv.1	Mon Sep  4 21:21:44 2006
@@ -0,0 +1,41 @@
+--- mmv.1.orig
++++ 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 @@
+ [\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 @@
+ 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 @@
+ .IR mmv ,
+ it is usually necessary to enclose the command-line
+ .I from
+-pattern
+-in quotes.
++and
++.I to
++patterns in quotes.
+ \}
+ 
+ .ce
diff -ruN -ruN --exclude=CVS /usr/ports/misc/mmv/files/patch-mmv.c /usr/home/simon/src/ports/misc/mmv/files/patch-mmv.c
--- /usr/ports/misc/mmv/files/patch-mmv.c	Thu Jan  1 01:00:00 1970
+++ /usr/home/simon/src/ports/misc/mmv/files/patch-mmv.c	Mon Sep  4 21:23:22 2006
@@ -0,0 +1,317 @@
+--- mmv.c
++++ mmv.c
+@@ -62,7 +62,8 @@
+ %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 @@
+ 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 ""
+@@ -85,6 +88,7 @@
+ 
+ #endif
+ 
++#include <unistd.h>
+ #include <stdio.h>
+ #include <ctype.h>
+ 
+@@ -120,14 +124,11 @@
+ #else
+ /* for various flavors of UN*X */
+ 
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+ 
+-extern char *getenv();
+-extern long lseek();
+-extern char *malloc();
+-
+ #ifdef HAS_DIRENT
+ #include <dirent.h>
+ typedef struct dirent DIRENTRY;
+@@ -390,7 +391,7 @@
+ static int snap(/* REP *first, REP *p */);
+ static void showdone(/* REP *fin */);
+ static void breakout(/*  */);
+-static int breakrep(/* */);
++static void breakrep(int);
+ static void breakstat(/* */);
+ static void quit(/*  */);
+ static int copymove(/* REP *p */);
+@@ -436,9 +437,11 @@
+ static SLICER slicer[2] = {{NULL, NULL, 0}, {NULL, NULL, 0}};
+ 
+ static int badreps = 0, paterr = 0, direrr, failed = 0, gotsig = 0, repbad;
+-static FILE *outfile = stdout;
++static FILE *outfile;
+ 
++#ifdef IS_MSDOS
+ static char IDF[] = "$$mmvdid.";
++#endif
+ static char TEMP[] = "$$mmvtmp.";
+ static char TOOLONG[] = "(too long)";
+ static char EMPTY[] = "(empty)";
+@@ -456,12 +459,12 @@
+ char fullrep[MAXPATH + 1];
+ static char *(start[MAXWILD]);
+ static int len[MAXWILD];
+-static char hasdot[MAXWILD];
+ static REP mistake;
+ #define MISTAKE (&mistake)
+ 
+ #ifdef IS_MSDOS
+ 
++static char hasdot[MAXWILD];
+ static int olddevflag, curdisk, maxdisk;
+ static struct {
+ 	char ph_banner[30];
+@@ -497,6 +500,8 @@
+ {
+ 	char *frompat, *topat;
+ 
++	outfile = stdout;
++
+ 	init();
+ 	procargs(argc, argv, &frompat, &topat);
+ 	domatch(frompat, topat);
+@@ -575,6 +580,11 @@
+ 	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)
+@@ -618,7 +628,8 @@
+ 			}
+ 		}
+ 
+-	if (op == DFLT)
++endargs:
++	if (op == DFLT) {
+ 		if (strcmp(cmdname, MOVENAME) == 0)
+ 			op = XMOVE;
+ 		else if (strcmp(cmdname, COPYNAME) == 0)
+@@ -629,6 +640,8 @@
+ 			op = HARDLINK;
+ 		else
+ 			op = DFLTOP;
++	}
++	
+ 	if (
+ 		op & DIRMOVE &&
+ #ifdef IS_MSDOS
+@@ -775,7 +788,7 @@
+ static int parsepat()
+ {
+ 	char *p, *lastname, c;
+-	int totwilds, instage, x, havedot;
++	int totwilds, instage, x;
+ 	static char TRAILESC[] = "%s -> %s : trailing %c is superfluous.\n";
+ 
+ 	lastname = from;
+@@ -999,20 +1012,16 @@
+ 				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
+@@ -1042,7 +1051,7 @@
+ 	DIRINFO *di;
+ 	HANDLE *h, *hto;
+ 	int prelen, litlen, nfils, i, k, flags, try;
+-	FILEINFO **pf, *fdel;
++	FILEINFO **pf, *fdel = NULL;
+ 	char *nto, *firstesc;
+ 	REP *p;
+ 	int wantdirs, ret = 1, laststage = (stage + 1 == nstages);
+@@ -1172,11 +1181,12 @@
+ 	if (*p == '.' || (!matchall && ffrom->fi_attrib & (FA_HIDDEN | FA_SYSTEM)))
+ 		return(strcmp(pat, p) == 0);
+ #else
+-	if (*p == '.')
++	if (*p == '.') {
+ 		if (p[1] == '\0' || (p[1] == '.' && p[2] == '\0'))
+ 			return(strcmp(pat, p) == 0);
+ 		else if (!matchall && *pat != '.')
+ 			return(0);
++	}
+ #endif
+ 	return(-1);
+ }
+@@ -1312,7 +1322,7 @@
+ {
+ 	char tpath[MAXPATH + 1];
+ 	char *pathend;
+-	FILEINFO *fdel;
++	FILEINFO *fdel = NULL;
+ 	int hlen, tlen;
+ 
+ 	if (op & DIRMOVE) {
+@@ -1405,7 +1415,9 @@
+ static int badname(s)
+ 	char *s;
+ {
++#ifdef IS_MSDOS
+ 	char *ext;
++#endif
+ 
+ 	return (
+ #ifdef IS_MSDOS
+@@ -1715,20 +1727,19 @@
+ 	struct stat dstat;
+ 	DIRID d;
+ 	DEVID v;
+-	DIRINFO **newdirs, *di;
+-	int nfils;
+-	FILEINFO **fils;
++	DIRINFO *di = NULL;
+ 	char *myp, *lastslash = NULL;
+ 	int sticky;
+ 	HANDLE *h;
+ 
+-	if (hsearch(p, which, &h))
++	if (hsearch(p, which, &h)) {
+ 		if (h->h_di == NULL) {
+ 			direrr = h->h_err;
+ 			return(NULL);
+ 		}
+ 		else
+ 			return(h);
++	}
+ 
+ 	if (*p == '\0')
+ 		myp = ".";
+@@ -1899,7 +1910,10 @@
+ 	char *pat, *s, **start1;
+ 	int *len1;
+ {
+-	char c, *olds;
++	char c;
++#ifdef IS_MSDOS
++	char *olds;
++#endif
+ 
+ 	*start1 = 0;
+ 	for(;;)
+@@ -2376,9 +2390,9 @@
+ static void doreps()
+ {
+ 	char *fstart;
+-	int k, printaliased = 0, alias;
++	int k, printaliased = 0, alias = 0;
+ 	REP *first, *p;
+-	long aliaslen;
++	long aliaslen = 0l;
+ 
+ #ifdef IS_MSDOS
+ 	ctrlbrk(breakrep);
+@@ -2396,11 +2410,12 @@
+ 			}
+ 			strcpy(fullrep, p->r_hto->h_name);
+ 			strcat(fullrep, p->r_nto);
+-			if (!noex && (p->r_flags & R_ISCYCLE))
++			if (!noex && (p->r_flags & R_ISCYCLE)) {
+ 				if (op & APPEND)
+ 					aliaslen = appendalias(first, p, &printaliased);
+ 				else
+ 					alias = movealias(first, p, &printaliased);
++			}
+ 			strcpy(pathbuf, p->r_hfrom->h_name);
+ 			fstart = pathbuf + strlen(pathbuf);
+ 			if ((p->r_flags & R_ISALIASED) && !(op & APPEND))
+@@ -2459,7 +2474,7 @@
+ 	REP *first, *p;
+ 	int *pprintaliased;
+ {
+-	long ret;
++	long ret = 0l;
+ 
+ #ifdef IS_MSDOS
+ 	int fd;
+@@ -2578,10 +2593,10 @@
+ }
+ 
+ 
+-static int breakrep()
++static void breakrep(int signum)
+ {
+ 	gotsig = 1;
+-	return(1);
++	return;
+ }
+ 
+ 
+@@ -2624,11 +2639,12 @@
+ 
+ static int copy(ff, len)
+ 	FILEINFO *ff;
+-	long len;
++	off_t len;
+ {
+-	char buf[BUFSIZE], c;
++	char buf[BUFSIZE];
+ 	int f, t, k, mode, perm;
+ #ifdef IS_MSDOS
++        char c;
+ 	struct ftime tim;
+ #else
+ #ifdef IS_SYSV
+@@ -2672,7 +2688,7 @@
+ 		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) {
+@@ -2684,10 +2700,10 @@
+ 			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;
diff -ruN -ruN --exclude=CVS /usr/ports/misc/mmv/pkg-descr /usr/home/simon/src/ports/misc/mmv/pkg-descr
--- /usr/ports/misc/mmv/pkg-descr	Mon Mar 27 22:55:28 1995
+++ /usr/home/simon/src/ports/misc/mmv/pkg-descr	Mon Sep  4 20:04:17 2006
@@ -1,12 +1,7 @@
-This is mmv, a program to move/copy/append/link multiple files
-according to a set of wildcard patterns. The wildcard matches
-can be reused in forming the target names. You can i.e. move
-all *.c.or? files to or?.new.*.c by saying 'mmv "*.c.or?" or=2.new.=1.c'
+mmv is a program to move/copy/append/link multiple files according to a set
+of wildcard patterns. This multiple action is performed safely, i.e. without
+any unexpected deletion of files due to collisions of target names with
+existing filenames or with other target names.
 
-The multiple action is performed safely, i.e. without any unexpected
-deletion of files due to collisions of target names with existing
-filenames or with other target names. Furthermore, before doing
-anything, mmv attempts to detect any errors that would result from the
-entire set of actions specified and gives the user the choice of
-either aborting before beginning, or proceeding by avoiding the
-offending parts.
+Author: Vladimir Lanin <vlad@brm.com>
+WWW:	http://packages.debian.org/unstable/utils/mmv 
diff -ruN -ruN --exclude=CVS /usr/ports/misc/mmv/pkg-plist /usr/home/simon/src/ports/misc/mmv/pkg-plist
--- /usr/ports/misc/mmv/pkg-plist	Mon May 31 06:53:16 1999
+++ /usr/home/simon/src/ports/misc/mmv/pkg-plist	Thu Jan  1 01:00:00 1970
@@ -1,4 +0,0 @@
-bin/mad
-bin/mcp
-bin/mln
-bin/mmv
--- mmv-1.01b.14.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060904205701.CCD951E6CD9>