Added ability to revert to old modules for make revert.
authorJohn H Terpstra <jht@dv1000.dyn.terpstra-world.org>
Mon, 20 Apr 2009 15:10:20 +0000 (10:10 -0500)
committerJohn H Terpstra <jht@dv1000.dyn.terpstra-world.org>
Mon, 20 Apr 2009 15:13:10 +0000 (10:13 -0500)
source3/script/installmodules.sh

index f70db003ede38c8cd4b22edcbc033d991779b5fa..127091d8088e27b9f2ab35236fa85a6fc76cc5b1 100755 (executable)
@@ -29,6 +29,11 @@ mtype=`basename $LIBDIR`
 for p in $*; do
  p2=`basename $p`
  name=`echo $p2 | sed -es/${mtype}_//`
 for p in $*; do
  p2=`basename $p`
  name=`echo $p2 | sed -es/${mtype}_//`
+ echo Preserving old module as $DESTDIR/$LIBDIR/$name.old
+ if [ -f $DESTDIR/$LIBDIR/$name ]; then
+   rm -f $DESTDIR/$LIBDIR/$name.old
+   mv $DESTDIR/$LIBDIR/$name $DESTDIR/$LIBDIR/$name.old
+ fi
  echo Installing $p as $DESTDIR/$LIBDIR/$name
  cp -f $p $DESTDIR/$LIBDIR/$name
  chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$name
  echo Installing $p as $DESTDIR/$LIBDIR/$name
  cp -f $p $DESTDIR/$LIBDIR/$name
  chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$name