public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Maxim Koltsov" <maksbotan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] dev/maksbotan:master commit in: Documentation/
Date: Wed, 14 Sep 2011 18:16:14 +0000 (UTC)	[thread overview]
Message-ID: <8a237dcd19a18cb052730d59ba320eb9f8bc16a5.maksbotan@gentoo> (raw)

commit:     8a237dcd19a18cb052730d59ba320eb9f8bc16a5
Author:     Maxim Koltsov <maksbotan <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 17:07:50 2011 +0000
Commit:     Maxim Koltsov <maksbotan <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 18:13:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/maksbotan.git;a=commit;h=8a237dcd

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
 
 . /etc/init.d/functions.sh
 
-if [[ -z "$1" ]] || [[ -z $2 ]]; then
+if [[ ${#} -lt 2 && ${1} != "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" != "bump" ]] && [[ $1 != "commit" ]] && [[ $1 != "repoman" ]]; then
-    eerror "Unknown mode $1"
-    exit 1
-fi
 
-mode=$1
-version=$2
+case "${1}" in
+    bump|commit|repoman) ;;
+    *)
+        eerror "Unknown mode ${1}"
+        exit 1
+        ;;
+esac
+
+mode=${1}
+version=${2}
 
 #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 == "eclass" ]]; then
         continue
     fi
-    if ! [[ $atom =~ leechcraft-* ]]; then
+    if [[ ${PN} != leechcraft-* ]]; then
         continue
     fi
-    einfo "Going to $atom"
+    einfo "Going to ${atom}"
     eindent
-    cd $atom
+    cd ${atom}
 
-    if [[ $mode == "bump" ]]; then
-        einfo "Bumping $atom to $version"
+    case ${mode} in
+    bump)
+        einfo "Bumping ${atom} to ${version}"
 
-        if [[ -e $PN-$version.ebuild ]]; then
-            ewarn "$atom seems to be already bumped to $version, skipping work"
+        if [[ -e ${PN}-${version}.ebuild ]]; then
+            ewarn "${atom} seems to be already bumped to ${version}, skipping work"
             cd - > /dev/null
             eoutdent
             continue
         fi
 
-        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 $?
     
-        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 $?
     
-        ebegin "Running repoman manifest on $atom"
+        ebegin "Running repoman manifest on ${atom}"
         repoman manifest
         eend $?
     
-        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 $?
 
-        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 == "commit" ]]; then
-        einfo "Commiting $atom with message \"$version\""
         
-        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
 
 
     cd - > /dev/null



             reply	other threads:[~2011-09-14 18:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-14 18:16 Maxim Koltsov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-05-26 19:58 [gentoo-commits] dev/maksbotan:master commit in: Documentation/ Maxim Koltsov
2012-08-14 20:26 Maxim Koltsov
2012-07-19 19:17 Maxim Koltsov
2012-03-28 13:15 Maxim Koltsov
2012-02-20 19:18 Maxim Koltsov
2012-02-02 17:57 Maxim Koltsov
2012-01-24 17:28 Maxim Koltsov
2011-12-31 12:34 Maxim Koltsov
2011-12-31 12:34 Maxim Koltsov
2011-09-14 17:01 Maxim Koltsov

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=8a237dcd19a18cb052730d59ba320eb9f8bc16a5.maksbotan@gentoo \
    --to=maksbotan@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