From 777070d2d72a9308cdb451b07faa43aaa577b744 Mon Sep 17 00:00:00 2001 From: Junichi Uekawa Date: Tue, 28 Aug 2007 13:30:43 +0900 Subject: * rename pbuilder-satisfydepends to pbuilder-satisfydepends-classic, and install pbuilder-satisfydepends-aptitude as the deafault pbuilder-satisfydepends * install aptitude per default in chroot. --- ChangeLog | 10 +++ Makefile | 7 +- debian/changelog | 6 +- pbuilder-createbuildenv | 2 +- pbuilder-satisfydepends | 169 --------------------------------------- pbuilder-satisfydepends-classic | 171 ++++++++++++++++++++++++++++++++++++++++ pbuilder-updatebuildenv | 2 +- pbuilderrc.5 | 17 ++-- 8 files changed, 203 insertions(+), 181 deletions(-) delete mode 100755 pbuilder-satisfydepends create mode 100755 pbuilder-satisfydepends-classic diff --git a/ChangeLog b/ChangeLog index 76ea95a..e2432bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-08-28 Junichi Uekawa + + * pbuilderrc.5 (Example): document + pbuilder-satisfydepends-aptitude as the default. + + * pbuilder-updatebuildenv: install aptitude per default. + * pbuilder-createbuildenv: install aptitude per default. + + * pbuilder-satisfydepends-classic: rename to '-classic'. + 2007-08-20 Junichi Uekawa * Makefile: update makefile to install lvmbuilder diff --git a/Makefile b/Makefile index 54f9f79..21a5e19 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ SHELLCODES=pbuilder-buildpackage \ pbuilder-loadconfig \ pbuilder-modules \ pbuilder-runhooks \ - pbuilder-satisfydepends \ + pbuilder-satisfydepends-classic \ pbuilder-satisfydepends-funcs \ pbuilder-satisfydepends-checkparams \ pbuilder-satisfydepends-aptitude \ @@ -76,7 +76,10 @@ install: $(INSTALL_EXECUTABLE) pbuilder-user-mode-linux $(DESTDIR)/usr/bin $(INSTALL_EXECUTABLE) pdebuild-user-mode-linux $(DESTDIR)/usr/bin $(INSTALL_EXECUTABLE) debuild-pbuilder $(DESTDIR)/usr/bin - $(INSTALL_EXECUTABLE) pbuilder-satisfydepends $(DESTDIR)/usr/lib/pbuilder/ + + #install aptitude as the default satisfydepends + $(INSTALL_EXECUTABLE) pbuilder-satisfydepends-aptitude $(DESTDIR)/usr/lib/pbuilder/pbuilder-satisfydepends + $(INSTALL_EXECUTABLE) pbuilder-satisfydepends-classic $(DESTDIR)/usr/lib/pbuilder/ $(INSTALL_EXECUTABLE) pbuilder-satisfydepends-aptitude $(DESTDIR)/usr/lib/pbuilder/ $(INSTALL_EXECUTABLE) pbuilder-satisfydepends-experimental $(DESTDIR)/usr/lib/pbuilder/ $(INSTALL_EXECUTABLE) pbuilder-satisfydepends-checkparams $(DESTDIR)/usr/lib/pbuilder/ diff --git a/debian/changelog b/debian/changelog index 44f2d6d..c05e701 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,12 @@ pbuilder (0.172) UNRELEASED; urgency=low [ Junichi Uekawa ] * update lvmpbuilder, thanks to Kapil Hari Paranjape (closes: #389884) + * rename pbuilder-satisfydepends to pbuilder-satisfydepends-classic, and + install pbuilder-satisfydepends-aptitude as the deafault + pbuilder-satisfydepends + * install aptitude per default in chroot. - -- Junichi Uekawa Mon, 20 Aug 2007 08:01:04 +0900 + -- Junichi Uekawa Tue, 28 Aug 2007 09:30:55 +0900 pbuilder (0.171) unstable; urgency=low diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv index 5ccc73e..770fe60 100755 --- a/pbuilder-createbuildenv +++ b/pbuilder-createbuildenv @@ -88,7 +88,7 @@ if [ -n "$REMOVEPACKAGES" ]; then fi recover_aptcache $CHROOTEXEC /usr/bin/apt-get -y --force-yes "${FORCE_CONFNEW[@]}" dist-upgrade -$CHROOTEXEC /usr/bin/apt-get -y --force-yes install build-essential dpkg-dev apt $EXTRAPACKAGES +$CHROOTEXEC /usr/bin/apt-get -y --force-yes install build-essential dpkg-dev apt aptitude $EXTRAPACKAGES save_aptcache executehooks "E" diff --git a/pbuilder-satisfydepends b/pbuilder-satisfydepends deleted file mode 100755 index dfd6850..0000000 --- a/pbuilder-satisfydepends +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/bash -# pbuilder -- personal Debian package builder -# Copyright (C) 2001,2002,2003,2005-2007 Junichi Uekawa -# -# 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; default flavor - -set -e - -. /usr/lib/pbuilder/pbuilder-satisfydepends-funcs - -function checkbuilddep_internal () { -# Use this function to fulfill the dependency (almost) - - local ARCH=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH) - local INSTALLPKG - local INSTALLPKGLIST - local INSTALLPKGMULTI - local CURRENTREALPKGNAME - local SATISFIED - echo " -> Attempting to parse the build-deps " - for INSTALLPKGMULTI in $(get_control_re "$DEBIAN_CONTROL" "$BD_REGEXP" | - tr " " "/" | \ - awk 'BEGIN{RS=","} {print}'); do - echo " -> Considering build-dep$(echo "$INSTALLPKGMULTI" | tr "/" " " )" - SATISFIED="no" - for INSTALLPKG in $(echo "$INSTALLPKGMULTI" | \ - awk 'BEGIN{RS="|"} {print}'); do - CURRENTREALPKGNAME=$(echo "$INSTALLPKG" | sed -e 's#^/*##' -e 's#[[/(].*##') - if echo "$INSTALLPKG" | grep -q '\['; then - if checkbuilddep_archdeps "$INSTALLPKG" "$ARCH"; then - SATISFIED="yes" - echo " -> This package is not for this architecture" - continue - fi - fi - if echo "$INSTALLPKG" | grep -q '('; then - #echo "Debug: $INSTALLPKG" - if ! checkbuilddep_versiondeps $CURRENTREALPKGNAME \ - $(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\1/') \ - $(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\2/') ; then - echo " -> Does not satisfy version, not trying" - continue - fi - fi - echo " -> Trying $CURRENTREALPKGNAME" - - if $CHROOTEXEC /usr/bin/apt-get -s install $INSTALLPKGLIST $CURRENTREALPKGNAME >& /dev/null; then - SATISFIED="yes" - INSTALLPKGLIST="$INSTALLPKGLIST $CURRENTREALPKGNAME" - else - echo " -> Cannot install $CURRENTREALPKGNAME; apt errors follow:" - if $CHROOTEXEC /usr/bin/apt-get -s install $INSTALLPKGLIST "$CURRENTREALPKGNAME"; then - : - fi - # package could not be found. -- looking for alternative. - PROVIDED="" - checkbuilddep_provides "$CURRENTREALPKGNAME" - if [ -n "$PROVIDED" ]; then - # something provides this package - echo " -> Considering $PROVIDED to satisfy the dependency " - if $CHROOTEXEC /usr/bin/apt-get -s install $INSTALLPKGLIST $PROVIDED >& /dev/null; then - SATISFIED="yes"; - INSTALLPKGLIST="$INSTALLPKGLIST $PROVIDED" - else - # show the error for diagnostic purposes - echo " -> Cannot install $PROVIDED; apt errors follow:" - if $CHROOTEXEC /usr/bin/apt-get -s install $INSTALLPKGLIST $PROVIDED; then - : - fi - fi - fi - fi - if [ "$SATISFIED" = "yes" ]; then - break; - fi - done; - if [ "$SATISFIED" = "no" ]; then - echo "E: Could not satisfy build-dependency." >&2 - if [ "$CONTINUE_FAIL" != "yes" ]; then - exit 2 - fi - fi - done; - - # now actually install the packages - echo " -> Installing $INSTALLPKGLIST" - if ! $CHROOTEXEC apt-get -y --force-yes install $INSTALLPKGLIST; then - echo " -> Trying to fix apt error" - # Work around an apt bug which causes configure to fail. - if $CHROOTEXEC dpkg --configure --pending && $CHROOTEXEC apt-get -y --force-yes install $INSTALLPKGLIST; then - echo " -> Apt bug workaround succeeded" - elif [ "$CONTINUE_FAIL" != "yes" ]; then - echo "E: Unrecoverable error installing build-dependencies." >&2 - exit 1 - fi - fi - - # start processing build-conflicts. - for INSTALLPKG in $(get_control_re "$DEBIAN_CONTROL" "$BC_REGEXP" | - tr " " "/" | \ - awk 'BEGIN{RS=","} {print}'); do - CURRENTREALPKGNAME=$(echo "$INSTALLPKG" | sed -e 's#^/*##' -e 's#[[/(].*##') - echo " -> Considering $CURRENTREALPKGNAME" - - if echo "$INSTALLPKG" | grep -q '\['; then - # this package has arch-conflicts. - if checkbuilddep_archdeps "$INSTALLPKG" "$ARCH"; then - echo "I: Ignoring other-arch" - continue - fi - fi - if echo "$INSTALLPKG" | grep -q '('; then - # this package has version-conflicts - if ! checkbuilddep_versiondeps $CURRENTREALPKGNAME \ - $(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\1/') \ - $(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\2/'); then - echo "I: Satisfies version, not trying" - continue - fi - fi - - # if package exists, remove it. - if $CHROOTEXEC /usr/bin/dpkg -s $(echo "$INSTALLPKG" | tr "/" " " | awk '{print $1}') 2>&1 | grep -q ^Package:; then - if ! $CHROOTEXEC /usr/bin/apt-get -y remove $CURRENTREALPKGNAME ; then - echo "E: Could not satisfy build-conflicts" >&2 - exit 1 - fi - else - echo "I: $CURRENTREALPKGNAME package is not installed, no need to remove" - fi - done - echo " -> Finished parsing the build-deps" -} - - -function print_help () { - # print out help message - cat < - ---help: give help ---control: specify control file (debian/control, *.dsc) ---chroot: operate inside chroot ---binary-all: include binary-all ---binary-arch: include binary-arch only ---echo: echo mode, do nothing. (--force-version required for most operation) ---force-version: skip version check. ---continue-fail: continue even when failed. - -EOF -} - -. /usr/lib/pbuilder/pbuilder-satisfydepends-checkparams - diff --git a/pbuilder-satisfydepends-classic b/pbuilder-satisfydepends-classic new file mode 100755 index 0000000..8a37603 --- /dev/null +++ b/pbuilder-satisfydepends-classic @@ -0,0 +1,171 @@ +#!/bin/bash +# pbuilder -- personal Debian package builder +# Copyright (C) 2001,2002,2003,2005-2007 Junichi Uekawa +# +# 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; default flavor + +# The original pbuilder-satisfydepends code, which is now called 'classic' + +set -e + +. /usr/lib/pbuilder/pbuilder-satisfydepends-funcs + +function checkbuilddep_internal () { +# Use this function to fulfill the dependency (almost) + + local ARCH=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH) + local INSTALLPKG + local INSTALLPKGLIST + local INSTALLPKGMULTI + local CURRENTREALPKGNAME + local SATISFIED + echo " -> Attempting to parse the build-deps " + for INSTALLPKGMULTI in $(get_control_re "$DEBIAN_CONTROL" "$BD_REGEXP" | + tr " " "/" | \ + awk 'BEGIN{RS=","} {print}'); do + echo " -> Considering build-dep$(echo "$INSTALLPKGMULTI" | tr "/" " " )" + SATISFIED="no" + for INSTALLPKG in $(echo "$INSTALLPKGMULTI" | \ + awk 'BEGIN{RS="|"} {print}'); do + CURRENTREALPKGNAME=$(echo "$INSTALLPKG" | sed -e 's#^/*##' -e 's#[[/(].*##') + if echo "$INSTALLPKG" | grep -q '\['; then + if checkbuilddep_archdeps "$INSTALLPKG" "$ARCH"; then + SATISFIED="yes" + echo " -> This package is not for this architecture" + continue + fi + fi + if echo "$INSTALLPKG" | grep -q '('; then + #echo "Debug: $INSTALLPKG" + if ! checkbuilddep_versiondeps $CURRENTREALPKGNAME \ + $(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\1/') \ + $(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\2/') ; then + echo " -> Does not satisfy version, not trying" + continue + fi + fi + echo " -> Trying $CURRENTREALPKGNAME" + + if $CHROOTEXEC /usr/bin/apt-get -s install $INSTALLPKGLIST $CURRENTREALPKGNAME >& /dev/null; then + SATISFIED="yes" + INSTALLPKGLIST="$INSTALLPKGLIST $CURRENTREALPKGNAME" + else + echo " -> Cannot install $CURRENTREALPKGNAME; apt errors follow:" + if $CHROOTEXEC /usr/bin/apt-get -s install $INSTALLPKGLIST "$CURRENTREALPKGNAME"; then + : + fi + # package could not be found. -- looking for alternative. + PROVIDED="" + checkbuilddep_provides "$CURRENTREALPKGNAME" + if [ -n "$PROVIDED" ]; then + # something provides this package + echo " -> Considering $PROVIDED to satisfy the dependency " + if $CHROOTEXEC /usr/bin/apt-get -s install $INSTALLPKGLIST $PROVIDED >& /dev/null; then + SATISFIED="yes"; + INSTALLPKGLIST="$INSTALLPKGLIST $PROVIDED" + else + # show the error for diagnostic purposes + echo " -> Cannot install $PROVIDED; apt errors follow:" + if $CHROOTEXEC /usr/bin/apt-get -s install $INSTALLPKGLIST $PROVIDED; then + : + fi + fi + fi + fi + if [ "$SATISFIED" = "yes" ]; then + break; + fi + done; + if [ "$SATISFIED" = "no" ]; then + echo "E: Could not satisfy build-dependency." >&2 + if [ "$CONTINUE_FAIL" != "yes" ]; then + exit 2 + fi + fi + done; + + # now actually install the packages + echo " -> Installing $INSTALLPKGLIST" + if ! $CHROOTEXEC apt-get -y --force-yes install $INSTALLPKGLIST; then + echo " -> Trying to fix apt error" + # Work around an apt bug which causes configure to fail. + if $CHROOTEXEC dpkg --configure --pending && $CHROOTEXEC apt-get -y --force-yes install $INSTALLPKGLIST; then + echo " -> Apt bug workaround succeeded" + elif [ "$CONTINUE_FAIL" != "yes" ]; then + echo "E: Unrecoverable error installing build-dependencies." >&2 + exit 1 + fi + fi + + # start processing build-conflicts. + for INSTALLPKG in $(get_control_re "$DEBIAN_CONTROL" "$BC_REGEXP" | + tr " " "/" | \ + awk 'BEGIN{RS=","} {print}'); do + CURRENTREALPKGNAME=$(echo "$INSTALLPKG" | sed -e 's#^/*##' -e 's#[[/(].*##') + echo " -> Considering $CURRENTREALPKGNAME" + + if echo "$INSTALLPKG" | grep -q '\['; then + # this package has arch-conflicts. + if checkbuilddep_archdeps "$INSTALLPKG" "$ARCH"; then + echo "I: Ignoring other-arch" + continue + fi + fi + if echo "$INSTALLPKG" | grep -q '('; then + # this package has version-conflicts + if ! checkbuilddep_versiondeps $CURRENTREALPKGNAME \ + $(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\1/') \ + $(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\2/'); then + echo "I: Satisfies version, not trying" + continue + fi + fi + + # if package exists, remove it. + if $CHROOTEXEC /usr/bin/dpkg -s $(echo "$INSTALLPKG" | tr "/" " " | awk '{print $1}') 2>&1 | grep -q ^Package:; then + if ! $CHROOTEXEC /usr/bin/apt-get -y remove $CURRENTREALPKGNAME ; then + echo "E: Could not satisfy build-conflicts" >&2 + exit 1 + fi + else + echo "I: $CURRENTREALPKGNAME package is not installed, no need to remove" + fi + done + echo " -> Finished parsing the build-deps" +} + + +function print_help () { + # print out help message + cat < + +--help: give help +--control: specify control file (debian/control, *.dsc) +--chroot: operate inside chroot +--binary-all: include binary-all +--binary-arch: include binary-arch only +--echo: echo mode, do nothing. (--force-version required for most operation) +--force-version: skip version check. +--continue-fail: continue even when failed. + +EOF +} + +. /usr/lib/pbuilder/pbuilder-satisfydepends-checkparams + diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv index bc6f2a0..88c8f62 100755 --- a/pbuilder-updatebuildenv +++ b/pbuilder-updatebuildenv @@ -45,7 +45,7 @@ recover_aptcache $TRAP saveaptcache_umountproc_cleanbuildplace_trap exit sighup $CHROOTEXEC /usr/bin/apt-get -y --force-yes "${FORCE_CONFNEW[@]}" dist-upgrade -$CHROOTEXEC /usr/bin/apt-get -y --force-yes install build-essential dpkg-dev apt $EXTRAPACKAGES +$CHROOTEXEC /usr/bin/apt-get -y --force-yes install build-essential dpkg-dev apt aptitude $EXTRAPACKAGES save_aptcache # optionally auto-clean apt-cache diff --git a/pbuilderrc.5 b/pbuilderrc.5 index 92c2146..9972f64 100644 --- a/pbuilderrc.5 +++ b/pbuilderrc.5 @@ -260,13 +260,16 @@ in .TP .BI "PBUILDERSATISFYDEPENDSCMD=" "/usr/lib/pbuilder/pbuilder-satisfydepends" -This option is used by various parts of pbuilder to satisfy (i.e. install) the -build-dependencies of a package. There are two alternate implementations, the -"experimental" implementation, "pbuilder-satisfydepends-experimental", which -might be useful to pull packages from experimental or from repositories with a -low APT Pin Priority, and the "aptitude" implementation, which will resolve -build-dependencies and build-conflicts with aptitude which helps dealing with -complex cases but does not support unsigned APT repositories +This option is used by various parts of pbuilder to satisfy +(i.e. install) the build-dependencies of a package. There are three +implementations, the "experimental" implementation, +"pbuilder-satisfydepends-experimental", which might be useful to pull +packages from experimental or from repositories with a low APT Pin +Priority, the "aptitude" implementation, which will resolve +build-dependencies and build-conflicts with aptitude which helps +dealing with complex cases but does not support unsigned APT +repositories, and the "classic" implementation, which is the original +implementation used until 0.172. The default is now "aptitude". .TP .BI "BUILDUSERID=" "1234" -- cgit v1.2.3