Add an APT based resolver

this resolver doesn't try to mangle anything of the source package, nor to even
parse it.  It just calls apt-get with the appropriate flags.

All bugs are apt fault!

Closes: #707825
Gbp-Dch: Short
parent 4751b5db
......@@ -46,6 +46,7 @@ PKGLIB_SCRIPTS += \
pbuilder-loadconfig \
pbuilder-modules \
pbuilder-runhooks \
pbuilder-satisfydepends-apt \
pbuilder-satisfydepends-aptitude \
pbuilder-satisfydepends-checkparams \
pbuilder-satisfydepends-classic \
......
......@@ -60,9 +60,13 @@ function checkbuilddep () {
all) BUILDOPT="--binary-indep";;
*) ;;
esac
case "$(readlink -e "$PBUILDERSATISFYDEPENDSCMD")" in
*-apt) local control="$BUILDDIR/$(basename "$1")" ;;
*) local control="$1" ;;
esac
if \
("$PBUILDERSATISFYDEPENDSCMD" \
--control "$1" \
--control "$control" \
--chroot "${BUILDPLACE}" \
--internal-chrootexec "${CHROOTEXEC}" \
"${BUILDOPT}" \
......
#!/bin/bash
# Copyright © 2015-2016 Mattia Rizzolo <mattia@debian.org>
#
# pbuilder -- personal Debian package builder
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# module to satisfy build dependencies; apt flavor
set -e
export PBUILDER_PKGLIBDIR="${PBUILDER_PKGLIBDIR:-$PBUILDER_ROOT/usr/lib/pbuilder}"
. "$PBUILDER_PKGLIBDIR"/pbuilder-modules
. "$PBUILDER_PKGLIBDIR"/pbuilder-satisfydepends-funcs
function checkbuilddep_internal () {
# check whether apt is new enough
if dpkg --compare-versions $($CHROOTEXEC dpkg-query -W -f '${Version}' apt) lt 1.2.2 ; then
log.e "APT is not new enough to be used within this dependency resolver."
log.e "Please switch to a different resolver."
exit 1
fi
log.i "-> Attempting to satisfy build-dependencies"
if [[ "$DEBIAN_CONTROL" = *.dsc ]]; then
local DIR="$DEBIAN_CONTROL"
elif [[ "$DEBIAN_CONTROL" = *control ]]; then
local DIR="${DEBIAN_CONTROL%/control}/../"
else
log.e "Format of \$DEBIAN_CONTROL not recognized ('$DEBIAN_CONTROL')"
exit 1
fi
case "$BINARY_ARCH" in
"binary")
APTGETOPT[${#APTGETOPT[@]}]='--arch-only'
;;
"all")
;;
"any")
;;
*)
log.e "\$BINARY_ARCH contains a weird value [$BINARY_ARCH]. Giving up"
exit 1
;;
esac
$CHROOTEXEC apt-get \
-y \
"${APTGETOPT[@]}" \
build-dep \
"$DIR"
}
function print_help () {
# print out help message
cat <<EOF
pbuilder-satisfydepends -- satisfy dependencies
--help: give help
--control <file>: specify control file (debian/control, *.dsc) _inside the chroot_
--chroot <chroot>: operate inside this chroot
--binary-all: include binary-all
--binary-arch: include binary-arch only
--echo: echo mode, do nothing.
EOF
}
. "$PBUILDER_PKGLIBDIR"/pbuilder-satisfydepends-checkparams
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