diff options
-rw-r--r-- | trunk/doc/CHANGELOG | 3 | ||||
-rw-r--r-- | trunk/lib/common.sh | 22 | ||||
-rw-r--r-- | trunk/src/createpkg | 2 |
3 files changed, 25 insertions, 2 deletions
diff --git a/trunk/doc/CHANGELOG b/trunk/doc/CHANGELOG index e77f73d..c3a5e3f 100644 --- a/trunk/doc/CHANGELOG +++ b/trunk/doc/CHANGELOG @@ -7,7 +7,8 @@ simplepkg changelog - common.sh: - other minor changes - repository metainformationg is now added at svn control if applicable - - new functions su_svn, chown_svn, chgrp_svn, regexp_slash, default_distro and svn_add + - new functions svn_remove_empty_folders, svn_del, su_svn, chown_svn, chgrp_svn, + regexp_slash, default_distro and svn_add - new config parameter "TMP" - renamed function use_svn to templates_under_svn - simplaret: simplaret_search_and_process_patch do not donwload a package with the same diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 368cbd1..27d329f 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -589,7 +589,7 @@ function svn_del { chown_svn $file && chgrp_svn $file ( cd $folder && su_svn del --force `basename $file` ) else - rm -f $file + rm -rf $file fi } @@ -671,6 +671,26 @@ function chgrp_svn { } +function svn_remove_empty_folders { + + if [ -z "$1" ]; then + return 1 + fi + + main_folder="$1" + search="`find $main_folder -type d | grep -v '/.svn' | sed '1d'`" + results="`echo $search | wc -l`" + + if [ "$results" -eq "0" ]; then + svn_del $folder + else + for folder in $search; do + svn_remove_empty_folders $folder + done + fi + +} + # ----------------------------------------------- # update jail functions # ----------------------------------------------- diff --git a/trunk/src/createpkg b/trunk/src/createpkg index ce9c3a5..bd2a2ea 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -578,6 +578,8 @@ if [ $REMOVE_OLD_PACKAGE -eq $on ]; then fi done + svn_remove_empty_folders . + cd $cwd else |