diff options
author | rsc <devnull@localhost> | 2005-09-13 00:22:50 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-09-13 00:22:50 +0000 |
commit | c26c001a1c7ea3b458cf9534908dbc8bcff38622 (patch) | |
tree | 69ea8053c4e353c483588224c17f3858ca0e5cd5 /lib | |
parent | 9847210bcb677f11ea6b80bb2942486d989647a9 (diff) | |
download | plan9port-c26c001a1c7ea3b458cf9534908dbc8bcff38622.tar.gz plan9port-c26c001a1c7ea3b458cf9534908dbc8bcff38622.tar.bz2 plan9port-c26c001a1c7ea3b458cf9534908dbc8bcff38622.zip |
Allow moveplan9.sh to take argument.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/moveplan9.sh | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/moveplan9.sh b/lib/moveplan9.sh index c34b7257..17165af2 100644 --- a/lib/moveplan9.sh +++ b/lib/moveplan9.sh @@ -1,15 +1,27 @@ #!/bin/sh -p=`cleanname $PLAN9` -if [ X"$p" = X"" ] +case $# in +0) + old=/usr/local/plan9 + ;; +1) + old=`cleanname $1` + ;; +*) + echo 'usage: moveplan9.sh [oldpath]' 1>&2 + exit 1 +fi + +new=`cleanname $PLAN9` +if [ X"$new" = X"" ] then echo cleanname failed 1>&2 - exit 1 + exit 2 fi cd $PLAN9 echo " - X ,s;/usr/local/plan9($|/|});$p\\1;g + X ,s;$old(\$|/|});$new\\1;g X/'/w q " | sam -d `cat lib/moveplan9.files` >/dev/null 2>&1 |