From 122c52fa9acb2b38853f41f3060e7d0474d376a9 Mon Sep 17 00:00:00 2001 From: Isaac David Date: Mon, 22 Aug 2016 16:14:57 -0500 Subject: 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. --- db-import-archlinuxarm-pkg | 19 ++++++++++++++----- 1 file 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 -- cgit v1.2.3