[Debian-NP-Commits] r278 - people/vagrant/simple-cdd

Vagrant Cascadian debian-np-devel@lists.alioth.debian.org
Sun, 28 Nov 2004 11:12:03 -0700


Author: vagrant-guest
Date: Sun Nov 28 11:10:51 2004
New Revision: 278

Modified:
   people/vagrant/simple-cdd/build-simple-cdd
Log:
make sure files exist before attempting to move or copy them.


Modified: people/vagrant/simple-cdd/build-simple-cdd
==============================================================================
--- people/vagrant/simple-cdd/build-simple-cdd	(original)
+++ people/vagrant/simple-cdd/build-simple-cdd	Sun Nov 28 11:10:51 2004
@@ -31,7 +31,7 @@
 done
 
 if [ -n "$BASE_INCLUDE" ] && [ -n "$base_include_packages" ]; then
-  mv -f $BASE_INCLUDE $BASE_INCLUDE.bak
+  test -r "$BASE_INCLUDE" && mv -f $BASE_INCLUDE $BASE_INCLUDE.bak
   echo "#ifdef ARCH_$ARCH" > $BASE_INCLUDE
   for p in $base_include_packages ; do
     echo $p >> $BASE_INCLUDE
@@ -51,12 +51,12 @@
   echo "WARNING: debootstrap not found, skipping..."
 fi
 
-mv -f $TASK.cache $TASK.cache.bak
+test -r "$TASK.cache" && mv -f $TASK.cache $TASK.cache.bak
 for p in $all_packages ; do
   echo $p >> $TASK.cache
 done
 
-mv -f $TASK $TASK.bak
+test -r "$TASK" && mv -f $TASK $TASK.bak
 for i in $includes ; do
   echo '#include <'"$i"'>' >> $TASK
 done
@@ -65,7 +65,7 @@
 
 if [ -z "$do_mirror" ] || [ "$do_mirror" = "true" ] ; then
   debpartial_conf=debpartial-mirror.conf
-  cp -f $debpartial_conf $debpartial_conf.bak
+  test -r "$debpartial_conf" && cp -f $debpartial_conf $debpartial_conf.bak
 
   # generate debpartial-mirror.conf
 
@@ -142,7 +142,7 @@
 all_extras="$all_extras $package_files $preseed_files"
 # copy files to extras directory
 for file in $all_extras ; do
-  cp -f $file $extras_dir/
+  test -r "$file" && cp -f $file $extras_dir/
 done
 
 # populate the choices file.