From c41f37b657bca5ed38947ab2084216d5ed7729ee Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Fri, 11 May 2007 17:29:57 +1000 Subject: [PATCH] Better cleanup of CVS and build files and directories, improve tar and ssh commands r1958 | dcl | 2007-05-11 17:29:57 +1000 (Fri, 11 May 2007) | 2 lines --- site_ansto/instrument/deploySICS.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/site_ansto/instrument/deploySICS.sh b/site_ansto/instrument/deploySICS.sh index 980cf3b0..233d2776 100755 --- a/site_ansto/instrument/deploySICS.sh +++ b/site_ansto/instrument/deploySICS.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $Revision: 1.23 $ -# $Date: 2007-03-30 03:32:19 $ +# $Revision: 1.24 $ +# $Date: 2007-05-11 07:29:57 $ # Author: Ferdi Franceschini (ffr@ansto.gov.au) # Last revision by $Author: dcl $ @@ -151,8 +151,10 @@ echo "Deploying $INSTRUMENT to $DESTHOST:$DESTDIR" if [ "$DESTHOST" = "localhost" ] then EXTRACT="tar vxzp -C /" +EXTRACT_NODEPLOY="tar vxzp -C /" else EXTRACT="ssh $DESTHOST sg sics -c tar\ vxzp\ -C\ /" +EXTRACT_NODEPLOY="ssh $DESTHOST sg sics -c \"tar\ vxzp\ -C\ /\"" fi if [ ! -e $SRCDIR/MANIFEST.TXT ] @@ -189,10 +191,16 @@ echo -e "The following files were installed by $USER\n" >> $TEMPDIR/$DESTDIR/ser cat $SRCDIR/MANIFEST.TXT $SRCDIR/$INSTSRC/MANIFEST.TXT >> $TEMPDIR/$DESTDIR/server/MANIFEST.TXT cd $TEMPDIR -# remove any CVS directories and set modes for files and directories -rm -fr $(find $TEMPDIR/$DESTDIR -name CVS) +# remove any CVS directories +rm -rf $(find $TARDIR -type d -name CVS) +# remove any temporary editor files +find $TARDIR -type f -name .\*.sw\? -exec rm {} \; +# remove any editor backup files directories +find $TARDIR -type f -name \*~ -exec rm {} \; +# set modes for files find $TARDIR -type f -exec chmod u-s,g-x+wr,o-wx+r {} \; find $TARDIR -type f -perm -100 -exec chmod go+x {} \; +# set modes for directories find $TARDIR -type d -exec chmod u+rwx,g+rwxs,o-w+rx {} \; # Strip leading / from DESTDIR and extract to destination @@ -200,5 +208,5 @@ if [ "$DEPLOY" = "YES" ] then tar -cz $TARDIR | $EXTRACT else - echo "tar -cz $TARDIR | $EXTRACT" + echo "tar -cz -C $TEMPDIR $TARDIR | $EXTRACT_NODEPLOY" fi