diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-12-31 14:35:11 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-12-31 14:35:11 -0500 |
commit | 99d6b1d0f1f88bf30b75243225cd461afb565f6b (patch) | |
tree | 82a5239fce117f50bd4d80365cb21bd6e5efe409 /db-remove | |
parent | ffe9ada1c43d5fd779863c4be2782f7b690a5fbc (diff) | |
parent | e6294556d3197b7d87f7659355d0e189fad613d6 (diff) |
Merge branch 'cleanup' into master-merge
Conflicts:
config
cron-jobs/sourceballs
db-functions
db-move
db-remove
db-update
Diffstat (limited to 'db-remove')
-rwxr-xr-x | db-remove | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -1,10 +1,10 @@ #!/bin/bash -. "$(dirname $0)/db-functions" -. "$(dirname $0)/config" +. "$(dirname "$(readlink -e "$0")")/config" +. "$(dirname "$(readlink -e "$0")")/db-functions" if [ $# -lt 3 ]; then - msg "usage: $(basename $0) <repo> <arch> <pkgname|pkgbase> ..." + msg "usage: ${0##*/} <repo> <arch> <pkgname|pkgbase> ..." exit 1 fi @@ -17,30 +17,31 @@ if ! check_repo_permission $repo; then fi if [ "$arch" == "any" ]; then - tarches=(${ARCHES[@]}) + tarches=("${ARCHES[@]}") else tarches=("$arch") fi -for tarch in ${tarches[@]}; do +for tarch in "${tarches[@]}"; do repo_lock $repo $tarch || exit 1 done 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[@]})) + path="$(xbs releasepath "$pkgbase" "$repo" "$arch")" + if [ -d "$path" ]; then + remove_pkgs+=($(. "$path/PKGBUILD"; echo ${pkgname[@]})) + xbs unrelease "$pkgbase" "$repo" "$arch" else - warning "$pkgbase not found in $svnrepo" + warning "$pkgbase not found in $repo-$arch" 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 + remove_pkgs+=($pkgbase) fi done -for tarch in ${tarches[@]}; do - arch_repo_remove "${repo}" "${tarch}" ${remove_pkgs[@]} +for tarch in "${tarches[@]}"; do + arch_repo_remove "${repo}" "${tarch}" "${remove_pkgs[@]}" repo_unlock $repo $tarch done |