public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/webapp-config:master commit in: sbin/
Date: Thu, 29 Dec 2011 21:31:30 +0000 (UTC)	[thread overview]
Message-ID: <37751374b477b36ebcb600fa430c1379429a63e0.blueness@gentoo> (raw)

commit:     37751374b477b36ebcb600fa430c1379429a63e0
Author:     Michael (kensington) <gentoo <AT> scribeofthenile <DOT> com>
AuthorDate: Thu Dec 29 21:29:02 2011 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 21:30:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=37751374

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 <AT> gmx.net>
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
X-Gentoo-Bug: 376737
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=376737

---
 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



             reply	other threads:[~2011-12-29 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 21:31 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-11 23:17 [gentoo-commits] proj/webapp-config:master commit in: sbin/ Devan Franchini
2015-07-03  2:41 Devan Franchini
2015-07-03  4:55 [gentoo-commits] proj/webapp-config:1.54 " Devan Franchini
2015-07-03  4:50 ` [gentoo-commits] proj/webapp-config:master " Devan Franchini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37751374b477b36ebcb600fa430c1379429a63e0.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox