shithub: riscv

Download patch

ref: ea98dafce5b5657cfd65a3a5210c46bcda367525
parent: 2d59d75e3a4faa51bfc146f70aea7734cd8bb9ef
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Jul 20 14:58:52 EDT 2020

replica: fix mkfile script installation (thanks Amavect)

The $SCRIPTS were added to $TARG, which complicates the all rule, as
each script's object file must be suppressed.
Fix by removing $SCRIPTS from $TARG, removing the script object file
suppression rule, and overriding the install rule.

The script bin install rule assumes that only one script install is
called at a time. Valid calls like 'mk -a /$objtype/replica/changes
/$objtype/replica/pull' will fail.
Fix by adding a for loop.

Remove the unused $UPDATE variable.

--- a/sys/src/cmd/replica/mkfile
+++ b/sys/src/cmd/replica/mkfile
@@ -12,7 +12,6 @@
 	applylog\
 	compactdb\
 	updatedb\
-	$SCRIPTS\
 
 OFILES=\
 	db.$O\
@@ -20,20 +19,6 @@
 
 HFILES=all.h
 
-UPDATE=\
-	mkfile\
-	/sys/man/1/replica\
-	/sys/man/8/replica\
-	${OFILES:%.$O=%.c}\
-	revproto.c\
-	$HFILES\
-	applychanges.c\
-	updatedb.c\
-	${TARG:%=/386/bin/replica/%}\
-	${SCRIPTS:%=/rc/bin/replica/%}\
-	/rc/bin/replica/defs\
-
-
 BIN=/$objtype/bin/replica
 </sys/src/cmd/mkmany
 
@@ -40,9 +25,10 @@
 $O.applychanges: revproto.$O
 
 ${SCRIPTS:%=$BIN/%}:
-	{ echo '#!/bin/rc'; echo 'exec /rc/bin/replica/'^`{basename $target}^' $*' } >$target
+	for(i in $target){
+		echo '#!/bin/rc'
+		echo 'exec /rc/bin/replica/'^`{basename $i}^' $*'
+	} >$i
 	chmod +x $target
 
-${SCRIPTS:%=$O.%}:QV:
-	;
-
+install:V: ${TARG:%=$BIN/%} ${SCRIPTS:%=$BIN/%}