Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=7bf037d7838d9700705f3cf69622e5c5a93998e8
commit 7bf037d7838d9700705f3cf69622e5c5a93998e8 Author: Miklos Vajna <[email protected]> Date: Thu Apr 7 22:59:51 2011 +0200 repoman clean: implement --nofdb switch diff --git a/repoman b/repoman index 33f40ef..3d0f663 100755 --- a/repoman +++ b/repoman @@ -244,39 +244,41 @@ server() shift if [ $# -lt 4 ]; then echo "Too few parameters!" - echo "usage: repoman server clean path fdb group pkg" + echo "usage: repoman server clean path fdb group pkg nofdb" return 1 fi - local path="$1" fdb="$2" group="$3" pkg="$4" + local path="$1" fdb="$2" group="$3" pkg="$4" nofdb="$5" check_absolute_path cd $path - if [ -e .git/lock ]; then - echo "Couldn't get lock." - return 1 - else - touch .git/lock - fi - for i in frugalware-* - do - cd $i - if ! _check_nobuild; then - if [ ! -e $fdb ]; then - echo "No package database to clean from!" - cd - >/dev/null - rm -f .git/lock - return 1 - else - if ! arch=$arch updatesync del $fdb $pkg; then - echo "updatesync failed!" + if [ -z "$nofdb" ]; then + if [ -e .git/lock ]; then + echo "Couldn't get lock." + return 1 + else + touch .git/lock + fi + for i in frugalware-* + do + cd $i + if ! _check_nobuild; then + if [ ! -e $fdb ]; then + echo "No package database to clean from!" + cd - >/dev/null rm -f .git/lock return 1 + else + if ! arch=$arch updatesync del $fdb $pkg; then + echo "updatesync failed!" + rm -f .git/lock + return 1 + fi fi fi - fi - genchangelog --clean $pkg - cd - >/dev/null - done - rm .git/lock + genchangelog --clean $pkg + cd - >/dev/null + done + rm .git/lock + fi if [ -d source/$group/$pkg ]; then if [ ! -f source/$group/$pkg/FrugalBuild ]; then rm -rfv source/$group/$pkg @@ -458,11 +460,16 @@ clean() check_sudo fdb=$(eval "echo \$${reponame}_fdb") [ -z "$fdb" ] && fdb="$reponame.fdb" + nofdb= + if [ "$1" == "--nofdb" ]; then + shift + nofdb=t + fi for i in $* do msg "Cleaning up $i" split_group_pkg $i - if ! _ssh "clean '$path' '$fdb' '$group' '$pkg'"; then + if ! _ssh "clean '$path' '$fdb' '$group' '$pkg' '$nofdb'"; then return 1 fi done diff --git a/repoman.txt b/repoman.txt index 9f7291b..429624e 100644 --- a/repoman.txt +++ b/repoman.txt @@ -402,9 +402,11 @@ $ repoman fpmmerge flac113 == COMMANDS -c|clean <package>:: +c|clean [--nofdb] <package>:: - Removes the package from the package database. + Removes the package from the package database. The optional `--nofdb` + parameter means that only the source directory will be removed, but the + fdb database will be left untouched. cl|changelog [<group>/]<package>:: _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
