From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RgNZb-0007He-6x for garchives@archives.gentoo.org; Thu, 29 Dec 2011 21:31:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 59D8521C01F; Thu, 29 Dec 2011 21:31:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 22B9B21C01F for ; Thu, 29 Dec 2011 21:31:31 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9ED571B4087 for ; Thu, 29 Dec 2011 21:31:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 192AD80043 for ; Thu, 29 Dec 2011 21:31:30 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <37751374b477b36ebcb600fa430c1379429a63e0.blueness@gentoo> Subject: [gentoo-commits] proj/webapp-config:master commit in: sbin/ X-VCS-Repository: proj/webapp-config X-VCS-Files: sbin/webapp-cleaner X-VCS-Directories: sbin/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 37751374b477b36ebcb600fa430c1379429a63e0 Date: Thu, 29 Dec 2011 21:31:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 13de7333-9a8b-47f7-baea-abc8937828a4 X-Archives-Hash: f00b6db4b02abb194986f0988a4f4c28 commit: 37751374b477b36ebcb600fa430c1379429a63e0 Author: Michael (kensington) scribeofthenile com> AuthorDate: Thu Dec 29 21:29:02 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Thu Dec 29 21:30:30 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/webapp-config= .git;a=3Dcommit;h=3D37751374 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 gmx.net> Signed-off-by: Anthony G. Basile gentoo.org> X-Gentoo-Bug: 376737 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=3D376737 --- 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: $ =20 +ATOM=3D +CAT=3D PN=3D =20 ACTION=3D @@ -56,12 +58,12 @@ function sanity_checks() { exit 1 fi =20 - if [[ $(expr index "${PN}" "/") =3D=3D "0" ]] ; then + if [[ "${CAT}x" =3D=3D "x" || "${PN}x" =3D=3D "x" ]]; then eerror "Package name must be in the form CATEGORY/PN" exit 1 fi =20 - 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=3D"help" ;; *) - PN=3D"$1" + ATOM=3D"${1}" + parse_atom ;; esac =20 @@ -141,6 +144,12 @@ function process_opts() { done } =20 +parse_atom() { + local pos=3D$(expr index "${ATOM}" "/") + CAT=3D${ATOM:0:$pos - 1} + PN=3D${ATOM:$pos} +} + process_opts $@ =20 sanity_checks