diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2014-09-15 02:07:14 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2014-09-15 02:07:14 +0200 |
commit | 9dd1336424ad49a3581aaf580319b205a7965dd4 (patch) | |
tree | 49d3256c38008fb4f7c5dc742a87d980cde93b03 | |
parent | 62b3fdae6eece0c0fceec406c391f48b53e455a3 (diff) | |
download | xtools-9dd1336424ad49a3581aaf580319b205a7965dd4.tar.gz xtools-9dd1336424ad49a3581aaf580319b205a7965dd4.tar.xz xtools-9dd1336424ad49a3581aaf580319b205a7965dd4.zip |
xbump: use xdistdir, detect new packages, add subpackages
-rwxr-xr-x | xbump | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/xbump b/xbump index e970a19..df30d9f 100755 --- a/xbump +++ b/xbump @@ -1,10 +1,19 @@ -#!/bin/sh +#!/bin/sh -e # xbump PKGNAME [git commit options] - git commit a version bump -cd ~/xbps-packages +cd $(xdistdir) pkg=$1; shift -version=$(./xbps-src show "$pkg" | sed -n '/version/s/[^:]*:[\t]*//p') +version=$(./xbps-src show "$pkg" | sed -n '/^version/s/[^:]*:[\t]*//p') -git add srcpkgs/"$pkg" && -git commit -m "$pkg: update to $version." "$@" srcpkgs/"$pkg" +if [ -n "$(git ls-files srcpkgs/"$pkg"/template)" ]; then + msg="$pkg: update to $version." +else + msg="New package: $pkg-$version" +fi + +dirs=$(./xbps-src show "$pkg" | + sed -n '/^\(pkgname\|subpackage\)/s/[^:]*:[\t]*/srcpkgs\//p') + +git add $dirs +git commit -m "$msg" "$@" $dirs |