Commit 610236dd authored by Cyril Brulebois's avatar Cyril Brulebois

Add support for pinning packages based on a list of source packages.

Source to binaries mapping is established at build time, using the
downloaded Packages file.

Status: for master.
Signed-off-by: default avatarCyril Brulebois <cyril@debamax.com>
parent 59c81492
......@@ -117,6 +117,7 @@ export KERNELVERSION
export LOCALUDEBDIR
export SOURCE_DATE_EPOCH
export USE_BACKPORTS_FROM
export BACKPORTED_SOURCES
ifneq ($(shell id -u),0)
ROOTCMD ?= fakeroot
......
......@@ -370,6 +370,10 @@ USE_BACKPORTS_FROM
meaning no backports support.
Included in /etc/udebs-backports-source in most initrds.
BACKPORTED_SOURCES
When USE_BACKPORTS_FROM is set, set up APT pinning during the build to
prefer packages built from those source packages.
OMIT_RELEASE_INFO
Can be used to suppress the inclusion of the files /etc/default-release and
/etc/udebs-source in some targets (like boot floppies).
......
......@@ -60,6 +60,10 @@ USE_UDEBS_FROM ?= unstable
# Define which backports suite to use, if any:
USE_BACKPORTS_FROM ?=
# Define source packages for which binaries from backports are to be
# preferred during the build, thanks to some APT pinning:
BACKPORTED_SOURCES ?=
# Archive components from which to fetch debian-installer modules.
UDEB_COMPONENTS ?= main/debian-installer
......
......@@ -169,6 +169,24 @@ if [ "$KERNELVERSION" ]; then
trap cleanup EXIT HUP INT QUIT TERM
fi
# Prepare preferences file if needed:
if [ -n "$BACKPORTED_SOURCES" ]; then
rm -f "preferences.$TYPE.local"
for source in $BACKPORTED_SOURCES; do
binaries=$(grep-dctrl -s Package -F Source $source $APTDIR/state/lists/*${USE_BACKPORTS_FROM}*Packages | awk '{print $2}' | xargs)
printf "Checking for source $source: "
if [ -n "$binaries" ]; then
echo "$binaries"
echo "Package: $binaries" >> "preferences.$TYPE.local"
echo "Pin: release n=${USE_BACKPORTS_FROM}" >> "preferences.$TYPE.local"
echo "Pin-Priority: 900" >> "preferences.$TYPE.local"
echo "" >> "preferences.$TYPE.local"
else
echo "(nothing)"
fi
done
fi
# Get udebs.
if [ "$DEBUG" = y ]; then
mkdir -p $DEBUGUDEBDIR
......
......@@ -17,6 +17,10 @@ debian-installer (2018XXXX) UNRELEASED; urgency=medium
to set an extra entry in sources.list
* When USE_BACKPORTS_FROM is set, generate /etc/udebs-backports-source
so that the running d-i knows that backports support is requested.
* Add support for a new BACKPORTED_SOURCES variable, which can be used
to specify which binaries should be picked from the backports suite
(instead of the base suite). Source packages are specified, for
brevity (hello, linux!).
-- Cyril Brulebois <kibi@debian.org> Tue, 26 Dec 2017 15:10:47 +0100
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment