summaryrefslogtreecommitdiff
path: root/distrib/alpha/list2sh.awk
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-05-16 02:27:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-05-16 02:27:11 +0000
commit8443886a696fefa8e1d6c1948238849fb2cb8186 (patch)
tree2db66ed8f42f78e11d3e2f4cd9d22c729c029a49 /distrib/alpha/list2sh.awk
parent554909a38bd27b49412fc41786056bebc0352ed3 (diff)
Only remove dest file before copy/link if it already exists.
Diffstat (limited to 'distrib/alpha/list2sh.awk')
-rw-r--r--distrib/alpha/list2sh.awk8
1 files changed, 4 insertions, 4 deletions
diff --git a/distrib/alpha/list2sh.awk b/distrib/alpha/list2sh.awk
index f0176022848..9b9f9b596b0 100644
--- a/distrib/alpha/list2sh.awk
+++ b/distrib/alpha/list2sh.awk
@@ -1,4 +1,4 @@
-# $OpenBSD: list2sh.awk,v 1.2 1997/05/16 01:45:05 millert Exp $
+# $OpenBSD: list2sh.awk,v 1.3 1997/05/16 02:27:10 millert Exp $
BEGIN {
printf("cd ${CURDIR}\n");
@@ -10,14 +10,14 @@ BEGIN {
}
$1 == "COPY" {
printf("echo '%s'\n", $0);
- printf("rm -fr ${TARGDIR}/%s\n", $3);
+ printf("test -f ${TARGDIR}/%s && rm -fr ${TARGDIR}/%s\n", $3, $3);
printf("cp %s ${TARGDIR}/%s\n", $2, $3);
next;
}
$1 == "LINK" {
printf("echo '%s'\n", $0);
for (i = 3; i <= NF; i++) {
- printf("rm -f ${TARGDIR}/%s\n", $i);
+ printf("test -f ${TARGDIR}/%s && rm -f ${TARGDIR}/%s\n", $i, $i);
printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $i);
}
next;
@@ -25,7 +25,7 @@ $1 == "LINK" {
$1 == "SYMLINK" {
printf("echo '%s'\n", $0);
for (i = 3; i <= NF; i++) {
- printf("rm -f ${TARGDIR}/%s\n", $i);
+ printf("test -f ${TARGDIR}/%s && rm -f ${TARGDIR}/%s\n", $i, $i);
printf("(cd ${TARGDIR}; ln -s %s %s)\n", $2, $i);
}
next;