]> git.wh0rd.org - home.git/blobdiff - .bin/ebuild-bump
import vapier
[home.git] / .bin / ebuild-bump
diff --git a/.bin/ebuild-bump b/.bin/ebuild-bump
new file mode 100755 (executable)
index 0000000..8288e0e
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+source ~/.bash_common
+
+cmd=""
+case $1 in
+       -u|--unpack) cmd="unpack";;
+       -*) echo "error: uknown option $1"; exit 1;;
+esac
+
+src=${1%.ebuild}.ebuild ; shift
+dst=${1%.ebuild}.ebuild ; shift
+
+set -e
+
+if [[ ! -e $src ]] ; then
+       echo "source ebuild not found '$src'" 1>&2
+       exit 1
+fi
+
+cp $src $dst
+
+case $cmd in
+       u|unpack) commands="clean setup unpack" ;;
+       *)        commands="manifest clean setup unpack compile install" ;;
+esac
+
+ekeyword ~all $dst
+
+ebuild $dst $commands
+
+cvs add $dst
+
+if [[ -z $* ]] ; then
+       er 'Version bump.'
+else
+       er "Version bump $*."
+fi