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 1R3u0V-0007CB-LH for garchives@archives.gentoo.org; Wed, 14 Sep 2011 18:16:24 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6FFBC21C041; Wed, 14 Sep 2011 18:16:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2C44221C041 for ; Wed, 14 Sep 2011 18:16:15 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A19361B404B for ; Wed, 14 Sep 2011 18:16:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 08BD880042 for ; Wed, 14 Sep 2011 18:16:14 +0000 (UTC) From: "Maxim Koltsov" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Maxim Koltsov" Message-ID: <8a237dcd19a18cb052730d59ba320eb9f8bc16a5.maksbotan@gentoo> Subject: [gentoo-commits] dev/maksbotan:master commit in: Documentation/ X-VCS-Repository: dev/maksbotan X-VCS-Files: Documentation/leech_bump.sh X-VCS-Directories: Documentation/ X-VCS-Committer: maksbotan X-VCS-Committer-Name: Maxim Koltsov X-VCS-Revision: 8a237dcd19a18cb052730d59ba320eb9f8bc16a5 Date: Wed, 14 Sep 2011 18:16:14 +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: X-Archives-Hash: 6c7b4d2af8e444e30958b269f4f9982c commit: 8a237dcd19a18cb052730d59ba320eb9f8bc16a5 Author: Maxim Koltsov gentoo org> AuthorDate: Wed Sep 14 17:07:50 2011 +0000 Commit: Maxim Koltsov gentoo org> CommitDate: Wed Sep 14 18:13:00 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/maksbotan.git;= a=3Dcommit;h=3D8a237dcd Fixes inspired by mgorny's advices --- Documentation/leech_bump.sh | 79 ++++++++++++++++++++++++-------------= ----- 1 files changed, 45 insertions(+), 34 deletions(-) diff --git a/Documentation/leech_bump.sh b/Documentation/leech_bump.sh index 9634812..9b93253 100755 --- a/Documentation/leech_bump.sh +++ b/Documentation/leech_bump.sh @@ -1,26 +1,30 @@ -#!/bin/sh +#!/bin/bash =20 . /etc/init.d/functions.sh =20 -if [[ -z "$1" ]] || [[ -z $2 ]]; then +if [[ ${#} -lt 2 && ${1} !=3D "repoman" ]]; then eerror "Not enough arguments" - einfo "Usage: $0 mode version|message" - einfo "Supported methods are:" + einfo "Usage: ${0} mode version|message" + einfo "Supported modes are:" einfo " - bump" einfo " - commit" einfo " - repoman" exit 1 fi -if [[ "$1" !=3D "bump" ]] && [[ $1 !=3D "commit" ]] && [[ $1 !=3D "repom= an" ]]; then - eerror "Unknown mode $1" - exit 1 -fi =20 -mode=3D$1 -version=3D$2 +case "${1}" in + bump|commit|repoman) ;; + *) + eerror "Unknown mode ${1}" + exit 1 + ;; +esac + +mode=3D${1} +version=3D${2} =20 #checking whether we are in portage tree or overlay -if ! [[ -e ./profiles/repo_name ]]; then +if [[ ! -e ./profiles/repo_name ]]; then eerror "$(pwd) is not valid Gentoo Repository" eerror "Please cd to valid Gentoo repository before running $0" exit 1 @@ -35,52 +39,59 @@ for atom in */*; do if [[ $CATEGORY =3D=3D "eclass" ]]; then continue fi - if ! [[ $atom =3D~ leechcraft-* ]]; then + if [[ ${PN} !=3D leechcraft-* ]]; then continue fi - einfo "Going to $atom" + einfo "Going to ${atom}" eindent - cd $atom + cd ${atom} =20 - if [[ $mode =3D=3D "bump" ]]; then - einfo "Bumping $atom to $version" + case ${mode} in + bump) + einfo "Bumping ${atom} to ${version}" =20 - if [[ -e $PN-$version.ebuild ]]; then - ewarn "$atom seems to be already bumped to $version, skippin= g work" + if [[ -e ${PN}-${version}.ebuild ]]; then + ewarn "${atom} seems to be already bumped to ${version}, ski= pping work" cd - > /dev/null eoutdent continue fi =20 - ebegin "Copying $PN-9999.ebuild to $PN-$version.ebuild" - cp $PN-{9999,$version}.ebuild + ebegin "Copying ${PN}-9999.ebuild to ${PN}-${version}.ebuild" + cp ${PN}-{9999,${version}}.ebuild eend $? =20 - ebegin "Setting keywords on $PN-$version.ebuild" - ekeyword ~amd64 ~x86 $PN-$version.ebuild + ebegin "Setting keywords on ${PN}-${version}.ebuild" + ekeyword ~amd64 ~x86 ${PN}-${version}.ebuild eend $? =20 - ebegin "Running repoman manifest on $atom" + ebegin "Running repoman manifest on ${atom}" repoman manifest eend $? =20 - ebegin "Running cvs add $PN-$version.ebuild" - cvs add $PN-$version.ebuild + ebegin "Running cvs add ${PN}-${version}.ebuild" + cvs add ${PN}-${version}.ebuild eend $? =20 - ebegin "Generating ChangeLog for $atom" - echangelog "Bump $atom to $version, thanks to 0xd34df00d" + ebegin "Generating ChangeLog for ${atom}" + echangelog "Bump ${atom} to ${version}, thanks to 0xd34df00d" eend $? - elif [[ $mode =3D=3D "commit" ]]; then - einfo "Commiting $atom with message \"$version\"" =20 - ebegin "Running repoman commit -m \"$version\"" - repoman commit -m "$version" + ;; + commit) + einfo "Commiting ${atom} with message \"${version}\"" + + ebegin "Running repoman commit -m \"${version}\"" + repoman commit -m "${version}" eend $? - else - einfo "Running repoman in $atom" + + ;; + repoman) + einfo "Running repoman in ${atom}" repoman fix - fi + + ;; + esac =20 =20 cd - > /dev/null