diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-04 23:52:01 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-04 23:52:01 -0400 |
commit | 17a2fc79ecedabaa68658f5a3e346570f705c98e (patch) | |
tree | c668477ba1479576750deb83ffdb09052a5e251e | |
parent | 800bc090025b154ed8b8909d1f52ecd937bc9d32 (diff) |
librestage: simplify (I learned a new bit of bash syntax :) )
This mostly reverts the indent-change done by adding -debug support
-rwxr-xr-x | src/abslibre-tools/librestage | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 234f907..908aed5 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -78,32 +78,30 @@ main() { slock 8 "${WORKDIR}/staging.lock" \ 'Waiting for a shared lock on the staging directory' for CARCH in "${ARCHES[@]}" any; do - for _basepkgname in "${pkgname[@]}"; do - for _pkgname in "${_basepkgname}" "${_basepkgname}-debug"; do - if ! pkgfile=$(find_cached_package "$_pkgname" "$(get_full_version "$_pkgname")" "$CARCH"); then - continue - fi + for _pkgname in "${pkgname[@]}" "${pkgname[@]/%/-debug}"; do + if ! pkgfile=$(find_cached_package "$_pkgname" "$(get_full_version "$_pkgname")" "$CARCH"); then + continue + fi - msg 'Found package: %s' "${pkgfile##*/}" + msg 'Found package: %s' "${pkgfile##*/}" - canonical="" # is empty for the first iteration, set after that - for repo in "${repos[@]}"; do - xbs release "$repo" "$CARCH" - mkdir -p "${WORKDIR}/staging/${repo}" - if [[ -z $canonical ]]; then - canonical="${WORKDIR}/staging/${repo}/${pkgfile##*/}" - cmd=(cp "$pkgfile" "$canonical") - else - cmd=(ln "$canonical" "${WORKDIR}/staging/${repo}/${pkgfile##*/}") - fi - if "${cmd[@]}"; then - msg2 "%s staged on [%s]" "$_pkgname" "$repo" - staged=true - else - error "Can't put %s on [%s]" "$_pkgname" "$repo" - return 1 - fi - done + canonical="" # is empty for the first iteration, set after that + for repo in "${repos[@]}"; do + xbs release "$repo" "$CARCH" + mkdir -p "${WORKDIR}/staging/${repo}" + if [[ -z $canonical ]]; then + canonical="${WORKDIR}/staging/${repo}/${pkgfile##*/}" + cmd=(cp "$pkgfile" "$canonical") + else + cmd=(ln "$canonical" "${WORKDIR}/staging/${repo}/${pkgfile##*/}") + fi + if "${cmd[@]}"; then + msg2 "%s staged on [%s]" "$_pkgname" "$repo" + staged=true + else + error "Can't put %s on [%s]" "$_pkgname" "$repo" + return 1 + fi done done done |