summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-06-17 11:28:20 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-10-07 18:15:03 -0400
commit170bd7c6502f033f42961728fe9a0f236a6b6b95 (patch)
tree820ca9e1d4884c043d4ee38c6ac6c75dbf4e61e9
parent4f88b4e8dda966b86d9aae4e8e2a61167bc3a702 (diff)
db-move: Clarify the flow of the preflight check
This should have the same result, but be a bit less confusing to read. Also, have a slightly more specific error message on a missing PKGBUILD.
-rwxr-xr-xdb-move15
1 files changed, 11 insertions, 4 deletions
diff --git a/db-move b/db-move
index 0b9dd0c..0a00cfb 100755
--- a/db-move
+++ b/db-move
@@ -28,16 +28,23 @@ done
arch_svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null
for pkgbase in "${args[@]:2}"; do
arch_svn up -q "${WORKDIR}/svn/${pkgbase}" >/dev/null
+ found=false
for tarch in "${ARCHES[@]}"; do
while read -r pkgarch pkgfile; do
+
svnrepo_from="${WORKDIR}/svn/${pkgbase}/repos/${repo_from}-${pkgarch}"
- if [[ -r ${svnrepo_from}/PKGBUILD ]]; then
- getpkgfile "${ftppath_from}/${tarch}/${pkgfile}" >/dev/null
- continue 3
+ if ! [[ -r ${svnrepo_from}/PKGBUILD ]]; then
+ die "%s not found in %s-%s" "$pkgbase" "$repo_from" "$pkgarch"
fi
+
+ # getpkgfile will `exit` for us if it fails;
+ # no need to check its result
+ getpkgfile "${ftppath_from}/${tarch}/${pkgfile}" >/dev/null
+
+ found=true
done < <(arch_expac_pkgbase "$repo_from" "$tarch" '%a %f' "$pkgbase")
done
- die "%s not found in %s" "$pkgbase" "$repo_from"
+ [[ $found = true ]] || die "%s not found in %s" "$pkgbase" "$repo_from"
done
msg "Moving packages from [%s] to [%s]..." "$repo_from" "$repo_to"