summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-09-20 19:29:22 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-09-20 21:02:25 -0400
commita67fcfc1bad706cd43674c2dbdd1919714d1af25 (patch)
tree7f2eb562a1310f09107657a1a0e5ba94e1d2ced9
parenta1b18567fc2a3f5d70595e28308adc279fae4357 (diff)
db-import-pkg: Don't be over-zealous when removing packagesparabola/20180920.1
-rwxr-xr-xdb-import-pkg7
1 files changed, 4 insertions, 3 deletions
diff --git a/db-import-pkg b/db-import-pkg
index 8bb4441..ad1bfa6 100755
--- a/db-import-pkg
+++ b/db-import-pkg
@@ -222,7 +222,6 @@ main() {
# be. We now create ${WORKDIR}/dif/ describing how to get
# from point A to point B.
cat "${WORKDIR}"/old/*-*.txt | sort -u > "${WORKDIR}/old/all.txt"
- cat "${WORKDIR}"/new/*-*.txt | sort -u > "${WORKDIR}/new/all.txt"
# db-move <repo-from> <repo-to> <pkgname|pkgbase> ...
#
# db-move doesn't allow us to limit the operation to a
@@ -253,9 +252,11 @@ main() {
done
# db-remove <repo> <arch> <pkgname|pkgbase> ...
for tag in "${ARCHTAGS[@]}"; do
+ # pkgnames (that need to leave this tag) AND (haven't
+ # already been removed from this tag by db-move).
comm -23 \
- "${WORKDIR}/old/${tag}.txt" \
- "${WORKDIR}/new/all.txt" \
+ <(cut -d' ' -f1 -- "${WORKDIR}/old/${tag}.txt" | sort -u) \
+ <(cut -d' ' -f1 -- "${WORKDIR}/new/${tag}.txt" "${WORKDIR}/dif/move:${tag}":*.txt | sort -u) \
> "${WORKDIR}/dif/remove:${tag}.txt"
done