summaryrefslogtreecommitdiff
path: root/helpers/lh_chroot_sources
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2010-01-31 17:07:09 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:17:03 +0100
commit50d889c7149cdc36875536fffd0d80c9aad92158 (patch)
tree8cff314e4c3698b826b7faf9638a23b5f69b8e25 /helpers/lh_chroot_sources
parent5bd06e287353adb94a0e769e11781087be845ea2 (diff)
downloadlive-build-50d889c7149cdc36875536fffd0d80c9aad92158.zip
live-build-50d889c7149cdc36875536fffd0d80c9aad92158.tar.gz
Changing binary indices behaviour as suggested by Ben Armstrong <synrg@debian.org>, means we're now including binary sources by default (unless they are the same as chroot ones), and binary indices now only controls if apt lists need to be included in the resulting binary image.
Diffstat (limited to 'helpers/lh_chroot_sources')
-rwxr-xr-xhelpers/lh_chroot_sources129
1 files changed, 63 insertions, 66 deletions
diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources
index 8b3682e..81c0268 100755
--- a/helpers/lh_chroot_sources
+++ b/helpers/lh_chroot_sources
@@ -355,96 +355,93 @@ case "${1}" in
Create_lockfile .lock
# Configure generic indices
- if [ "${LH_BINARY_INDICES}" = "true" ]
+ # Don't do anything if it's not required
+ if [ "${LH_MIRROR_CHROOT}" = "${LH_MIRROR_BINARY}" ] && \
+ [ "${LH_MIRROR_CHROOT_SECURITY}" = "${LH_MIRROR_BINARY_SECURITY}" ] && \
+ [ ! -d chroot/root/local-packages ]
then
- # Don't do anything if it's not required
- if [ "${LH_MIRROR_CHROOT}" = "${LH_MIRROR_BINARY}" ] && \
- [ "${LH_MIRROR_CHROOT_SECURITY}" = "${LH_MIRROR_BINARY_SECURITY}" ] && \
- [ ! -d chroot/root/local-packages ]
- then
- # Removing stage file
- rm -f .stage/chroot_sources
+ # Removing stage file
+ rm -f .stage/chroot_sources
- exit 0
- fi
+ exit 0
+ fi
- # Cleaning apt list cache
- rm -rf chroot/var/lib/apt/lists
- mkdir -p chroot/var/lib/apt/lists/partial
+ # Cleaning apt list cache
+ rm -rf chroot/var/lib/apt/lists
+ mkdir -p chroot/var/lib/apt/lists/partial
- echo "deb ${LH_MIRROR_BINARY} ${LH_DISTRIBUTION} ${LH_ARCHIVE_AREAS}" > chroot/etc/apt/sources.list
+ echo "deb ${LH_MIRROR_BINARY} ${LH_DISTRIBUTION} ${LH_ARCHIVE_AREAS}" > chroot/etc/apt/sources.list
- if [ "${LH_SOURCE}" = "true" ]
- then
- echo "deb-src ${LH_MIRROR_BINARY} ${LH_DISTRIBUTION} ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
- fi
+ if [ "${LH_SOURCE}" = "true" ]
+ then
+ echo "deb-src ${LH_MIRROR_BINARY} ${LH_DISTRIBUTION} ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
+ fi
- if [ "${LH_SECURITY}" = "true" ]
- then
- case "${LH_MODE}" in
- ubuntu)
- echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}-security ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
+ if [ "${LH_SECURITY}" = "true" ]
+ then
+ case "${LH_MODE}" in
+ ubuntu)
+ echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}-security ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
- if [ "${LH_SOURCE}" = "true" ]
- then
- echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}-security ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
- fi
- ;;
+ if [ "${LH_SOURCE}" = "true" ]
+ then
+ echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}-security ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
+ fi
+ ;;
- *)
- if [ "${LH_DISTRIBUTION}" != "sid" ] && [ "${LH_DISTRIBUTION}" != "unstable" ]
- then
- echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
+ *)
+ if [ "${LH_DISTRIBUTION}" != "sid" ] && [ "${LH_DISTRIBUTION}" != "unstable" ]
+ then
+ echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
- if [ "${LH_SOURCE}" = "true" ]
- then
- echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
- fi
+ if [ "${LH_SOURCE}" = "true" ]
+ then
+ echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list
fi
- ;;
- esac
- fi
+ fi
+ ;;
+ esac
+ fi
- # Check local sources.list
- if Find_files config/chroot_sources/*.binary
+ # Check local sources.list
+ if Find_files config/chroot_sources/*.binary
+ then
+ # Deconfigure (possibly) old sources.list snipplets
+ if Find_files config/chroot_sources/*.chroot
then
- # Deconfigure (possibly) old sources.list snipplets
- if Find_files config/chroot_sources/*.chroot
- then
- for FILE in config/chroot_sources/*.chroot
- do
- rm -f "chroot/etc/apt/sources.list.d/$(basename ${FILE} .chroot).list"
- done
- fi
-
- # Configure new sources.list snipplets
- for FILE in config/chroot_sources/*.binary
+ for FILE in config/chroot_sources/*.chroot
do
- cp "${FILE}" "chroot/etc/apt/sources.list.d/$(basename ${FILE} .binary).list"
+ rm -f "chroot/etc/apt/sources.list.d/$(basename ${FILE} .chroot).list"
done
fi
- # Check local gpg keys
- if Find_files config/chroot_sources/*.binary.gpg
- then
- for FILE in config/chroot_sources/*.binary.gpg
- do
- cp ${FILE} chroot/root
- Chroot chroot "apt-key add /root/$(basename ${FILE})"
- rm -f chroot/root/$(basename ${FILE})
- done
- fi
+ # Configure new sources.list snipplets
+ for FILE in config/chroot_sources/*.binary
+ do
+ cp "${FILE}" "chroot/etc/apt/sources.list.d/$(basename ${FILE} .binary).list"
+ done
+ fi
- # Updating indices
- Apt update
+ # Check local gpg keys
+ if Find_files config/chroot_sources/*.binary.gpg
+ then
+ for FILE in config/chroot_sources/*.binary.gpg
+ do
+ cp ${FILE} chroot/root
+ Chroot chroot "apt-key add /root/$(basename ${FILE})"
+ rm -f chroot/root/$(basename ${FILE})
+ done
fi
+ # Updating indices
+ Apt update
+
# Cleaning apt package cache
rm -rf chroot/var/cache/apt
mkdir -p chroot/var/cache/apt/archives/partial
# Cleaning apt package lists
- if [ "${LH_BINARY_INDICES}" = "none" ]
+ if [ "${LH_BINARY_INDICES}" = "false" ]
then
rm -rf chroot/var/lib/apt/lists
mkdir -p chroot/var/lib/apt/lists/partial