aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-11-20 20:48:10 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-11-20 20:48:10 +0100
commit1ef97ea2364c37aa864b2d001ae07e4773fdb220 (patch)
tree08c069aacef14672be15c5854ecd63977e3c73bd
parent8ca93f2c2b4daf6b67febb52ed157761d90dd6be (diff)
downloadvcs-rebuild-1ef97ea2364c37aa864b2d001ae07e4773fdb220.tar.xz
Parse repo directory instead of PKGBUILD for old_vers
-rwxr-xr-xbuild-updated-packages.bash26
1 files changed, 24 insertions, 2 deletions
diff --git a/build-updated-packages.bash b/build-updated-packages.bash
index 197c536..e494f6a 100755
--- a/build-updated-packages.bash
+++ b/build-updated-packages.bash
@@ -15,10 +15,32 @@ get_pkgver_sha() {
printf "%s" "$(sed -r 's/.*\.r[0-9]*\.g?//' <<<$pkgver)")
}
+get_repo_sha() {
+ shopt -s nullglob
+ local packages
+ for f in "$REPO"/"$1"*.tar.xz; do
+ package="${f##*/}"
+
+ package="${package//-git-/-git }"
+ package="${package//-hg-/-hg }"
+ package="${package//-?-*.pkg.tar.xz}"
+ IFS=' ' read -ra p <<< "$package"
+
+ if [[ -z "${package//* debug-*}" ]]; then
+ continue
+ else
+ name="${p[0]}"
+ ver="${p[1]}"
+ printf "%s\n" "$(sed -r 's/.*\.r[0-9]*\.g?//' <<<$ver)"
+ return
+ fi
+ done
+}
+
main() {
for package in "${packages[@]}"; do
- old_version[$package]=$(get_pkgver_sha "$package")
- (cd "$package"
+ old_version[$package]=$(get_repo_sha "$package")
+ (cd "$PKGBUILD_DIR"/"$package"
makepkg --nobuild &>/dev/null) &
done
wait