diff options
Diffstat (limited to 'db-import-archlinuxarm-pkg')
-rwxr-xr-x | db-import-archlinuxarm-pkg | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/db-import-archlinuxarm-pkg b/db-import-archlinuxarm-pkg index 8d8cb3d..ef8c810 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 @@ -89,12 +88,9 @@ init() { # Remove blacklisted packages and count them # TODO capture all removed packages for printing on debug mode - msg2 "Removing blacklisted packages from %s database..." .db + msg2 "Removing blacklisted packages from %s and %s databases..." .db .files LC_ALL=C repo-remove "${db_file}" "${blacklist[@]}" \ |& sed -n 's/-> Removing/ &/p' - msg2 "Removing blacklisted packages from %s database..." .files - LC_ALL=C repo-remove "${files_file}" "${blacklist[@]}" \ - |& sed -n 's/-> Removing/ &/p' # Get db contents db=($(get_repo_content "${db_file}")) @@ -121,6 +117,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 +135,7 @@ init() { "${FTP_BASE}/${_repo}/os/${_arch}/" # Cleanup - unset db + unset db done done |