summaryrefslogtreecommitdiff
path: root/db-remove
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-01-08 15:17:16 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-01-08 15:17:16 -0300
commit341400146cbde0dbf05eaa8aec531f5286fd91fb (patch)
treeaef2a4b704731ee405345bc8e22dbcdad2056cb5 /db-remove
parenta749983e8f2becf7c5427b0e5c449d457afbe385 (diff)
parenta8b219b325cd642a781a64d8e08a0e66d25c1b44 (diff)
Merge branch 'master' of https://projects.archlinux.org/git/dbscripts
Conflicts: db-remove
Diffstat (limited to 'db-remove')
-rwxr-xr-xdb-remove35
1 files changed, 19 insertions, 16 deletions
diff --git a/db-remove b/db-remove
index ccfeb36..a71bbab 100755
--- a/db-remove
+++ b/db-remove
@@ -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