From ea98dafce5b5657cfd65a3a5210c46bcda367525 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Mon, 20 Jul 2020 18:58:52 -0700 Subject: [PATCH] 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. --- sys/src/cmd/replica/mkfile | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/sys/src/cmd/replica/mkfile b/sys/src/cmd/replica/mkfile index 61f83d965..7cc5c4b0c 100644 --- a/sys/src/cmd/replica/mkfile +++ b/sys/src/cmd/replica/mkfile @@ -12,7 +12,6 @@ TARG=\ applylog\ compactdb\ updatedb\ - $SCRIPTS\ OFILES=\ db.$O\ @@ -20,29 +19,16 @@ OFILES=\ 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 $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/%}