diff options
Diffstat (limited to 'db-remove')
-rwxr-xr-x | db-remove | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -3,14 +3,14 @@ . "$(dirname $0)/db-functions" . "$(dirname $0)/config" -if [ $# -ne 3 ]; then - msg "usage: $(basename $0) <pkgname|pkgbase> <repo> <arch>" +if [ $# -lt 3 ]; then + msg "usage: $(basename $0) <repo> <arch> <pkgname|pkgbase> ..." exit 1 fi -pkgbase="$1" -repo="$2" -arch="$3" +repo="$1" +arch="$2" +pkgbases=(${@:3}) if ! check_repo_permission $repo; then die "You don't have permission to remove packages from ${repo}" @@ -26,18 +26,21 @@ for tarch in ${tarches[@]}; do repo_lock $repo $tarch || exit 1 done -msg "Removing $pkgbase from [$repo]..." - -if [ -d "${SVNREPO}/$repo/$pkgbase" ]; then - pkgnames=($(. "${SVNREPO}/$repo/$pkgbase/PKGBUILD"; echo ${pkgname[@]})) -else - warning "$pkgbase not found in $repo" - warning "Removing only $pkgbase from the repo" - warning "If it was a split package you have to remove the others yourself!" - pkgnames=($pkgbase) -fi +remove_pkgs=() +for pkgbase in ${pkgbases[@]}; do + msg "Removing $pkgbase from [$repo]..." + + if [ -d "${SVNREPO}/$repo/$pkgbase" ]; then + remove_pkgs=($(. "${SVNREPO}/$repo/$pkgbase/PKGBUILD"; echo ${pkgname[@]})) + else + warning "$pkgbase not found in $svnrepo" + warning "Removing only $pkgbase from the repo" + warning "If it was a split package you have to remove the others yourself!" + remove_pkgs[${#remove_pkgs[*]}]=$pkgbase + fi +done for tarch in ${tarches[@]}; do - arch_repo_remove "${repo}" "${tarch}" ${pkgnames[@]} + arch_repo_remove "${repo}" "${tarch}" ${remove_pkgs[@]} repo_unlock $repo $tarch done |