From 5c7220a4aa370d1f726eb27d99d8f9294646433d Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 19 Dec 2011 14:40:07 +0100 Subject: Avoid calls to basename --- db-remove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'db-remove') diff --git a/db-remove b/db-remove index a3e03e6..512ce51 100755 --- a/db-remove +++ b/db-remove @@ -4,7 +4,7 @@ . "$(dirname $0)/config" if [ $# -lt 3 ]; then - msg "usage: $(basename $0) ..." + msg "usage: ${0##*/} ..." exit 1 fi @@ -37,7 +37,7 @@ for pkgbase in ${pkgbases[@]}; do if [ -d "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" ]; then remove_pkgs=(${remove_pkgs[@]} $(. "${WORKDIR}/svn/$pkgbase/repos/$svnrepo/PKGBUILD"; echo ${pkgname[@]})) /usr/bin/svn rm --force -q "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" - /usr/bin/svn commit -q "${WORKDIR}/svn/$pkgbase" -m "$(basename $0): $pkgbase removed by $(id -un)" + /usr/bin/svn commit -q "${WORKDIR}/svn/$pkgbase" -m "${0##*/}: $pkgbase removed by $(id -un)" else warning "$pkgbase not found in $svnrepo" warning "Removing only $pkgbase from the repo" -- cgit v1.2.3-2-g168b From 33cfe12c34747bd52e2730e45566e5b21cd76153 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 29 Apr 2012 10:10:43 +0200 Subject: Source the config before the functions as the latter references the former --- db-remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db-remove') diff --git a/db-remove b/db-remove index 512ce51..da32c78 100755 --- a/db-remove +++ b/db-remove @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname $0)/db-functions" . "$(dirname $0)/config" +. "$(dirname $0)/db-functions" if [ $# -lt 3 ]; then msg "usage: ${0##*/} ..." -- cgit v1.2.3-2-g168b From b2952784db9995ecc21d3a770530a19394234d3b Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Oct 2012 14:32:39 +0200 Subject: Add the possibility to run all svn commands with a different user * A SVNUSER can be configured in the config file * This user needs to be able to call svn without a password --- db-remove | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'db-remove') diff --git a/db-remove b/db-remove index da32c78..25cb9a7 100755 --- a/db-remove +++ b/db-remove @@ -32,12 +32,12 @@ done remove_pkgs=() for pkgbase in ${pkgbases[@]}; do msg "Removing $pkgbase from [$repo]..." - /usr/bin/svn checkout -q "${SVNREPO}/${pkgbase}" "${WORKDIR}/svn/${pkgbase}" >/dev/null + arch_svn checkout -q "${SVNREPO}/${pkgbase}" "${WORKDIR}/svn/${pkgbase}" >/dev/null if [ -d "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" ]; then remove_pkgs=(${remove_pkgs[@]} $(. "${WORKDIR}/svn/$pkgbase/repos/$svnrepo/PKGBUILD"; echo ${pkgname[@]})) - /usr/bin/svn rm --force -q "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" - /usr/bin/svn commit -q "${WORKDIR}/svn/$pkgbase" -m "${0##*/}: $pkgbase removed by $(id -un)" + arch_svn rm --force -q "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" + arch_svn commit -q "${WORKDIR}/svn/$pkgbase" -m "${0##*/}: $pkgbase removed by $(id -un)" else warning "$pkgbase not found in $svnrepo" warning "Removing only $pkgbase from the repo" -- cgit v1.2.3-2-g168b From 33b8cb611363102e23972cf3914a03d65cb3cad8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 17 Jun 2013 23:59:15 -0600 Subject: use xbs, not svn --- db-remove | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'db-remove') diff --git a/db-remove b/db-remove index 25cb9a7..e632c47 100755 --- a/db-remove +++ b/db-remove @@ -12,9 +12,6 @@ repo="$1" arch="$2" pkgbases=(${@:3}) -ftppath="$FTP_BASE/$repo/os" -svnrepo="$repo-$arch" - if ! check_repo_permission $repo; then die "You don't have permission to remove packages from ${repo}" fi @@ -32,14 +29,12 @@ done remove_pkgs=() for pkgbase in ${pkgbases[@]}; do msg "Removing $pkgbase from [$repo]..." - arch_svn checkout -q "${SVNREPO}/${pkgbase}" "${WORKDIR}/svn/${pkgbase}" >/dev/null - - if [ -d "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" ]; then - remove_pkgs=(${remove_pkgs[@]} $(. "${WORKDIR}/svn/$pkgbase/repos/$svnrepo/PKGBUILD"; echo ${pkgname[@]})) - arch_svn rm --force -q "${WORKDIR}/svn/$pkgbase/repos/$svnrepo" - arch_svn commit -q "${WORKDIR}/svn/$pkgbase" -m "${0##*/}: $pkgbase removed by $(id -un)" + 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 -- cgit v1.2.3-2-g168b From 761b56dcffedc6e484d38c74267810e491add951 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 16 Jun 2013 22:06:51 -0600 Subject: touch up --- db-remove | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'db-remove') diff --git a/db-remove b/db-remove index e632c47..ccab5ea 100755 --- a/db-remove +++ b/db-remove @@ -17,12 +17,12 @@ 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 @@ -37,11 +37,11 @@ for pkgbase in ${pkgbases[@]}; do 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 -- cgit v1.2.3-2-g168b From e6294556d3197b7d87f7659355d0e189fad613d6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 8 Dec 2013 17:33:25 -0500 Subject: `readlink -e` all "$0"s --- db-remove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'db-remove') diff --git a/db-remove b/db-remove index ccab5ea..993574f 100755 --- a/db-remove +++ b/db-remove @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname $0)/config" -. "$(dirname $0)/db-functions" +. "$(dirname "$(readlink -e "$0")")/config" +. "$(dirname "$(readlink -e "$0")")/db-functions" if [ $# -lt 3 ]; then msg "usage: ${0##*/} ..." -- cgit v1.2.3-2-g168b