From owner-freebsd-ports@FreeBSD.ORG Thu Oct 5 16:28:14 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19B7516A40F for ; Thu, 5 Oct 2006 16:28:14 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 913F643D91 for ; Thu, 5 Oct 2006 16:27:56 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.6/8.13.8) id k95GRuvw065403; Thu, 5 Oct 2006 11:27:56 -0500 (CDT) (envelope-from dan) Date: Thu, 5 Oct 2006 11:27:56 -0500 From: Dan Nelson To: simon@olofsson.de Message-ID: <20061005162756.GA53160@dan.emsphone.com> References: <20061005153032.GA2713@dan.emsphone.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <20061005153032.GA2713@dan.emsphone.com> X-OS: FreeBSD 6.2-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-ports@freebsd.org Subject: Re: FreeBSD Port: mmv-1.01b.14 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2006 16:28:14 -0000 --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In the last episode (Oct 05), Dan Nelson said: > The mmv update from 1.01b to 1.01b.14 that just got committed changes > the "to" wildcard index character from '=' to '#'. The Debian sources > the new version is based on is derived from the DOS version of mmv > (which uses '#') where the original FreeBSD port referenced the Unix > mmv (which uses '='). Attached is a patch that allows both escape characters. -- Dan Nelson dnelson@allantgroup.com --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch-indexchar --- mmv.1 Thu Oct 5 10:41:34 2006 +++ mmv.1 Thu Oct 5 11:20:55 2006 @@ -57,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 +.I mmv +does support large files (LFS) but it does *NOT* support sparse files (i.e. it explodes them). .ce The Task Options @@ -348,7 +349,7 @@ 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 @@ -409,7 +410,7 @@ 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 '#', @@ -642,6 +643,15 @@ .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 --- mmv.c Thu Oct 5 10:36:36 2006 +++ mmv.c Thu Oct 5 10:38:31 2006 @@ -73,7 +73,8 @@ %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 @@ lastname = p + 1; break; case '#': + case '=': + { + char index_char=c; c = *(++p); if (c == 'l' || c == 'u') { #ifdef IS_MSDOS @@ -986,8 +990,8 @@ #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 @@ 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 @@ havedot = 1; #endif break; + } case ESC: if ((c = *(++p)) == '\0') { printf(TRAILESC, from, to, ESC); @@ -2029,7 +2034,7 @@ 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') { --vkogqOf2sHV7VnPd--