Index: head/misc/mmv/Makefile =================================================================== --- head/misc/mmv/Makefile (revision 452809) +++ head/misc/mmv/Makefile (revision 452810) @@ -1,34 +1,36 @@ # Created by: Michael Elbel (me) # $FreeBSD$ PORTNAME= mmv -PORTVERSION= 1.01b.15 +PORTVERSION= 1.01b.19 CATEGORIES= misc MASTER_SITES= DEBIAN_POOL DISTNAME= ${PORTNAME}_1.01b.orig PATCH_SITES= ${MASTER_SITES} PATCHFILES= ${PORTNAME}_1.01b-15.diff.gz PATCH_DIST_STRIP= -p1 -MAINTAINER= ports@FreeBSD.org +MAINTAINER= se@FreeBSD.org COMMENT= Move/Copy/Append/Link multiple files +LICENSE= Freeware +LICENSE_NAME= MMV +LICENSE_FILE= ${PATCHDIR}/LICENSE +LICENSE_PERMS= dist-mirror pkg-mirror auto-accept + CFLAGS+= -DHAS_DIRENT WRKSRC= ${WRKDIR}/${PORTNAME}-1.01b.orig do-build: - @(cd ${WRKSRC} ; \ - ${CC} ${CFLAGS} -o ${PORTNAME} ${PORTNAME}.c ; ) + cd ${WRKSRC}; ${CC} ${CFLAGS} -o ${PORTNAME} ${PORTNAME}.c do-install: - @${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} \ - ${STAGEDIR}${PREFIX}/bin/${PORTNAME} - @${INSTALL_MAN} ${WRKSRC}/mmv.1 \ - ${STAGEDIR}${PREFIX}/man/man1/${PORTNAME}.1 + ${INSTALL_PROGRAM} ${WRKSRC}/mmv ${STAGEDIR}${PREFIX}/bin/ + ${INSTALL_MAN} ${WRKSRC}/mmv.1 ${STAGEDIR}${PREFIX}/man/man1/ .for i in mcp mad mln - @${LN} -sf ${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${i} - @${LN} -sf ${PORTNAME}.1 ${STAGEDIR}${PREFIX}/man/man1/${i}.1 + ${LN} -sf ${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${i} + ${LN} -sf ${PORTNAME}.1 ${STAGEDIR}${PREFIX}/man/man1/${i}.1 .endfor .include Index: head/misc/mmv/files/LICENSE =================================================================== --- head/misc/mmv/files/LICENSE (nonexistent) +++ head/misc/mmv/files/LICENSE (revision 452810) @@ -0,0 +1,10 @@ +Copyright (c) 1989 Vladimir Lanin + +Mmv is freeware. That means that the entire package of software and +documentation is copyrighted, and may not be distributed with any +modifications or for any charge (without the author's explicit written +permission). Other than that, it may be used and distributed freely. + +Vladimir Lanin +330 Wadsworth Ave, Apt 6F +New York, NY 10040 Property changes on: head/misc/mmv/files/LICENSE ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/misc/mmv/files/patch-mmv.1 =================================================================== --- head/misc/mmv/files/patch-mmv.1 (revision 452809) +++ head/misc/mmv/files/patch-mmv.1 (revision 452810) @@ -1,36 +1,120 @@ ---- mmv.1 Thu Oct 5 19:09:58 2006 -+++ mmv.1 Thu Oct 5 19:12:46 2006 -@@ -345,7 +345,7 @@ +--- mmv.1.orig 2017-10-24 14:25:26 UTC ++++ mmv.1 +@@ -35,6 +35,43 @@ mmv \- move/copy/append multiple files by wildcard pat + .B mmvpatch + [\fBexecutable\fP] + \} ++.SH "EXAMPLES" ++Rename all ++.I *.jpeg ++files in the current directory to ++\fI*.jpg\fR: ++ ++.in +3 ++mmv '*.jpeg' '#1.jpg' ++.in -3 ++ ++Replace the first occurrence of ++.I abc ++with ++.I xyz ++in all files in the current directory: ++ ++.in +3 ++mmv '*abc*' '#1xyz#2' ++.in -3 ++ ++Rename files ending in \fI.html.en\fR, \fI.html.de\fR, etc. to ending ++in \fI.en.html\fR, \fI.de.html\fR, etc. in the current directory: ++ ++.in +3 ++mmv '*.html.??' '#1.#2#3.html' ++.in -3 ++ ++Rename music files from ++.I - - .ogg ++to ++.I - - .ogg ++in the current directory: ++ ++.in +3 ++mmv '* - * - *.ogg' '#2 - #1 - #3.ogg' ++.in -3 ++ + .SH "DESCRIPTION" + .I Mmv + moves (or copies, +@@ -196,8 +233,13 @@ and it applies to all matching files. + Remaining options need not be given separately, + i.e. "mmv \-mk" is allowed. + ++\fBWARNING:\fR This operation mode does \fBnot\fR work if the patterns ++itself contain \fBspaces\fR. See ++.I http://bugs.debian.org/149873 ++for details. ++ + .ce +-Multiple Pattern Pairs ++Multiple Pattern Pairs / Reading Patterns from STDIN + .PP + Multiple + .I from +@@ -240,6 +282,11 @@ would give the error message "a \-> c : no match" beca + (even if it exists) + was already matched by the first pattern pair. + ++\fBWARNING:\fR This operation mode does \fBnot\fR work if the patterns ++itself contain \fBspaces\fR. See ++.I http://bugs.debian.org/149873 ++for details. ++ + .ce + The \fIFrom\fP Pattern + .PP +@@ -350,7 +397,7 @@ pattern is a filename with embedded .I wildcard .IR indexes , -where an index consists of the character '#' +where an index consists of the character '#' or '=' followed by a string of digits. When a source file matches a .I from -@@ -406,7 +406,7 @@ +@@ -411,7 +458,7 @@ if "dir2" is indeed a directory, actually move "dir1\* However, if "dir2\*(SLa" already exists and is itself a directory, this is considered an error. .PP -To strip any character (e.g. '*', '?', or '#') +To strip any character (e.g. '*', '?', '#', or '=') of its special meaning to .IR mmv , as when the actual replacement name must contain the character '#', -@@ -639,6 +639,15 @@ +@@ -555,6 +602,12 @@ and will accept pattern pairs with or without the inte + Lines with "(*)" after the target pattern have the effect of enabling \-d + for the files matching this pattern only, + so that such deletions are done silently. ++ ++\fBWARNING:\fR This means that \fBunexpected things\fR may happen if ++\fBfiles\fR matched by the patterns contain \fBspaces\fR. See ++.I http://bugs.debian.org/149873 ++for details. ++ + When feeding + .I mmv + its own output, +@@ -644,6 +697,15 @@ and with status 0 otherwise. .SH "SEE ALSO" mv(1), cp(1), ln(1), umask(1) \} +.SH "HISTORY" +The original FreeBSD port of mmv was derived from the Usenet +comp.sources.unix postings <2438@litchi.bbn.com>, +<2439@litchi.bbn.com>, and <2643@litchi.bbn.com>. +The current port is based on the comp.binaries.ibm.pc postings +(no messageids available). +The Unix version used '=' as the index escape character, +while the MS-DOS version used '#'. +This port allows both. .SH "AUTHOR" Vladimir Lanin .br Index: head/misc/mmv/files/patch-mmv.c =================================================================== --- head/misc/mmv/files/patch-mmv.c (revision 452809) +++ head/misc/mmv/files/patch-mmv.c (revision 452810) @@ -1,61 +1,82 @@ ---- mmv.c Thu Oct 5 10:36:36 2006 -+++ mmv.c Thu Oct 5 10:38:31 2006 -@@ -73,7 +73,8 @@ +--- mmv.c.orig 2017-10-24 14:25:26 UTC ++++ mmv.c +@@ -73,7 +73,8 @@ Use -- as the end of options.\n"; %s [-m|x|r|c|o|a|l%s] [-h] [-d|p] [-g|t] [-v|n] [from to]\n\ \n\ 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\ +string matched by the N'th ``from'' pattern wildcard. = can be used\n\ +instead of #.\n\ \n\ A ``from'' pattern containing wildcards should be quoted when given\n\ on the command line. Also you may need to quote ``to'' pattern.\n\ -@@ -976,6 +977,9 @@ +@@ -977,6 +978,9 @@ static int parsepat() lastname = p + 1; break; case '#': + case '=': + { + char index_char=c; c = *(++p); if (c == 'l' || c == 'u') { #ifdef IS_MSDOS -@@ -986,8 +990,8 @@ +@@ -987,8 +991,8 @@ static int parsepat() #endif } if (!isdigit(c)) { - printf("%s -> %s : expected digit (not '%c') after #.\n", - from, to, c); + printf("%s -> %s : expected digit (not '%c') after %c.\n", + from, to, c, index_char); return(-1); } for(x = 0; ;x *= 10) { -@@ -998,8 +1002,8 @@ +@@ -999,8 +1003,8 @@ static int parsepat() p++; } if (x < 1 || x > totwilds) { - printf("%s -> %s : wildcard #%d does not exist.\n", - from, to, x); + printf("%s -> %s : wildcard %c%d does not exist.\n", + from, to, index_char, x); return(-1); } #ifdef IS_MSDOS -@@ -1007,6 +1011,7 @@ +@@ -1008,6 +1012,7 @@ static int parsepat() havedot = 1; #endif break; + } case ESC: if ((c = *(++p)) == '\0') { printf(TRAILESC, from, to, ESC); -@@ -2029,7 +2034,7 @@ +@@ -1215,7 +1220,11 @@ static int keepmatch(ffrom, pathend, pk, needslash, di + getstat(pathbuf, ffrom); + if ((ffrom->fi_stflags & FI_ISDIR) ? !dirs : !fils) + #endif ++ { ++ if (verbose) ++ printf("ignoring directory %s\n", ffrom->fi_name); + return(0); ++ } + + if (needslash) { + strcpy(pathend + *pk, SLASHSTR); +@@ -2030,7 +2039,7 @@ static void makerep() repbad = 0; p = fullrep; for (pat = to, l = 0; (c = *pat) != '\0'; pat++, l++) { - if (c == '#') { + if (c == '#' || c == '=') { c = *(++pat); #ifndef IS_MSDOS if (c == 'l') { +@@ -2828,7 +2837,7 @@ static int getreply(m, failact) + static FILE *tty = NULL; + int c, r; + +- fprintf(stderr, m); ++ fprintf(stderr, "%s", m); + if (tty == NULL && (tty = fopen(TTY, "r")) == NULL) { + fprintf(stderr, "Can not open %s to get reply.\n", TTY); + if (failact == -1)