summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac David <isacdaavid@isacdaavid.info>2016-08-22 16:14:57 -0500
committerIsaac David <isacdaavid@isacdaavid.info>2016-08-22 16:14:57 -0500
commit122c52fa9acb2b38853f41f3060e7d0474d376a9 (patch)
treea17c8a59efcf5f8248d223e4b282841c5af37547
parent70357110197aa7e954bd50593c36721f4d547911 (diff)
create clean databases when importing arm packages
The package databases provided upstream contain mismatches (e.g. package descs with a %PGPSIG% field in .db but not in .files), which causes parabolaweb to fail to add file lists. A new database with whitelisted packages is created to work around this.
-rwxr-xr-xdb-import-archlinuxarm-pkg19
1 files changed, 14 insertions, 5 deletions
diff --git a/db-import-archlinuxarm-pkg b/db-import-archlinuxarm-pkg
index 8d8cb3d..0268526 100755
--- a/db-import-archlinuxarm-pkg
+++ b/db-import-archlinuxarm-pkg
@@ -6,10 +6,9 @@
# * Get repo.db from an Arch-like repo
# * Generate a list of available packages
# * Create sync whitelist (based on package blacklist)
-# * Get packages
-# * Check package signatures
-# * Check database signatures
-# * Sync repo => repo
+# * Get packages and signatures
+# * Create new repo.db with them
+# * Sync repo.db => repo.db
# TODO
# * make a tarball of files used for forensics
@@ -121,6 +120,16 @@ init() {
"rsync://${mirror}/${mirrorpath}/${_arch}/${_repo}/" \
"${FTP_BASE}/${PKGPOOLARM}/"
+ # Avoid sloppy upstream databases with corrupt package descriptions,
+ # exclude .sig files from consideration.
+ msg2 "Adding whitelisted packages to clean %s and %s databases..." .db .files
+ # Optional, repo-add overwrites entries by default
+ rm "$db_file" "$files_file"
+ LC_ALL=C repo-add "$db_file" \
+ $(sed "s|^|${FTP_BASE}/${PKGPOOLARM}/|; s|$|${PKGEXT}|" \
+ "/tmp/${_repo}-${_arch}.whitelist") \
+ |& sed -n 's/==> Adding/ -> Adding/p'
+
msg "Putting databases back in place"
rsync "${extra[@]}" --no-motd -rtlH \
--delay-updates \
@@ -129,7 +138,7 @@ init() {
"${FTP_BASE}/${_repo}/os/${_arch}/"
# Cleanup
- unset db
+ unset db
done
done