2005-01-07 19:10:22 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2005-09-13 00:22:50 +00:00
|
|
|
case $# in
|
|
|
|
0)
|
|
|
|
old=/usr/local/plan9
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
old=`cleanname $1`
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo 'usage: moveplan9.sh [oldpath]' 1>&2
|
|
|
|
exit 1
|
2005-09-13 02:39:54 +00:00
|
|
|
esac
|
2005-09-13 00:22:50 +00:00
|
|
|
|
2011-06-02 13:28:23 +00:00
|
|
|
new=`cleanname $PLAN9_TARGET`
|
|
|
|
|
2005-09-13 00:22:50 +00:00
|
|
|
if [ X"$new" = X"" ]
|
2005-07-22 18:45:52 +00:00
|
|
|
then
|
|
|
|
echo cleanname failed 1>&2
|
2005-09-13 00:22:50 +00:00
|
|
|
exit 2
|
2005-07-22 18:45:52 +00:00
|
|
|
fi
|
|
|
|
|
2005-01-07 19:10:22 +00:00
|
|
|
cd $PLAN9
|
2006-12-10 00:19:46 +00:00
|
|
|
# Avoid broken builtin echo in dash that turns \1 into ^A
|
|
|
|
`which echo` '
|
2006-12-09 22:48:50 +00:00
|
|
|
X ,s;'$old'($|/|});'$new'\1;g
|
|
|
|
X/'"'"'/w
|
2005-01-07 19:10:22 +00:00
|
|
|
q
|
2006-12-09 22:48:50 +00:00
|
|
|
' | sam -d `cat lib/moveplan9.files` >/dev/null 2>&1
|
2005-01-07 19:10:22 +00:00
|
|
|
|