From 8435815a7690830dece329ac9a71b1da04f4ba38 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 5 Jul 2014 02:06:07 -0400 Subject: librestage: clean up variable usage --- src/abslibre-tools/librestage | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 02bc0d0..c12688b 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -74,9 +74,12 @@ main() { load_PKGBUILD # Now for the main routine. - staged=false + local staged=false slock 8 "${WORKDIR}/staging.lock" \ 'Waiting for a shared lock on the staging directory' + + # Look for makepkg output + local CARCH _pkgname pkgfile for CARCH in "${ARCHES[@]}" any; do for _pkgname in "${pkgname[@]}" "${pkgname[@]/%/-debug}"; do if ! pkgfile=$(find_cached_package "$_pkgname" "$(get_full_version "$_pkgname")" "$CARCH"); then @@ -85,6 +88,11 @@ main() { msg 'Found package: %s' "${pkgfile##*/}" + # This little check is from devtools:commitpkg + if grep -q "packager = Unknown Packager" <(bsdtar -xOqf "$pkgfile" .PKGINFO); then + die "PACKAGER wes not set when building package" + fi + xbs release "$repo" "$CARCH" mkdir -p "${WORKDIR}/staging/${repo}" if cp "$pkgfile" "${WORKDIR}/staging/${repo}/${pkgfile##*/}"; then @@ -97,6 +105,9 @@ main() { done done + # Look for librefetch output + local netfile mirror path + local srcurl srcname srcpath for netfile in "${source[@]}"; do for mirror in "${MIRRORS[@]}"; do srcurl=${netfile#*::} @@ -116,7 +127,7 @@ main() { done if [[ -n "$srcpath" ]]; then msg "Found generated source file: %s" "$srcname" - dest="${WORKDIR}/staging/other/${srcurl##"$mirror"}" + local dest="${WORKDIR}/staging/other/${srcurl##"$mirror"}" mkdir -p -- "${dest%/*}" if cp "$srcpath" "$dest"; then msg2 "%s staged on [%s]" "$srcname" other -- cgit v1.2.2