1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

Import Michael Elbel's mmv port.

This commit is contained in:
Jordan K. Hubbard 1995-03-27 20:55:28 +00:00
parent b1606b6d57
commit e07220aca9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=1209
7 changed files with 220 additions and 0 deletions

91
misc/mmv/Makefile Normal file
View File

@ -0,0 +1,91 @@
# New ports collection makefile for: mmv
# Version required: 1.01b
# Date created: 2 Feb 1995
# Whom: Michael Elbel (me)
# Responsible: me@FreeBSD.org
#
# $Id$
#
# MASTER_SITES= ftp://gatekeeper.dec.com/archive/.b/usenet/comp.sources.unix/volume21/mmv
# part01.Z
# part02.Z
# ftp://gatekeeper.dec.com/archive/.b/usenet/comp.sources.unix/volume22/mmv.pch.Z
DISTNAME=mmv
DISTDIR=${PORTSDIR}/distfiles/${DISTNAME}
# MASTER_SITES=ftp://dodo/usr/me/tmp/
MASTER_SITES=ftp://gatekeeper.dec.com/archive/.b/usenet/comp.sources.unix/
DISTFILES= part01.Z part02.Z mmv.pch.Z
SITE_DISTFILES= volume21/mmv/part01.Z volume21/mmv/part02.Z volume22/mmv.pch.Z
NO_WRKSUBDIR=true
# targets shamelessly hacked from the bsd.ports.mk file
fetch: pre-fetch
@if [ ! -d ${DISTDIR} ]; then mkdir -p ${DISTDIR}; fi
@(cd ${DISTDIR}; \
for file in ${SITE_DISTFILES}; do \
if [ ! -f `basename $$file` ]; then \
echo ">> `basename $$file` doesn't seem to exist on this system."; \
echo ">> Attempting to fetch it from a master site."; \
for site in ${MASTER_SITES}; do \
pwd;\
if ${NCFTP} ${NCFTPFLAGS} $${site}$${file}; then \
break; \
fi \
done; \
if [ ! -f `basename $$file` ]; then \
echo ">> Couldn't fetch it - please try to retreive this";\
echo ">> port manually into ${DISTDIR} and try again."; \
exit 1; \
fi; \
fi \
done)
extract: fetch work/.extract_done
work/.extract_done:
@${MAKE} ${.MAKEFLAGS} checksum pre-extract
@echo "===> Extracting for ${DISTNAME}"
@rm -rf ${WRKDIR}
@mkdir -p ${WRKDIR}/tmp
@(cd ${DISTDIR} ; for file in ${DISTFILES}; do \
cp $$file ${WRKDIR}/tmp; \
done ; \
cd ${WRKDIR}/tmp; \
uncompress *; \
cd .. ; \
for file in tmp/part0* ; do \
${SCRIPTDIR}/unshar $$file; \
done ; \
${SCRIPTDIR}/makeitapatch tmp/mmv.pch ; \
mv tmp/mmv.pch ${PATCHDIR}/patch-0a ; \
cat mmv.c.? >mmv.c ; rm mmv.c.? )
${TOUCH} ${TOUCH_FLAGS} ${EXTRACT_COOKIE}
pre-extract:
chmod +x scripts/unshar scripts/makeitapatch
install: build work/.install_done
work/.install_done:
echo "===> Installing for ${DISTNAME}"
(if [ ! -d ${PREFIX}/bin ] ; then mkdir -p ${PREFIX}/bin ; fi ; \
cd ${PREFIX}/bin ; rm -f mmv mad mcp mln ; \
cd ${WRKSRC}; \
install ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
mmv ${PREFIX}/bin ; \
ln ${PREFIX}/bin/mmv ${PREFIX}/bin/mad ; \
ln ${PREFIX}/bin/mmv ${PREFIX}/bin/mcp ; \
ln ${PREFIX}/bin/mmv ${PREFIX}/bin/mln ; \
if [ ! -f mmv.1.gz ] ; then gzip mmv.1 ; fi ; \
if [ ! -d ${PREFIX}/man/man1 ]; then mkdir -p ${PREFIX}/man/man1; fi; \
install ${COPY} -o ${BINOWN} -g ${BINGRP} \
mmv.1.gz ${PREFIX}/man/man1 ; )
@${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
.include <bsd.port.mk>

3
misc/mmv/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (part01.Z) = 8844a88bbe189e280361136f25a589d4
MD5 (part02.Z) = 9e01b9aaceaab18cb9efafa6dec5df81
MD5 (mmv.pch.Z) = e6f8cb26c8966a82d6f3f26a6e4bee23

98
misc/mmv/files/patch-aa Normal file
View File

@ -0,0 +1,98 @@
*** mmv.c.old Wed Mar 1 05:23:56 1995
--- mmv.c Thu Mar 2 05:43:37 1995
***************
*** 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 ----
***************
*** 2550,2559 ****
}
! static int breakrep()
{
gotsig = 1;
- return(1);
}
--- 2546,2554 ----
}
! static void breakrep()
{
gotsig = 1;
}
***************
*** 2832,2838 ****
}
! #ifndef MSDOS
static void memmove(to, from, k)
char *to, *from;
unsigned k;
--- 2827,2833 ----
}
! #if 0
static void memmove(to, from, k)
char *to, *from;
unsigned k;

1
misc/mmv/pkg-comment Normal file
View File

@ -0,0 +1 @@
mmv - move/copy/append/link multiple files with sophisticated wildcard matching

12
misc/mmv/pkg-descr Normal file
View File

@ -0,0 +1,12 @@
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'
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.

7
misc/mmv/pkg-plist Normal file
View File

@ -0,0 +1,7 @@
@cwd /usr/local/
@cwd /a/me
bin/mmv
bin/mad
bin/mcp
bin/mln
man/man1/mmv.1.gz

8
misc/mmv/scripts/unshar Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
ed $1 <<XXXEOF
/#! \/bin\/sh
1,.-1d
w
q
XXXEOF
/bin/sh $1