Ensure apt-utils is installed in the helpers it is required.
This allows us to remove a hacky test from hooks/minimal to see whether we need the package. Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
This commit is contained in:
parent
28db987a8e
commit
0cfbc69eb0
|
@ -73,6 +73,7 @@ Create_lockfile .lock
|
||||||
|
|
||||||
# Checking depends
|
# Checking depends
|
||||||
Check_package chroot/usr/bin/wget wget
|
Check_package chroot/usr/bin/wget wget
|
||||||
|
Check_package chroot/usr/bin/apt-ftparchive apt-utils
|
||||||
|
|
||||||
# Restoring cache
|
# Restoring cache
|
||||||
Restore_cache cache/packages_binary
|
Restore_cache cache/packages_binary
|
||||||
|
|
|
@ -44,6 +44,15 @@ Create_lockfile .lock
|
||||||
|
|
||||||
if ls config/binary_local-packageslists/* > /dev/null 2>&1
|
if ls config/binary_local-packageslists/* > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
|
# Restoring cache
|
||||||
|
Restore_cache cache/packages_chroot
|
||||||
|
|
||||||
|
# Check depends
|
||||||
|
Check_package chroot/usr/bin/apt-ftparchive apt-utils
|
||||||
|
|
||||||
|
# Installing depends
|
||||||
|
Install_package
|
||||||
|
|
||||||
mkdir -p chroot/binary.deb/archives/partial
|
mkdir -p chroot/binary.deb/archives/partial
|
||||||
mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp
|
mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp
|
||||||
touch chroot/var/lib/dpkg/status
|
touch chroot/var/lib/dpkg/status
|
||||||
|
@ -95,6 +104,12 @@ then
|
||||||
rm -rf chroot/binary.deb
|
rm -rf chroot/binary.deb
|
||||||
mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
|
mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
|
||||||
|
|
||||||
|
# Removing depends
|
||||||
|
Remove_package
|
||||||
|
|
||||||
|
# Saving cache
|
||||||
|
Save_cache cache/packages_chroot
|
||||||
|
|
||||||
# Creating stage file
|
# Creating stage file
|
||||||
Create_stagefile .stage/binary_local-packageslists
|
Create_stagefile .stage/binary_local-packageslists
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -96,6 +96,15 @@ case "${1}" in
|
||||||
|
|
||||||
if ls chroot/root/local-packages/*.deb > /dev/null 2>&1
|
if ls chroot/root/local-packages/*.deb > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
|
# Restoring cache
|
||||||
|
Restore_cache cache/packages_chroot
|
||||||
|
|
||||||
|
# Check depends
|
||||||
|
Check_package chroot/usr/bin/apt-ftparchive apt-utils
|
||||||
|
|
||||||
|
# Installing depends
|
||||||
|
Install_package
|
||||||
|
|
||||||
# Generate Packages.gz
|
# Generate Packages.gz
|
||||||
echo "cd /root/local-packages && apt-ftparchive packages . > Packages" | Chroot sh
|
echo "cd /root/local-packages && apt-ftparchive packages . > Packages" | Chroot sh
|
||||||
gzip -9 chroot/root/local-packages/Packages
|
gzip -9 chroot/root/local-packages/Packages
|
||||||
|
@ -104,6 +113,12 @@ case "${1}" in
|
||||||
echo "" >> chroot/etc/apt/sources.list
|
echo "" >> chroot/etc/apt/sources.list
|
||||||
echo "# Local packages" >> chroot/etc/apt/sources.list
|
echo "# Local packages" >> chroot/etc/apt/sources.list
|
||||||
echo "deb file:/root/local-packages ./" >> chroot/etc/apt/sources.list
|
echo "deb file:/root/local-packages ./" >> chroot/etc/apt/sources.list
|
||||||
|
|
||||||
|
# Removing depends
|
||||||
|
Remove_package
|
||||||
|
|
||||||
|
# Saving cache
|
||||||
|
Save_cache cache/packages_chroot
|
||||||
else
|
else
|
||||||
Echo_warning "Local packages must be named with suffix '_all.deb' or '_\$architecture.deb'."
|
Echo_warning "Local packages must be named with suffix '_all.deb' or '_\$architecture.deb'."
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -9,27 +9,15 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
Purge() {
|
# Removing unused packages
|
||||||
PACKAGE="${1}"
|
for PACKAGE in apt-utils aptitude man-db manpages info wget
|
||||||
|
do
|
||||||
if ! apt-get remove --purge --yes "${PACKAGE}"
|
if ! apt-get remove --purge --yes "${PACKAGE}"
|
||||||
then
|
then
|
||||||
echo "WARNING: ${PACKAGE} isn't installed"
|
echo "WARNING: ${PACKAGE} isn't installed"
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
# Removing unused packages
|
|
||||||
for PACKAGE in aptitude man-db manpages info wget
|
|
||||||
do
|
|
||||||
Purge ${PACKAGE}
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Remove apt-utils if we do not require it for lh_chroot_sources
|
|
||||||
if [ ! -e chroot/root/local-packages/Packages.gz ]
|
|
||||||
then
|
|
||||||
Purge apt-utils
|
|
||||||
fi
|
|
||||||
|
|
||||||
apt-get autoremove --yes || true
|
apt-get autoremove --yes || true
|
||||||
|
|
||||||
# Removing unused files
|
# Removing unused files
|
||||||
|
|
Loading…
Reference in New Issue