summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael (kensington) <gentoo@scribeofthenile.com>2011-12-29 16:29:02 -0500
committerAnthony G. Basile <blueness@gentoo.org>2011-12-29 16:30:30 -0500
commit37751374b477b36ebcb600fa430c1379429a63e0 (patch)
tree69235ac09261fe6735e91330c987b86d047c23e0
parentUpdate the docs for --lui (diff)
downloadwebapp-config-37751374b477b36ebcb600fa430c1379429a63e0.tar.gz
webapp-config-37751374b477b36ebcb600fa430c1379429a63e0.tar.bz2
webapp-config-37751374b477b36ebcb600fa430c1379429a63e0.zip
Backward compat for webapp-cleaner
Patch webapp-cleaner to check ${CAT}/${PN} first, but if that does not exist, fall back to just ${PN}. Reported-By: Marc Richter <richter_marc@gmx.net> Signed-off-by: Anthony G. Basile <blueness@gentoo.org> X-Gentoo-Bug: 376737 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=376737
-rwxr-xr-xsbin/webapp-cleaner15
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