From 1ef97ea2364c37aa864b2d001ae07e4773fdb220 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 20 Nov 2014 20:48:10 +0100 Subject: Parse repo directory instead of PKGBUILD for old_vers --- build-updated-packages.bash | 26 ++++++++++++++++++++++++-- 1 file 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 -- cgit v1.2.3-70-g09d2