From 1b02dc7026c63716b48e296ca3aea4daff6e0541 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 27 Dec 2011 23:39:29 +1100 Subject: [PATCH] Fix bug #376737 by adding backwards-compatibility for packages that are installed into ${PN} instead of ${CAT}/${PN}. --- sbin/webapp-cleaner | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sbin/webapp-cleaner b/sbin/webapp-cleaner index 20ca8bd..bfec623 100755 --- a/sbin/webapp-cleaner +++ b/sbin/webapp-cleaner @@ -2,6 +2,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ +ATOM= +CAT= PN= ACTION= @@ -56,12 +58,12 @@ function sanity_checks() { exit 1 fi - if [[ $(expr index "${PN}" "/") == "0" ]] ; then + if [[ "${CAT}x" == "x" || "${PN}x" == "x" ]]; then eerror "Package name must be in the form CATEGORY/PN" exit 1 fi - if [[ ! -d "${WEBAPP_DIR}/${PN}" ]]; then + if [[ ! -d "${WEBAPP_DIR}/${CAT}/${PN}" && ! -d "${WEBAPP_DIR}/${PN}" ]]; then eerror "${PN} not found" exit 1 fi @@ -133,7 +135,8 @@ function process_opts() { ACTION="help" ;; *) - PN="$1" + ATOM="${1}" + parse_atom ;; esac @@ -141,6 +144,12 @@ function process_opts() { done } +parse_atom() { + local pos=$(expr index "${ATOM}" "/") + CAT=${ATOM:0:$pos - 1} + PN=${ATOM:$pos} +} + process_opts $@ sanity_checks -- 1.7.3.4