[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/utils splittree
From: |
Yann Dirson |
Subject: |
[Wesnoth-cvs-commits] wesnoth/utils splittree |
Date: |
Sun, 23 Jan 2005 15:39:47 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Yann Dirson <address@hidden> 05/01/23 20:39:47
Modified files:
utils : splittree
Log message:
remove empty dirs after moving installed files into zips
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/utils/splittree.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: wesnoth/utils/splittree
diff -u wesnoth/utils/splittree:1.3 wesnoth/utils/splittree:1.4
--- wesnoth/utils/splittree:1.3 Sun Jan 23 15:54:59 2005
+++ wesnoth/utils/splittree Sun Jan 23 20:39:46 2005
@@ -39,10 +39,14 @@
do
findexpr="$findexpr -o -name $d"
done
+
+ # locate files and dirs to move
+ things=$(cd $src && find $findexpr)
+
if [ "x$dst" = "x--zip" ]
then
rm -f $src/wesnoth-$p.zip
- (cd $src && zip -Drm wesnoth-$p.zip $(find $findexpr))
+ (cd $src && zip -Drm wesnoth-$p.zip $things)
else
for d in $(cd $src && find $findexpr)
do
@@ -50,4 +54,11 @@
mv $src/$d $dst/wesnoth-$p/$(dirname $d)
done
fi
+
+ # be sure there are only dirs left now
+ test -z "$(cd $src && find \( $findexpr \) -not -type d | tee /dev/stderr)"
+
+ # remove now-empty dirs
+ (cd $src && rm -rf $things)
+
done