diff options
author | roam <roam@FreeBSD.org> | 2001-02-21 18:44:54 +0000 |
---|---|---|
committer | roam <roam@FreeBSD.org> | 2001-02-21 18:44:54 +0000 |
commit | f9bf579c8aac8f53f5a052a25dee04cf60765940 (patch) | |
tree | 66ec792e23bc89a4e986b9e3d26da6aec9935852 /sysutils/safecat | |
parent | 99e611df11fa040e76e48d0d0e1c1fadf10026d5 (diff) | |
download | FreeBSD-ports-f9bf579c8aac8f53f5a052a25dee04cf60765940.zip FreeBSD-ports-f9bf579c8aac8f53f5a052a25dee04cf60765940.tar.gz |
Update to 1.5, remove all my unneeded patches, after Peter van Dijk
and the author, Len Budney, convinced me there was no need for my
changes.
Final push by: Bill Fenner's distfiles check
Diffstat (limited to 'sysutils/safecat')
-rw-r--r-- | sysutils/safecat/Makefile | 2 | ||||
-rw-r--r-- | sysutils/safecat/distinfo | 2 | ||||
-rw-r--r-- | sysutils/safecat/files/patch-aa | 37 | ||||
-rw-r--r-- | sysutils/safecat/files/patch-ab | 10 | ||||
-rw-r--r-- | sysutils/safecat/files/patch-ac | 45 | ||||
-rw-r--r-- | sysutils/safecat/files/patch-ad | 89 | ||||
-rw-r--r-- | sysutils/safecat/files/patch-ae | 9 |
7 files changed, 2 insertions, 192 deletions
diff --git a/sysutils/safecat/Makefile b/sysutils/safecat/Makefile index 11d9d9b..7c730cf 100644 --- a/sysutils/safecat/Makefile +++ b/sysutils/safecat/Makefile @@ -6,7 +6,7 @@ # PORTNAME= safecat -PORTVERSION= 1.4 +PORTVERSION= 1.5 CATEGORIES= sysutils mail MASTER_SITES= http://www.nb.net/~lbudney/linux/software/safecat/ diff --git a/sysutils/safecat/distinfo b/sysutils/safecat/distinfo index 02f192b..061c902 100644 --- a/sysutils/safecat/distinfo +++ b/sysutils/safecat/distinfo @@ -1 +1 @@ -MD5 (safecat-1.4.tar.gz) = c94e03c6918c4619c73c22297dced58e +MD5 (safecat-1.5.tar.gz) = c7292e3ed8cf89288b9cc5e6c5e09ce2 diff --git a/sysutils/safecat/files/patch-aa b/sysutils/safecat/files/patch-aa deleted file mode 100644 index bfd397a..0000000 --- a/sysutils/safecat/files/patch-aa +++ /dev/null @@ -1,37 +0,0 @@ ---- Makefile 2000/11/21 08:57:14 1.1.1.1 -+++ Makefile 2000/11/21 09:44:08 1.2 -@@ -196,13 +196,17 @@ - chmod 755 makelib - - open.a: \ --makelib open_read.o open_trunc.o open_append.o -- ./makelib open.a open_read.o open_trunc.o open_append.o -+makelib open_read.o open_trunc.o open_append.o open_excl.o -+ ./makelib open.a open_read.o open_trunc.o open_append.o open_excl.o - - open_append.o: \ - compile open_append.c open.h - ./compile open_append.c - -+open_excl.o: \ -+compile open_excl.c open.h -+ ./compile open_excl.c -+ - open_read.o: \ - compile open_read.c open.h - ./compile open_read.c -@@ -212,12 +216,12 @@ - ./compile open_trunc.c - - safecat: \ --load safecat.o getln.a str.a stralloc.a strerr.a substdio.a alloc.o \ -+load safecat.o getln.a str.a stralloc.a strerr.a substdio.a open.a alloc.o \ - alloc_re.o byte_copy.o byte_cr.o envread.o error.o error_str.o fmt_ulong.o \ - hostname.o sig.o stat_dir.o str_diffn.o str_len.o substdio_copy.o \ - substdi.o substdio.o taia_fmtfrac.o taia_now.o taia_tai.o tempfile.o \ - writefile.o -- ./load safecat getln.a str.a stralloc.a strerr.a substdio.a \ -+ ./load safecat getln.a str.a stralloc.a strerr.a substdio.a open.a \ - alloc.o alloc_re.o byte_copy.o byte_cr.o envread.o error.o \ - error_str.o fmt_ulong.o hostname.o sig.o stat_dir.o str_diffn.o \ - str_len.o substdi.o substdio.o substdio_copy.o taia_fmtfrac.o \ diff --git a/sysutils/safecat/files/patch-ab b/sysutils/safecat/files/patch-ab deleted file mode 100644 index f7f8ace..0000000 --- a/sysutils/safecat/files/patch-ab +++ /dev/null @@ -1,10 +0,0 @@ ---- TARGETS 2000/11/21 08:57:14 1.1.1.1 -+++ TARGETS 2000/11/21 09:43:02 1.2 -@@ -33,6 +33,7 @@ - makelib - open.a - open_append.o -+open_excl.o - open_read.o - open_trunc.o - safecat diff --git a/sysutils/safecat/files/patch-ac b/sysutils/safecat/files/patch-ac deleted file mode 100644 index d0d0609..0000000 --- a/sysutils/safecat/files/patch-ac +++ /dev/null @@ -1,45 +0,0 @@ ---- safecat.1 2000/11/21 08:57:15 1.1.1.1 -+++ safecat.1 2000/11/21 10:25:44 1.2 -@@ -80,9 +80,9 @@ - and - .IR destdir , - and exits unless both directories exist and are writable. --Second, it --.B stat()s --the name -+Second, it attempts to -+.B open() -+exclusively the file - .BR tempdir/\fItime.pid.host , - where - .I time -@@ -91,22 +91,21 @@ - is the program's process ID, - and - .I host --is the host name. -+is the host name. The exclusive -+.B open() -+will fail if the file already exists. - Third, if --.B stat() --returned anything other than ENOENT, -+.B open() -+returned EEXIST (the file already exists), - the program sleeps for two seconds, updates - .IR time , - and tries the --.B stat() -+.B open() - again, a limited number of times. - Fourth, the program --creates --.BR tempdir/\fItime.pid.host . --Fifth, the program - .I NFS-writes - the message to the file. --Sixth, the program -+Fifth, the program - .BR link() s - the file to - .BR destdir/\fItime.pid.host . diff --git a/sysutils/safecat/files/patch-ad b/sysutils/safecat/files/patch-ad deleted file mode 100644 index f754c68..0000000 --- a/sysutils/safecat/files/patch-ad +++ /dev/null @@ -1,89 +0,0 @@ ---- safecat.c 2000/11/21 08:57:15 1.1.1.1 -+++ safecat.c 2000/11/21 10:25:22 1.2 -@@ -36,7 +36,6 @@ - int outfd = 0; - stralloc dstpath = {0}; - stralloc outfile = {0}; -- stralloc outpath = {0}; - struct stat filestat; - unsigned int count = 0; - -@@ -57,43 +56,40 @@ - stat_dir(tempdir); - stat_dir(destdir); - -- /* Step 2: Stat the temporary file. Wait for ENOENT as a response. */ -+ /* Step 2: Create the temporary file. */ -+ alarm(86400); - for(count=0;;count++) { - /* Get the temporary filename to use now for dumping data. */ - mk_tempfile(&outfile); -- if (!stralloc_cats(&outpath,tempdir)) die_nomem(); -- if (!stralloc_append(&outpath, "/")) die_nomem(); -- if (!stralloc_cat(&outpath,&outfile)) die_nomem(); -- if(stat(outfile.s,&filestat) == -1 && errno == ENOENT) { -+ if (!stralloc_cats(&tmppath,tempdir)) die_nomem(); -+ if (!stralloc_append(&tmppath, "/")) die_nomem(); -+ if (!stralloc_cat(&tmppath,&outfile)) die_nomem(); -+ -+ outfd = open_excl(tmppath.s); -+ if (outfd >= 0) { -+ /* file created successfully */ - if (!stralloc_cats(&dstpath, destdir)) die_nomem(); - if (!stralloc_append(&dstpath, "/")) die_nomem(); - if (!stralloc_cat(&dstpath,&outfile)) die_nomem(); -- -- if (!stralloc_cats(&tmppath, tempdir)) die_nomem(); -- if (!stralloc_append(&tmppath, "/")) die_nomem(); -- if (!stralloc_cat(&tmppath,&outfile)) die_nomem(); - break; - } -+ if (errno != EEXIST) { -+ /* a "real" error occured, bail out */ -+ strerr_die2x(111, "safecat: fatal: ","could not create temporary file"); -+ } - -- /* Try up to 5 times, every 2 seconds. */ -+ /* Step 3: try up to 5 times, every 2 seconds. */ - if(count == 5) { -- strerr_die2x(111, "safecat: fatal: ","could not stat temporary file"); -+ strerr_die2x(111, "safecat: fatal: ","could not create temporary file"); - } - - /* Wait 2 seconds, and try again. */ - stralloc_copys(&outfile,""); -- stralloc_copys(&outpath,""); -+ stralloc_copys(&tmppath,""); - sleep(2); - } - -- /* Step 4: Create the file tempdir/time.pid.host */ -- alarm(86400); -- outfd = open(tmppath.s,O_WRONLY | O_EXCL | O_CREAT,0644); -- if(outfd == -1) { -- strerr_die2sys(111,"safecat: fatal: ","couldn't create output file: "); -- } -- -- /* Step 5: Copy stdin to the temp file. */ -+ /* Step 4: Copy stdin to the temp file. */ - writefile(outfd); - - /* Close the file, checking the return value. */ -@@ -102,11 +98,16 @@ - strerr_die2sys(111,"safecat: fatal: ","can't fsync/close output file: "); - } - -- /* Step 6: Link the temp file to its final destination. */ -+ /* Step 5: Link the temp file to its final destination. */ - if(link(tmppath.s,dstpath.s) == -1) { - strerr_die2sys(111,"safecat: fatal: ","can't link output file: "); - } - /* We've succeeded! Now, no matter what, we return "success" */ -+ -+ /* Kill the alarm() just in case the 24 hours expire at a most unfortunate -+ time - just after a successful completion (e.g. unlink() over NFS could -+ be slow) */ -+ alarm(0); - - /* Okay, delete the temporary file. */ - unlink(tmppath.s); diff --git a/sysutils/safecat/files/patch-ae b/sysutils/safecat/files/patch-ae deleted file mode 100644 index 4b42ba9..0000000 --- a/sysutils/safecat/files/patch-ae +++ /dev/null @@ -1,9 +0,0 @@ ---- /dev/null Tue Nov 21 12:27:45 2000 -+++ open_excl.c Tue Nov 21 11:17:15 2000 -@@ -0,0 +1,6 @@ -+#include <sys/types.h> -+#include <fcntl.h> -+#include "open.h" -+ -+int open_excl(fn) char *fn; -+{ return open(fn,O_WRONLY | O_EXCL | O_CREAT,0644); } |