Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/webapp-config:master commit in: sbin/
Date: Thu, 29 Dec 2011 21:31:39
Message-Id: 37751374b477b36ebcb600fa430c1379429a63e0.blueness@gentoo
1 commit: 37751374b477b36ebcb600fa430c1379429a63e0
2 Author: Michael (kensington) <gentoo <AT> scribeofthenile <DOT> com>
3 AuthorDate: Thu Dec 29 21:29:02 2011 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 29 21:30:30 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=37751374
7
8 Backward compat for webapp-cleaner
9
10 Patch webapp-cleaner to check ${CAT}/${PN} first, but if that
11 does not exist, fall back to just ${PN}.
12
13 Reported-By: Marc Richter <richter_marc <AT> gmx.net>
14 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
15 X-Gentoo-Bug: 376737
16 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=376737
17
18 ---
19 sbin/webapp-cleaner | 15 ++++++++++++---
20 1 files changed, 12 insertions(+), 3 deletions(-)
21
22 diff --git a/sbin/webapp-cleaner b/sbin/webapp-cleaner
23 index 20ca8bd..bfec623 100755
24 --- a/sbin/webapp-cleaner
25 +++ b/sbin/webapp-cleaner
26 @@ -2,6 +2,8 @@
27 # Distributed under the terms of the GNU General Public License v2
28 # $Header: $
29
30 +ATOM=
31 +CAT=
32 PN=
33
34 ACTION=
35 @@ -56,12 +58,12 @@ function sanity_checks() {
36 exit 1
37 fi
38
39 - if [[ $(expr index "${PN}" "/") == "0" ]] ; then
40 + if [[ "${CAT}x" == "x" || "${PN}x" == "x" ]]; then
41 eerror "Package name must be in the form CATEGORY/PN"
42 exit 1
43 fi
44
45 - if [[ ! -d "${WEBAPP_DIR}/${PN}" ]]; then
46 + if [[ ! -d "${WEBAPP_DIR}/${CAT}/${PN}" && ! -d "${WEBAPP_DIR}/${PN}" ]]; then
47 eerror "${PN} not found"
48 exit 1
49 fi
50 @@ -133,7 +135,8 @@ function process_opts() {
51 ACTION="help"
52 ;;
53 *)
54 - PN="$1"
55 + ATOM="${1}"
56 + parse_atom
57 ;;
58 esac
59
60 @@ -141,6 +144,12 @@ function process_opts() {
61 done
62 }
63
64 +parse_atom() {
65 + local pos=$(expr index "${ATOM}" "/")
66 + CAT=${ATOM:0:$pos - 1}
67 + PN=${ATOM:$pos}
68 +}
69 +
70 process_opts $@
71
72 sanity_checks