summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-09-24 02:32:40 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-09-24 20:26:36 -0400
commit19c6685b1092ec77141d45f9ac141455fb05505b (patch)
treea118ac44cf14acfb60b1a4dbbe580da3bc05f867
parentdbb0f37a13926cf7b16de96b722e91bf9007a4da (diff)
db-import-pkg: Just a little better logging
-rwxr-xr-xdb-import-pkg20
1 files changed, 16 insertions, 4 deletions
diff --git a/db-import-pkg b/db-import-pkg
index ad1bfa6..8d5ebc0 100755
--- a/db-import-pkg
+++ b/db-import-pkg
@@ -3,11 +3,15 @@
#
# License: GPLv3
-set -eE
+set -eE -o pipefail
shopt -s extglob globstar nullglob
source "$(librelib messages)"
setup_traps
+indent() {
+ /usr/lib/libretools/chroot/indent ' | '
+}
+
# usage: expac_file <file.db> <expac_args>
#
# Uses the ${WORKDIR} global
@@ -316,6 +320,7 @@ main() {
msg "Modifying the actual repos"
# db-move
+ msg2 'Step 1 of 3: db-move'
for tag_from in "${ARCHTAGS[@]}"; do
repo_from=${tag_from%-*}
arch_from=${tag_from##*-}
@@ -325,22 +330,29 @@ main() {
[[ $tag_from != $tag_to ]] || continue
[[ $arch_from == $arch_to ]] || continue
+ plain '%s -> %s' "$tag_from" "$tag_to"
< "${WORKDIR}/dif/move:${tag_from}:${tag_to}.txt" \
cut -d' ' -f1 | \
sed 's/^/pkgname=/' | \
- xargs -r -d $'\n' db-move "$repo_from" "$repo_to"
+ xargs -r -d $'\n' db-move "$repo_from" "$repo_to" |& \
+ indent
done
done
# db-update
- STAGING=${WORKDIR}/staging db-update
+ msg2 'Step 2 of 3: db-update'
+ STAGING=${WORKDIR}/staging db-update |& indent
# db-remove
+ msg2 'Step 3 of 3: db-remove'
for tag in "${ARCHTAGS[@]}"; do
repo=${tag%-*}
arch=${tag##*-}
+
+ plain '%s' "$tag"
< "${WORKDIR}/dif/remove:${tag}.txt" \
cut -d' ' -f1 | \
sed 's/^/pkgname=/' | \
- xargs -r -d $'\n' db-remove "$repo" "$arch"
+ xargs -r -d $'\n' db-remove "$repo" "$arch" |& \
+ indent
done
}