about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-03-25 14:26:08 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-03-25 14:26:08 +0100
commit3d339ac6d6bbabbe79b266149ea0e153757c9ec7 (patch)
treeb7f9e923dcb075acf09981710959b5853ca7182e
parent6bc8e434bf988029c63c26c94e633278e96261b2 (diff)
downloadxtools-3d339ac6d6bbabbe79b266149ea0e153757c9ec7.tar.gz
xtools-3d339ac6d6bbabbe79b266149ea0e153757c9ec7.tar.xz
xtools-3d339ac6d6bbabbe79b266149ea0e153757c9ec7.zip
xbump: better detection of new packages.
-rwxr-xr-xxbump13
1 files changed, 7 insertions, 6 deletions
diff --git a/xbump b/xbump
index 8276fb2..df96c31 100755
--- a/xbump
+++ b/xbump
@@ -12,12 +12,6 @@ if [ -z "$version" ]; then
 	exit 1
 fi
 
-if [ -n "$(git ls-files srcpkgs/"$pkg"/template)" ]; then
-	msg="$pkg: update to $version."
-else
-	msg="New package: $pkg-$version"
-fi
-
 spkpattern=$(xsubpkg "$pkg" | tr '\n' '|' | sed 's/\(.*\)|/^(\1)$/')
 shlibs=$(git diff common/shlibs | grep "^+[^+]" | \
 	sed "s/^+[^ ]\+ \(.*\)-[^-]\+_[0-9]\+$/\1/")
@@ -32,4 +26,11 @@ dirs=$(./xbps-src show "$pkg" |
 	sed -n '/^\(pkgname\|subpackage\)/s/[^:]*:[\t]*/srcpkgs\//p')
 
 git add $dirs
+
+if git diff --quiet --cached --diff-filter=A -- srcpkgs/"$pkg"/template; then
+	msg="$pkg: update to $version."
+else
+	msg="New package: $pkg-$version"
+fi
+
 git commit -m "$msg" "$@" $dirs