Fix empty Packages file for APT repository.

This change also adds an extra sanity check to the make_apt.sh script,
in order to ensure that this simple mistake does not occur again.

PiperOrigin-RevId: 355101754
This commit is contained in:
Adin Scannell
2021-02-01 23:03:58 -08:00
committed by gVisor bot
parent aae4803808
commit 0c8cc66117
+5 -1
View File
@@ -119,7 +119,11 @@ for dir in "${root}"/pool/*/binary-*; do
arches+=("${arch}")
repo_packages="${release}"/main/"${name}"
mkdir -p "${repo_packages}"
(cd "${root}" && apt-ftparchive --arch "${arch}" packages pool > "${repo_packages}"/Packages)
(cd "${root}" && apt-ftparchive packages "${dir##${root}/}" > "${repo_packages}"/Packages)
if ! [[ -s "${repo_packages}"/Packages ]]; then
echo "Packages file is size zero." >&2
exit 1
fi
(cd "${repo_packages}" && cat Packages | gzip > Packages.gz)
(cd "${repo_packages}" && cat Packages | xz > Packages.xz)
done