diff options
-rwxr-xr-x | build-updated-packages.bash | 26 |
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 |