Index the offline mirror with one repo-add per CPU

repo-add takes one package at a time: it hashes the archive and lists its
files, which means decompressing all of it, for about a thousand
packages one after another.

A database is a tar of one directory per package. The packages are dealt
out to one repo-add per CPU, each writing its own database, and the
pieces are joined. On 160 packages on a 16-core machine the result is
identical to one repo-add's, db and files, in 1.0 s against 6.3 s. Two
versions of one package name are an error: one repo-add would keep the
last, the pieces apart would keep both.
This commit is contained in:
Emir Beganovic committed 2026-10-09 19:18:06 +02:00
1 parent 0bc00ff572
commit ebfbf43aa0
3 files changed
+134 -2

No files matched your search

+3 -2
View File
@@ -304,8 +304,9 @@ printf '%s\n' "${required_package_files[@]}" |
# Rebuild the offline repo db from scratch so size/checksum/depends entries
# always reflect only the package files selected for this build.
rm -f "$offline_mirror_dir"/offline.db* "$offline_mirror_dir"/offline.files*
repo-add "$offline_mirror_dir/offline.db.tar.gz" "$offline_mirror_dir/"*.pkg.tar.zst
# Every package archive in the mirror, indexed by one repo-add per CPU: one
# alone hashes and lists a thousand packages one after another.
bash /builder/index-offline-mirror.sh "$offline_mirror_dir"
# mkarchiso expects the mirror at /var/cache/omarchy/mirror/offline inside the
# container (the airootfs path); symlink rather than duplicate.