Fix "--debian-installer cdrom" and its interaction with binary_package-lists

apt-ftparchive is not able to differentiate between .deb and .udeb so
we have to install them in different pool directories so that we can
regenerate the Packages files without having the .udeb show up
unexpectedly.

Since binary_package-lists can overwrite the Packages files generated
in installer_debian-installer we have to ensure that it also updates
the Release file created formerly.

Ideally we should find a way to avoid the duplication of this logic.

Gbp-Dch: Full
This commit is contained in:
Raphaël Hertzog 2019-12-19 19:07:59 +01:00
parent cba349e5d0
commit 30b9a391ac
2 changed files with 30 additions and 6 deletions

View File

@ -129,6 +129,15 @@ then
mv "${FILE}" binary/${POOL}/${SECTION}/"${LETTER}"/"${SOURCE}" mv "${FILE}" binary/${POOL}/${SECTION}/"${LETTER}"/"${SOURCE}"
done done
if [ -e chroot/etc/os-release ]
then
_VERSION="$(. chroot/etc/os-release && echo ${VERSION_ID})"
fi
if [ -n "${_VERSION}" ]; then
_LB_APT_VERSION_OPT='-o APT::FTPArchive::Release::Version="'"${_VERSION}"'"'
fi
cd binary cd binary
for SECTION in ${POOL}/* for SECTION in ${POOL}/*
@ -144,6 +153,21 @@ then
gzip -9 -c ${DISTS}/${LB_PARENT_DISTRIBUTION_BINARY}/${SECTION}/binary-${LB_ARCHITECTURES}/Packages > ${DISTS}/${LB_PARENT_DISTRIBUTION_BINARY}/${SECTION}/binary-${LB_ARCHITECTURES}/Packages.gz gzip -9 -c ${DISTS}/${LB_PARENT_DISTRIBUTION_BINARY}/${SECTION}/binary-${LB_ARCHITECTURES}/Packages > ${DISTS}/${LB_PARENT_DISTRIBUTION_BINARY}/${SECTION}/binary-${LB_ARCHITECTURES}/Packages.gz
done done
if [ -d dists/${LB_PARENT_DISTRIBUTION_BINARY} ]; then
apt-ftparchive \
-o APT::FTPArchive::Release::Origin="Debian" \
-o APT::FTPArchive::Release::Label="Debian" \
-o APT::FTPArchive::Release::Suite="${LB_PARENT_DISTRIBUTION_BINARY}" \
${_LB_APT_VERSION_OPT} \
-o APT::FTPArchive::Release::Codename="${LB_PARENT_DISTRIBUTION_BINARY}" \
-o APT::FTPArchive::Release::Date="$(date -R)" \
-o APT::FTPArchive::Release::Architectures="${LB_ARCHITECTURES}" \
-o APT::FTPArchive::Release::Components="${LB_PARENT_ARCHIVE_AREAS}" \
-o APT::FTPArchive::Release::Description="Last updated: $(date -R)" \
release dists/${LB_PARENT_DISTRIBUTION_BINARY} \
> dists/${LB_PARENT_DISTRIBUTION_BINARY}/Release
fi
cd "${OLDPWD}" cd "${OLDPWD}"
rm -f chroot/bin/Packages rm -f chroot/bin/Packages

View File

@ -514,7 +514,7 @@ then
fi fi
# Udeb handling # Udeb handling
mkdir binary.udeb mkdir -p binary.udeb/pool-udeb/main
cd binary.udeb cd binary.udeb
# Downloading udeb indices # Downloading udeb indices
@ -570,7 +570,7 @@ then
do do
if [ -e "${FILE}" ] if [ -e "${FILE}" ]
then then
Install_file "${FILE}" "pool" Install_file "${FILE}" "pool-udeb"
# Prefer local udebs over downloaded udebs # Prefer local udebs over downloaded udebs
rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb
@ -584,7 +584,7 @@ then
do do
if [ -e "${FILE}" ] if [ -e "${FILE}" ]
then then
Install_file "${FILE}" "pool" Install_file "${FILE}" "pool-udeb"
# Prefer local udebs over downloaded udebs # Prefer local udebs over downloaded udebs
rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb
@ -629,8 +629,8 @@ then
do do
if [ -f "$(basename ${UDEB})" ] if [ -f "$(basename ${UDEB})" ]
then then
mkdir -p $(dirname ${UDEB}) Install_file "$(basename ${UDEB})" "pool-udeb"
mv "$(basename ${UDEB})" "$(dirname ${UDEB})" rm "$(basename ${UDEB})"
fi fi
done done
@ -639,7 +639,7 @@ then
cd "${OLDPWD}" cd "${OLDPWD}"
mv binary.udeb chroot/root mv binary.udeb chroot/root
echo "cd /root/binary.udeb && apt-ftparchive packages pool/main > dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/main/debian-installer/binary-${LB_ARCHITECTURES}/Packages" > chroot/binary.sh echo "cd /root/binary.udeb && apt-ftparchive packages pool-udeb/main > dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/main/debian-installer/binary-${LB_ARCHITECTURES}/Packages" > chroot/binary.sh
Chroot chroot "sh binary.sh" Chroot chroot "sh binary.sh"
rm -f chroot/binary.sh rm -f chroot/binary.sh
mv chroot/root/binary.udeb ./ mv chroot/root/binary.udeb ./