[Fai-commit] r6065 - branches/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Sat Sep 18 07:13:51 UTC 2010
Author: mt
Date: 2010-09-18 07:13:40 +0000 (Sat, 18 Sep 2010)
New Revision: 6065
Added:
branches/experimental/patches/ftar_rm-fix
Modified:
branches/experimental/patches/series
Log:
Added ftar rm fix
Added: branches/experimental/patches/ftar_rm-fix
===================================================================
--- branches/experimental/patches/ftar_rm-fix (rev 0)
+++ branches/experimental/patches/ftar_rm-fix 2010-09-18 07:13:40 UTC (rev 6065)
@@ -0,0 +1,41 @@
+2010-09-18 Michael Tautschnig <mt at debian.org>
+
+ * ftar: Only remove files if a matching class/archive file is found.
+Index: trunk/bin/ftar
+===================================================================
+--- trunk.orig/bin/ftar
++++ trunk/bin/ftar
+@@ -42,6 +42,18 @@
+ local file=$1
+ local catname=$2
+
++ if [ $deletefiles -eq 1 ] ; then
++ cd $target/$dir && rm -f .* * 2>/dev/null
++ deletefiles=0
++ fi
++
++ if [ $removedir -eq 1 ]; then
++ cd $target/$dir
++ [ $PWD = "/" ] && die 3 "ftar WARNING: Will not do recursive removal of directory /"
++ rm -rf .* * 2>/dev/null
++ removedir=0
++ fi
++
+ echo "ftar: extracting $file to $target/$dir"
+ $catname $file | tar -C $target/$dir $vflag -xf -
+ tardone=1
+@@ -114,14 +126,6 @@
+ fpath=$source/$dir
+ [ -d $fpath ] || die 1 "No directory $fpath"
+
+-[ $deletefiles -eq 1 ] && cd $target/$dir && rm -f .* * 2>/dev/null
+-
+-if [ $removedir -eq 1 ]; then
+- cd $target/$dir
+- [ $PWD = "/" ] && die 3 "ftar WARNING: Will not do recursive removal of directory /"
+- rm -rf .* * 2>/dev/null
+-fi
+-
+ for c in $revclasses ; do
+ # what if a directory exists which is equal to the hostname or a classname?
+ [ -f $fpath/$c.tgz ] && extract $fpath/$c.tgz zcat
Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series 2010-09-18 07:01:11 UTC (rev 6064)
+++ branches/experimental/patches/series 2010-09-18 07:13:40 UTC (rev 6065)
@@ -13,3 +13,4 @@
setup-storage_gpt-bios-fix
setup-storage_user-100-percent
bugfix-498412
+ftar_rm-fix
More information about the Fai-commit
mailing list