diff -Nru sbuild-0.60.4/bin/create-chroot sbuild-0.60.5/bin/create-chroot --- sbuild-0.60.4/bin/create-chroot 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/bin/create-chroot 2010-11-14 13:21:00.000000000 +0100 @@ -491,7 +491,10 @@ setup_schroot if ! [ -z "$VGNAME" ] && [ -z "$VARIANT" ]; then variants="security volatile backports" - if [ "$BASE" = "sid" ]; then variants="experimental"; fi + if [ "$ARCH" == "i386" -o "$ARCH" == "amd64" -o "$ARCH" == "powerpc" ]; then + variants="${variants} edu" + fi + if [ "$BASE" == "sid" ]; then variants="experimental"; fi for EXTRA in $variants; do EXTRA=-${EXTRA} SUITEEXTRA=${SUITE}${EXTRA} diff -Nru sbuild-0.60.4/bin/Makefile.in sbuild-0.60.5/bin/Makefile.in --- sbuild-0.60.4/bin/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/bin/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -175,6 +175,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/bin/sbuild sbuild-0.60.5/bin/sbuild --- sbuild-0.60.4/bin/sbuild 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/bin/sbuild 2010-11-14 13:21:00.000000000 +0100 @@ -111,23 +111,18 @@ if $conf->get('BATCH_MODE'); unlink("SBUILD-FINISHED") if $conf->get('BATCH_MODE'); if (defined($current_job) && defined($jobs{$current_job})) { - if ($conf->get('SBUILD_MODE') eq "user") { - exit ($jobs{$current_job}->get_status() ne "successful") ? 1 : 0; - } elsif ($conf->get('SBUILD_MODE') eq "buildd") { - if ($jobs{$current_job}->get_status() eq "successful") { - exit 0; - } elsif ($jobs{$current_job}->get_status() eq "attempted") { - exit 2; - } elsif ($jobs{$current_job}->get_status() eq "given-back") { - #Probably needs a give back: - exit 3; - } - #Unknown status - probably needs a give back, but needs to be - #reported to the admin as failure: - exit 1; + if ($jobs{$current_job}->get_status() eq "successful") { + exit 0; + } elsif ($jobs{$current_job}->get_status() eq "attempted") { + exit 2; + } elsif ($jobs{$current_job}->get_status() eq "given-back") { + #Probably needs a give back: + exit 3; } + # Unknown status - probably needs a give back, but needs to be + # reported to the admin as failure: + exit 1; } - exit 0; } # only called from main loop, but depends on job state. diff -Nru sbuild-0.60.4/ChangeLog sbuild-0.60.5/ChangeLog --- sbuild-0.60.4/ChangeLog 2010-11-09 20:57:49.000000000 +0100 +++ sbuild-0.60.5/ChangeLog 2010-11-14 13:39:51.000000000 +0100 @@ -1,3 +1,166 @@ +commit aad7e66da0062cf880418f55e52eacf78f2b11c3 +Author: Roger Leigh +Date: Sun Nov 14 12:15:15 2010 +0000 + + Sbuild::Build: Correctly report build times on failure + +commit 43cf4364c5630cb5a5736cc22217197b592c3e5e +Author: Roger Leigh +Date: Sun Nov 14 12:01:25 2010 +0000 + + etc: Only install 99builddsourceslist on buildds + +commit 1fac57ea98d9d04308baeb643c8f0bd10f74c450 +Author: Roger Leigh +Date: Sun Nov 14 11:56:59 2010 +0000 + + debian: Bump version to 0.60.5-1 + +commit 70c150663a6d58894ef2313d2ae20c8ded7d300f +Author: Roger Leigh +Date: Sun Nov 14 11:56:29 2010 +0000 + + NEWS: Bump version to 0.60.5 and document piuparts and apt resolver + +commit 329258ad45b5442b2c4848d0a6db3b6f7c4af557 +Author: Roger Leigh +Date: Sun Nov 14 11:35:26 2010 +0000 + + Sbuild::Build: Remove stats delimiters + +commit e56d65bad7aeb5cc47862d924288bfc993d72820 +Author: Roger Leigh +Date: Sun Nov 14 11:18:12 2010 +0000 + + Sbuild::Build: Add job name to statistics + +commit 32c59940679f70aef491005efabd1bb63268b1db +Author: Roger Leigh +Date: Sun Nov 14 11:17:29 2010 +0000 + + sbuild: Return buildd-style exit codes for all use cases + +commit b0463acbe37e8a3ec661b3ed89fc1344c2cf49dd +Author: Roger Leigh +Date: Sat Nov 13 19:15:42 2010 +0000 + + Sbuild::InternalResolver: Prune Provided virtual packages in filter_dependencies + + If RESOLVE_VIRTUAL is enabled, prune provided virtual packages in + filter_dependencies. Unsatisfied virtual depdendencies are later + expanded in virtual_dependencies. The pruning is needed or else + we might expand the virtual package to a different package than + already providing the dependency, if such a package was already + installed. + +commit 25c77aea4133c04bf956f3dc79a2e3c3a749b89f +Author: Roger Leigh +Date: Sat Nov 13 18:44:44 2010 +0000 + + debian: Close #603397 + +commit c833c64bb7e34410c5105c5304a41e5396cbd234 +Author: Loïc Minier +Date: Sat Nov 13 18:41:58 2010 +0000 + + Sbuild::ChrootSetup: Run dpkg with --force-confold as for build deps + +commit 2033da980182f3b54a7782c5a7de72c33cd59e15 +Merge: b402d90 dbf0d41 +Author: Roger Leigh +Date: Sat Nov 13 15:03:01 2010 +0000 + + Merge remote branch 'origin/buildd-0.60.0' + + Conflicts: + bin/create-chroot + +commit b402d9065465b8854194e85b1c960b4a03aa874c +Author: Roger Leigh +Date: Sat Nov 13 14:38:20 2010 +0000 + + Sbuild::Build: Add functions for stats logging + +commit 4c115f05b01b452203d26b4e43c302d7412f9a08 +Author: Roger Leigh +Date: Sat Nov 13 13:31:31 2010 +0000 + + Sbuild::Build: Log stats for Distribution and hyphenate Source-Version + +commit d2b52f30c3cee69d1f2f09bc8fbe415a6b6e455a +Author: Roger Leigh +Date: Sat Nov 13 11:41:55 2010 +0000 + + Sbuild::Conf: Only validate lintian and piuparts when enabled + +commit dc806b02c468efc19b91e220d2f982304f14ebab +Author: Andres Mejia +Date: Sat Nov 13 03:24:55 2010 -0500 + + Add feature to run piuparts after a successful build. + +commit 0ccb61ca018a90acc200fb20761fca98c11523a6 +Author: Andres Mejia +Date: Sat Nov 13 01:35:24 2010 -0500 + + Place lintian run code inside a function. + +commit 1d46d853b2abfac197e40b70adbd6ca07d083ff4 +Author: Andres Mejia +Date: Fri Nov 12 17:26:56 2010 -0500 + + Include AptResolver module in installation of libsbuild-perl. + +commit dbf0d41c5d824c028daaec50203209724b62cfdd +Author: Philipp Kern +Date: Thu Nov 11 22:25:25 2010 +0100 + + bin/create-chroot.sh: create edu chroots on i386, amd64 and powerpc + +commit 474ad9f811e39115327034c23b08720a1121850f +Author: Philipp Kern +Date: Thu Nov 11 22:02:43 2010 +0100 + + etc/99builddsourceslist: rip out support for key packages + + It doesn't seem to be possible to use apt-get via simple chroot + statements in a sane way from this script. You'd need to update + its cache first because the new sources.list might not refer to + any mirrors whose lists are already cached and then dpkg complains + about its environment not being set up properly. + + So let's add the debian-edu key to the package and handle it like + the backports.org key. + +commit 548ee0641883b1c3170416ef61da19ab9d8d3526 +Author: Andres Mejia +Date: Wed Nov 10 01:20:26 2010 -0500 + + Add option to refuse to ever remove essential packages. + +commit 1ea5e270438db99b646fcbf28ce5ad3dd708f55b +Author: Andres Mejia +Date: Wed Nov 10 01:07:31 2010 -0500 + + Fix some aptitude options in accordance with aptitude documentation. + +commit 0b0eb6a221ba1a16379c329ff6e5c987ed37a897 +Author: Andres Mejia +Date: Wed Nov 10 01:00:23 2010 -0500 + + Set --allow-unauthenticated (when appropriate) and --no-install-recommends option for apt resolver. + +commit 07bf78ec09d14fcc1b985158f3da36f80c84c4e3 +Author: Roger Leigh +Date: Wed Nov 10 00:01:58 2010 +0000 + + Sbuild::AptResolver: Add new resolver using apt-get + + Like the 'aptitude' resolver, 'apt' installs a dependency package + containing the Build-Depends and Build-Conflicts and Depends and + Conflicts, then runs "apt-get -yf install" to force installation + and removal of the depends and conflicts. + commit fa4cd4daa34d687f64b8b085c6aaaab0a716a3be Author: Roger Leigh Date: Tue Nov 9 19:47:06 2010 +0000 @@ -972,6 +1135,12 @@ blanking the file if it's hardlinked or bind mounted. Use strict POSIX shell. +commit 74ca8ce573377cdf8eaa7ef045c512d5467847bc +Author: Philipp Kern +Date: Mon Nov 1 10:37:42 2010 +0100 + + bin/create-chroot: add testing-edu + commit 7d14ca461db2c29429f305fcd4021660ce90faed Author: Roger Leigh Date: Sun Oct 31 21:59:48 2010 +0000 diff -Nru sbuild-0.60.4/configs/Makefile.in sbuild-0.60.5/configs/Makefile.in --- sbuild-0.60.4/configs/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/configs/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -172,6 +172,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/configure sbuild-0.60.5/configure --- sbuild-0.60.4/configure 2010-11-09 20:57:31.000000000 +0100 +++ sbuild-0.60.5/configure 2010-11-14 13:39:27.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for sbuild 0.60.4. +# Generated by GNU Autoconf 2.67 for sbuild 0.60.5. # # Report bugs to . # @@ -569,8 +569,8 @@ # Identity of this package. PACKAGE_NAME='sbuild' PACKAGE_TARNAME='sbuild' -PACKAGE_VERSION='0.60.4' -PACKAGE_STRING='sbuild 0.60.4' +PACKAGE_VERSION='0.60.5' +PACKAGE_STRING='sbuild 0.60.5' PACKAGE_BUGREPORT='buildd-tools-devel@lists.alioth.debian.org' PACKAGE_URL='' @@ -620,6 +620,7 @@ FIND FAKEROOT DU +PIUPARTS LINTIAN DPKG_SOURCE DPKG_PARSECHANGELOG @@ -1251,7 +1252,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sbuild 0.60.4 to adapt to many kinds of systems. +\`configure' configures sbuild 0.60.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1321,7 +1322,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sbuild 0.60.4:";; + short | recursive ) echo "Configuration of sbuild 0.60.5:";; esac cat <<\_ACEOF @@ -1398,7 +1399,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sbuild configure 0.60.4 +sbuild configure 0.60.5 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1433,7 +1434,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sbuild $as_me 0.60.4, which was +It was created by sbuild $as_me 0.60.5, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2254,7 +2255,7 @@ # Define the identity of the package. PACKAGE='sbuild' - VERSION='0.60.4' + VERSION='0.60.5' cat >>confdefs.h <<_ACEOF @@ -2387,8 +2388,8 @@ esac AM_BACKSLASH='\' -RELEASE_DATE='09 Nov 2010' -RELEASE_DATE_S='1289260800' +RELEASE_DATE='14 Nov 2010' +RELEASE_DATE_S='1289692800' cat >>confdefs.h <<_ACEOF #define RELEASE_DATE "$RELEASE_DATE_S" @@ -2981,6 +2982,46 @@ fi +# Extract the first word of "piuparts", so it can be a program name with args. +set dummy piuparts; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PIUPARTS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PIUPARTS in + [\\/]* | ?:[\\/]*) + ac_cv_path_PIUPARTS="$PIUPARTS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PIUPARTS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PIUPARTS=$ac_cv_path_PIUPARTS +if test -n "$PIUPARTS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PIUPARTS" >&5 +$as_echo "$PIUPARTS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Extract the first word of "du", so it can be a program name with args. set dummy du; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -4597,7 +4638,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sbuild $as_me 0.60.4, which was +This file was extended by sbuild $as_me 0.60.5, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4659,7 +4700,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sbuild config.status 0.60.4 +sbuild config.status 0.60.5 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" diff -Nru sbuild-0.60.4/configure.ac sbuild-0.60.5/configure.ac --- sbuild-0.60.4/configure.ac 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/configure.ac 2010-11-14 13:21:00.000000000 +0100 @@ -115,6 +115,7 @@ AC_PATH_PROG([DPKG_PARSECHANGELOG], [dpkg-parsechangelog]) AC_PATH_PROG([DPKG_SOURCE], [dpkg-source]) AC_PATH_PROG([LINTIAN], [lintian]) +AC_PATH_PROG([PIUPARTS], [piuparts]) AC_PATH_PROG([DU], [du]) AC_PATH_PROG([FAKEROOT], [fakeroot]) AC_PATH_PROG([FIND], [find]) diff -Nru sbuild-0.60.4/db/Makefile.in sbuild-0.60.5/db/Makefile.in --- sbuild-0.60.4/db/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/db/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -172,6 +172,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/debian/changelog sbuild-0.60.5/debian/changelog --- sbuild-0.60.4/debian/changelog 2010-11-22 16:49:42.000000000 +0100 +++ sbuild-0.60.5/debian/changelog 2010-11-22 16:49:42.000000000 +0100 @@ -1,3 +1,19 @@ +sbuild (0.60.5-1ubuntu1) natty; urgency=low + + * Merge from debian unstable (LP: #680099). Remaining changes: + - bin/sbuild-createchroot: do not install debfoster into the chroots + because it is in universe and not needed for package building itself. + + -- Angel Abad Mon, 22 Nov 2010 16:28:20 +0100 + +sbuild (0.60.5-1) unstable; urgency=low + + * Chroot upgrade and dist-upgrade commands run with + "dpkg --force-confold" as done for build dependency installation + (Closes: #603397). Thanks to Loïc Minier. + + -- Roger Leigh Sat, 13 Nov 2010 18:43:25 +0000 + sbuild (0.60.4-1ubuntu3) natty; urgency=low * Revert changes to lib/Sbuild/Build.pm from 0.60.4-1ubuntu2; this was diff -Nru sbuild-0.60.4/debian/rules sbuild-0.60.5/debian/rules --- sbuild-0.60.4/debian/rules 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/debian/rules 2010-11-14 13:21:00.000000000 +0100 @@ -18,7 +18,9 @@ SSH=/usr/bin/ssh \ SUDO=/usr/bin/sudo \ APTITUDE=/usr/bin/aptitude \ - LINTIAN=/usr/bin/lintian + LINTIAN=/usr/bin/lintian \ + PIUPARTS=/usr/sbin/piuparts + build: debian/build/config.status debian/build-stamp debian/build-stamp: debian/build/config.status diff -Nru sbuild-0.60.4/etc/99builddsourceslist sbuild-0.60.5/etc/99builddsourceslist --- sbuild-0.60.4/etc/99builddsourceslist 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/etc/99builddsourceslist 2010-11-14 13:21:00.000000000 +0100 @@ -50,7 +50,6 @@ APT_LIST="${CHROOT_PATH}/etc/apt/sources.buildd.list" APT_CONF="${CHROOT_PATH}/etc/apt/apt.conf.d/99buildd.conf" APT_KEYS="" - APT_KEY_PACKAGES="" rm -f "${APT_LIST}" "${APT_CONF}" if [ "${SUITE_BASE}" = 'lenny' ]; then APT_CONF="${CHROOT_PATH}/etc/apt/apt.conf" @@ -105,7 +104,7 @@ SUITES="${SUITE_BASE} ${SUITE_BASE}-test" [ -n "${edu_mirror}" ] && domirror "${edu_mirror} SUITE local" ${APT_LIST} domirror "http://ftp.skolelinux.no/skolelinux/ SUITE local" ${APT_LIST} - APT_KEY_PACKAGES="${APT_KEY_PACKAGES} debian-edu-archive-keyring" + APT_KEYS="${APT_KEYS} debian-edu" elif [ "${SUITE_BASE}" = 'sid' ]; then SUITES="unstable" @@ -139,9 +138,6 @@ echo W: should add apt key ${KEY} but not found >&2 fi done - for PKG in ${APT_KEY_PACKAGES}; do - chroot ${CHROOT_PATH} apt-get install -y $PKG - done fi else if [ -n "$SUITE_VARIANT" ]; then diff -Nru sbuild-0.60.4/etc/apt-keys/debian-edu.asc sbuild-0.60.5/etc/apt-keys/debian-edu.asc --- sbuild-0.60.4/etc/apt-keys/debian-edu.asc 1970-01-01 01:00:00.000000000 +0100 +++ sbuild-0.60.5/etc/apt-keys/debian-edu.asc 2010-11-14 13:21:00.000000000 +0100 @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.10 (GNU/Linux) + +mQGiBEP85RERBAC0fnZhm7YFpweJPqGbA50mPhdheyjm84+f6yO84EbpFnJsq7xx +LCi1ryD/q9XVoaYRtm1J38BA5GkwKVkhXJNSKlnrB6ODIfXaE+H+AYvivwbblpij +T1q06lt7/dAaJABZ00fTVwleOz+PLSfqwAu+HBNvKaRUDwk02x9gv5wfYwCgiMFI +ceMgGRUn36CZR94iMrE7BkcEAJMlc3HhB8XtEDxuN++9/QArXbLwBO+PyMUIRij3 +lOlLsJsBZGCR3JAfRAg0EdTz+rhrrphW5XauAP5NWxaxfaMn+3/plCKh6eCkxq3F +T916s4mgSzH56kfptmmgBcoF0gVJmlhud+jjm2QnE43XzuUIA0rItAQpcZEQMnhN +InvBA/9mRj93h2af1QUhAc05C7EOA0alzFvsSyUpUiw2I7CCv2FzxdHaCaO0C4ue +108b/rgYxQga4UpKTOZkEpZCZ+0IYg0m5iMUd9V8ekC2xhPeCMdimtIF8RwuApOh +gD3tdIg9TsZge6yTRhRy6dlPNa8STV5k3t4eJSYvS1PCRIA+HbRDU2tvbGVsaW51 +eCBBcmNoaXZlIEF1dG9tYXRpYyBTaWduaW5nIEtleSA8ZnRwbWFzdGVyQHNrb2xl +bGludXgub3JnPohGBBARAgAGBQJD/OYFAAoJEEk++45dZPhwDkEAn168tqCxSKTX +3wXDz/q1FwIPG/DnAKCLcqqS7OUoxRue/XkpK20UuDn904hGBBARAgAGBQJD/OmN +AAoJEOts1sWJP60HHRkAnjAR/QAoJR9hgV7jinXmroXwhMKqAKCeiq40xZqwLtPR +ca3tO85oIiiDNohmBBMRAgAmBQJD/OURAhsDBQkPCZwABgsJCAcDAgQVAggDBBYC +AwECHgECF4AACgkQ/rGZmKJv9FbJQQCeLZeBlsN/zs//AndV1NbE+ExE4mQAn11z +iJb5GaogS5qK0OzgSgxBjUJOiEwEEBECAAwFAkP9yP4Fgw8IuBMACgkQUHLQNqxY +NSDAFwCfas1RDxuQWoMbb6KOglIwh6t/5GsAoKOYdkUkqYlusxCi2+9cF1OKqp3M +uQENBEP85RIQBADOnu4wfGW+sM1oklDYsMo4o0CPQ2laBiEsbp6bc1vG89TlAcaE +6YXVfm15nPKvk2KnYBnvIQ/QE9W5EXGoRN66xQRo3sKp79QNCZuClcyu45HGSUl0 +L/LZLVnur77fyC06s8rkYLXGodvPg6kgAJithsRVr/THkRKHKQwC006ZqwADBQP6 +A29DmRFynHzC29t/K6AP+gL890b9ii6akgiI1xe0qfJgfFqW1rwt4SrF7J241kVH +oRyge5Ez5vh99LXt4n4rD4EcrN8exjR920ARDInqIB/EBM2efFEOzqyq3txyAZhP +2UWaalYbSt+kyX498XKMo9QICzTb3nBcskvdA3fgLiGITwQYEQIADwUCQ/zlEgIb +DAUJDwmcAAAKCRD+sZmYom/0VkKfAJ0dqoe/3ZtGMYYMDaQETHoTriSVVQCfVnsx +kn7heBXxaUKhgepRKseB+fc= +=lMBC +-----END PGP PUBLIC KEY BLOCK----- diff -Nru sbuild-0.60.4/etc/Makefile.am sbuild-0.60.5/etc/Makefile.am --- sbuild-0.60.4/etc/Makefile.am 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/etc/Makefile.am 2010-11-14 13:21:00.000000000 +0100 @@ -30,8 +30,8 @@ exampleconfdir = $(docdir)/examples exampleconf_DATA = example.sbuildrc -COMPAT_SETUP = 25nssdatabases -SETUP = 99builddsourceslist +COMPAT_SETUP = 25nssdatabases 99builddsourceslist +SETUP = schrootsetupdir = $(SCHROOT_SYSCONF_DIR)/setup.d if SBUILD_COMPAT diff -Nru sbuild-0.60.4/etc/Makefile.in sbuild-0.60.5/etc/Makefile.in --- sbuild-0.60.4/etc/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/etc/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -176,6 +176,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ @@ -256,8 +257,8 @@ builddsysconf_DATA = buildd.conf wanna-build.conf exampleconfdir = $(docdir)/examples exampleconf_DATA = example.sbuildrc -COMPAT_SETUP = 25nssdatabases -SETUP = 99builddsourceslist +COMPAT_SETUP = 25nssdatabases 99builddsourceslist +SETUP = schrootsetupdir = $(SCHROOT_SYSCONF_DIR)/setup.d @SBUILD_COMPAT_FALSE@schrootsetup_SCRIPTS = $(SETUP) @SBUILD_COMPAT_TRUE@schrootsetup_SCRIPTS = $(COMPAT_SETUP) $(SETUP) diff -Nru sbuild-0.60.4/etc/sbuild.conf sbuild-0.60.5/etc/sbuild.conf --- sbuild-0.60.4/etc/sbuild.conf 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/etc/sbuild.conf 2010-11-14 13:21:00.000000000 +0100 @@ -133,11 +133,11 @@ # This is disabled by default: only enable it if you know what you are doing. #$apt_allow_unauthenticated = 0; -# Build dependency resolver. sbuild defaults to using 'aptitude' to -# resolve build dependencies. An older 'internal' resolver also -# exists, but this is only recommended if you want the old behaviour. -# The internal resolver is not capable of resolving complex -# alternative and virtual package dependencies, and is obsolete. +# Build dependency resolver. The 'internal' resolver is currently the +# default. The internal resolver is not capable of resolving complex +# alternative and virtual package dependencies. Alternative resolvers +# are 'apt' and 'aptitude', which use apt-get and aptitude to resolve +# build dependencies, respectively. #$build_dep_resolver = "aptitude"; # APT policy. 1 to enable additional checking of package versions @@ -269,6 +269,25 @@ #$lintian_opts = []; ## +## PIUPARTS OPTIONS +## + +# piuparts binary +#$piuparts = "/usr/sbin/piuparts"; + +# Whether to run piuparts +#$run_piuparts = 0; + +# Options to pass to piuparts. Each option is a separate arrayref +# element. For example, ['-b', ''] to add -b and +# . +#$piuparts_opts = []; + +# Preceding arguments to launch piuparts as root. If no arguments are specified, +# piuparts will be launched via sudo. +#$piuparts_root_args = []; + +## ## EXTERNAL COMMANDS ## diff -Nru sbuild-0.60.4/lib/Buildd/Makefile.in sbuild-0.60.5/lib/Buildd/Makefile.in --- sbuild-0.60.4/lib/Buildd/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/lib/Buildd/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -172,6 +172,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/lib/Makefile.in sbuild-0.60.5/lib/Makefile.in --- sbuild-0.60.4/lib/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/lib/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -212,6 +212,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/lib/Sbuild/AptitudeResolver.pm sbuild-0.60.5/lib/Sbuild/AptitudeResolver.pm --- sbuild-0.60.4/lib/Sbuild/AptitudeResolver.pm 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/AptitudeResolver.pm 2010-11-14 13:21:00.000000000 +0100 @@ -181,8 +181,8 @@ '-o', "Aptitude::CmdLine::Ignore-Trust-Violations=$ignore_trust_violations", '-o', 'Aptitude::ProblemResolver::StepScore=100', '-o', "Aptitude::ProblemResolver::Hints::KeepDummy=reject $dummy_pkg_name :UNINST", - '-o', 'Aptitude::ProblemResolver::Keep-All-Tier=55000', - '-o', 'Aptitude::ProblemResolver::Remove-Essential-Tier=maximum', + '-o', 'Aptitude::ProblemResolver::Keep-All-Level=55000', + '-o', 'Aptitude::ProblemResolver::Remove-Essential-Level=maximum', 'install', $dummy_pkg_name ); diff -Nru sbuild-0.60.4/lib/Sbuild/AptResolver.pm sbuild-0.60.5/lib/Sbuild/AptResolver.pm --- sbuild-0.60.4/lib/Sbuild/AptResolver.pm 1970-01-01 01:00:00.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/AptResolver.pm 2010-11-14 13:21:00.000000000 +0100 @@ -0,0 +1,211 @@ +# ResolverBase.pm: build library for sbuild +# Copyright © 2005 Ryan Murray +# Copyright © 2005-2008 Roger Leigh +# Copyright © 2008 Simon McVittie +# +# 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, see +# . +# +####################################################################### + +package Sbuild::AptResolver; + +use strict; +use warnings; +use File::Temp qw(tempdir); + +use Dpkg::Deps; +use Sbuild qw(debug copy version_compare); +use Sbuild::Base; +use Sbuild::ResolverBase; + +BEGIN { + use Exporter (); + our (@ISA, @EXPORT); + + @ISA = qw(Exporter Sbuild::ResolverBase); + + @EXPORT = qw(); +} + +sub new { + my $class = shift; + my $builder = shift; + + my $self = $class->SUPER::new($builder); + bless($self, $class); + + return $self; +} + +sub install_deps { + my $self = shift; + my $name = shift; + my @pkgs = @_; + + my $status = 0; + + my $builder = $self->get('Builder'); + my $session = $builder->get('Session'); + + my $dummy_pkg_name = 'sbuild-build-depends-' . $name. '-dummy'; + #Prepare a path to build a dummy package containing our deps: + $self->set('Dummy package path', + tempdir($builder->get_conf('USERNAME') . '-' . $builder->get('Package') . '-' . + $builder->get('Arch') . '-XXXXXX', + DIR => $session->get('Build Location'))); + my $dummy_dir = $self->get('Dummy package path') . '/' . $dummy_pkg_name; + my $dummy_deb = $self->get('Dummy package path') . '/' . $dummy_pkg_name . '.deb'; + + $builder->log_subsection("Install $name build dependencies (apt-based resolver)"); + + if (!mkdir $dummy_dir) { + $builder->log_warning('Could not create build-depends dummy dir ' . $dummy_dir . ': ' . $!); + goto cleanup; + } + if (!mkdir $dummy_dir . '/DEBIAN') { + $builder->log_warning('Could not create build-depends dummy dir ' . $dummy_dir . '/DEBIAN: ' . $!); + goto cleanup; + } + + if (!open(DUMMY_CONTROL, '>', $dummy_dir . '/DEBIAN/control')) { + $builder->log_warning('Could not open ' . $dummy_dir . '/DEBIAN/control for writing: ' . $!); + goto cleanup; + } + + my $arch = $builder->get('Arch'); + print DUMMY_CONTROL <<"EOF"; +Package: $dummy_pkg_name +Version: 0.invalid.0 +Architecture: $arch +EOF + + my @positive; + my @negative; + + for my $pkg (@pkgs) { + my $deps = $self->get('AptDependencies')->{$pkg}; + + push(@positive, $deps->{'Build Depends'}) + if (defined($deps->{'Build Depends'}) && + $deps->{'Build Depends'} ne ""); + push(@negative, $deps->{'Build Conflicts'}) + if (defined($deps->{'Build Conflicts'}) && + $deps->{'Build Conflicts'} ne ""); + if ($self->get_conf('BUILD_ARCH_ALL')) { + push(@positive, $deps->{'Build Depends Indep'}) + if (defined($deps->{'Build Depends Indep'}) && + $deps->{'Build Depends Indep'} ne ""); + push(@negative, $deps->{'Build Conflicts Indep'}) + if (defined($deps->{'Build Conflicts Indep'}) && + $deps->{'Build Conflicts Indep'} ne ""); + } + } + + my $positive = deps_parse(join(", ", @positive), + reduce_arch => 1, + host_arch => $builder->get('Arch')); + my $negative = deps_parse(join(", ", @negative), + reduce_arch => 1, + host_arch => $builder->get('Arch')); + + if ($positive ne "") { + print DUMMY_CONTROL 'Depends: ' . $positive . "\n"; + } + if ($negative ne "") { + print DUMMY_CONTROL 'Conflicts: ' . $negative . "\n"; + } + + debug("DUMMY Depends: $positive \n"); + debug("DUMMY Conflicts: $negative \n"); + + print DUMMY_CONTROL <<"EOF"; +Maintainer: Debian buildd-tools Developers +Description: Dummy package to satisfy dependencies with apt - created by sbuild + This package was created automatically by sbuild and should never appear on + a real system. You can safely remove it. +EOF + close (DUMMY_CONTROL); + + #Now build and install the package: + $session->run_command( + { COMMAND => ['dpkg-deb', '--build', $session->strip_chroot_path($dummy_dir), $session->strip_chroot_path($dummy_deb)], + USER => 'root', + CHROOT => 1, + PRIORITY => 0}); + if ($?) { + $builder->log("Dummy package creation failed\n"); + goto cleanup; + } + + $session->run_command( + { COMMAND => ['dpkg', '--force-depends', '--force-conflicts', '--install', $session->strip_chroot_path($dummy_deb)], + USER => 'root', + CHROOT => 1, + PRIORITY => 0}); + + $self->set_installed(keys %{$self->get('Changes')->{'installed'}}, $dummy_pkg_name); + + if ($?) { + $builder->log("Dummy package installation failed\n"); + goto package_cleanup; + } + + my (@instd, @rmvd); + $builder->log("Installing build dependencies\n"); + if (!$self->run_apt("-yf", \@instd, \@rmvd, 'install')) { + $builder->log("Package installation failed\n"); + if (defined ($builder->get('Session')->get('Session Purged')) && + $builder->get('Session')->get('Session Purged') == 1) { + $builder->log("Not removing build depends: cloned chroot in use\n"); + } else { + $self->set_installed(@instd); + $self->set_removed(@rmvd); + goto package_cleanup; + } + return 0; + } + $self->set_installed(@instd); + $self->set_removed(@rmvd); + $status = 1; + + package_cleanup: + if ($status == 0) { + if (defined ($session->get('Session Purged')) && + $session->get('Session Purged') == 1) { + $builder->log("Not removing installed packages: cloned chroot in use\n"); + } else { + $self->uninstall_deps(); + } + } + + $session->run_command( + { COMMAND => ['rm', $session->strip_chroot_path($dummy_deb)], + USER => 'root', + CHROOT => 1, + PRIORITY => 0}); + + cleanup: + $session->run_command( + { COMMAND => ['rm', '-rf', $session->strip_chroot_path($dummy_dir)], + USER => 'root', + CHROOT => 1, + PRIORITY => 0}); + + $self->set('Dummy package path', undef); + + return $status; +} + +1; diff -Nru sbuild-0.60.4/lib/Sbuild/Build.pm sbuild-0.60.5/lib/Sbuild/Build.pm --- sbuild-0.60.4/lib/Sbuild/Build.pm 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/Build.pm 2010-11-14 13:21:00.000000000 +0100 @@ -49,6 +49,7 @@ use Sbuild::LogBase qw($saved_stdout); use Sbuild::Sysconfig; use Sbuild::Utility qw(check_url download parse_file dsc_files); +use Sbuild::AptResolver; use Sbuild::AptitudeResolver; use Sbuild::InternalResolver; @@ -69,6 +70,7 @@ my $self = $class->SUPER::new($conf); bless($self, $class); + $self->set('Job', $dsc); $self->set('Arch', undef); $self->set('Chroot Dir', ''); $self->set('Chroot Build Dir', ''); @@ -268,7 +270,10 @@ $self->set_status('building'); - if ($self->get_conf('BUILD_DEP_RESOLVER') eq "aptitude") { + if ($self->get_conf('BUILD_DEP_RESOLVER') eq "apt") { + $self->set('Dependency Resolver', + Sbuild::AptResolver->new($self)); + } elsif ($self->get_conf('BUILD_DEP_RESOLVER') eq "aptitude") { $self->set('Dependency Resolver', Sbuild::AptitudeResolver->new($self)); } else { @@ -279,6 +284,7 @@ $self->set('Pkg Start Time', time); + $self->set('Pkg End Time', $self->get('Pkg Start Time')); # Acquire the architecture we're building for. $self->set('Arch', $self->get_conf('ARCH')); @@ -531,32 +537,10 @@ $self->log_subsection("Post Build"); # Run lintian. - my $lintian = $self->get_conf('LINTIAN'); - if (($self->get_conf('RUN_LINTIAN')) && (-x $lintian)) { - $self->log_subsubsection("lintian"); - - my @lintian_command = ($lintian); - push @lintian_command, @{$self->get_conf('LINTIAN_OPTIONS')} if - ($self->get_conf('LINTIAN_OPTIONS')); - push @lintian_command, $self->get('Changes File'); - $self->get('Host')->run_command( - { COMMAND => \@lintian_command, - CHROOT => 0, - PRIORITY => 0, - }); - my $status = $? >> 8; + $self->run_lintian(); - $self->log("\n"); - if (! $?) { - $self->log_info("Lintian run was successful.\n"); - } else { - my $why = "unknown reason"; - $why = "runtime error" if ($status == 2); - $why = "policy violation" if ($status == 1); - $why = "received signal " . $? & 127 if ($? & 127); - $self->log_error("Lintian run failed ($why)\n"); - } - } + # Run piuparts. + $self->run_piuparts(); # Run post build external commands $self->run_external_commands("post-build-commands", @@ -951,6 +935,86 @@ return $returnval; } +sub run_lintian { + my $self = shift; + + return 1 unless ($self->get_conf('RUN_LINTIAN')); + + $self->log_subsubsection("lintian"); + + my $lintian = $self->get_conf('LINTIAN'); + if (! -x $lintian) { + my $why = "$lintian does not exist or is not executable"; + $self->log_error("Lintian run failed ($why)\n"); + return 0; + } + + my @lintian_command = ($lintian); + push @lintian_command, @{$self->get_conf('LINTIAN_OPTIONS')} if + ($self->get_conf('LINTIAN_OPTIONS')); + push @lintian_command, $self->get('Changes File'); + $self->get('Host')->run_command( + { COMMAND => \@lintian_command, + CHROOT => 0, + PRIORITY => 0, + }); + my $status = $? >> 8; + + $self->log("\n"); + if ($?) { + my $why = "unknown reason"; + $why = "runtime error" if ($status == 2); + $why = "policy violation" if ($status == 1); + $why = "received signal " . $? & 127 if ($? & 127); + $self->log_error("Lintian run failed ($why)\n"); + return 0; + } + + $self->log_info("Lintian run was successful.\n"); + return 1; +} + +sub run_piuparts { + my $self = shift; + + return 1 unless ($self->get_conf('RUN_PIUPARTS')); + + $self->log_subsubsection("piuparts"); + + my $piuparts = $self->get_conf('PIUPARTS'); + if (! -x $piuparts) { + my $why = "$piuparts does not exist or is not executable"; + $self->log_error("Piuparts run failed ($why)\n"); + return 0; + } + + my @piuparts_command; + if (scalar(@{$self->get_conf('PIUPARTS_ROOT_ARGS')})) { + push @piuparts_command, @{$self->get_conf('PIUPARTS_ROOT_ARGS')}; + } else { + push @piuparts_command, $Sbuild::Sysconfig::programs{'SUDO'}, '--'; + } + push @piuparts_command, $piuparts; + push @piuparts_command, @{$self->get_conf('PIUPARTS_OPTIONS')} if + ($self->get_conf('PIUPARTS_OPTIONS')); + push @piuparts_command, $self->get('Changes File'); + $self->get('Host')->run_command( + { COMMAND => \@piuparts_command, + CHROOT => 0, + PRIORITY => 0, + }); + my $status = $? >> 8; + + $self->log("\n"); + if ($?) { + $self->log_error("Piuparts run failed.\n"); + return 0; + } + + $self->log_info("Piuparts run was successful.\n"); + return 1; +} + sub build { my $self = shift; @@ -1125,6 +1189,7 @@ $self->log_subsubsection("dpkg-buildpackage"); $self->set('Build Start Time', time); + $self->set('Build End Time', $self->get('Build Start Time')); $self->set('Pkg Fail Stage', "build"); my $binopt = $self->get_conf('BUILD_SOURCE') ? @@ -1582,21 +1647,37 @@ sub generate_stats { my $self = shift; + $self->add_stat('Job', $self->get('Job')); $self->add_stat('Package', $self->get('Package')); $self->add_stat('Version', $self->get('Version')); - $self->add_stat('Source Version', $self->get('OVersion')); + $self->add_stat('Source-Version', $self->get('OVersion')); $self->add_stat('Architecture', $self->get('Arch')); + $self->add_stat('Distribution', $self->get_conf('DISTRIBUTION')); $self->add_stat('Space', $self->get('This Space')); $self->add_stat('Build-Time', $self->get('Build End Time')-$self->get('Build Start Time')); $self->add_stat('Package-Time', $self->get('Pkg End Time')-$self->get('Pkg Start Time')); - $self->add_stat('Space', $self->get('This Space')); + $self->add_stat('Build-Space', $self->get('This Space')); $self->add_stat('Status', $self->get_status()); $self->add_stat('Fail-Stage', $self->get('Pkg Fail Stage')) if ($self->get_status() ne "successful"); } +sub log_stats { + my $self = shift; + foreach my $stat (sort keys %{$self->get('Summary Stats')}) { + $self->log("${stat}: " . $self->get('Summary Stats')->{$stat} . "\n"); + } +} + +sub print_stats { + my $self = shift; + foreach my $stat (sort keys %{$self->get('Summary Stats')}) { + print STDOUT "${stat}: " . $self->get('Summary Stats')->{$stat} . "\n"; + } +} + sub write_stats { my $self = shift; @@ -1781,9 +1862,7 @@ $self->log_subsection('Summary'); $self->generate_stats(); - foreach my $stat (sort keys %{$self->get('Summary Stats')}) { - $self->log("${stat}: " . $self->get('Summary Stats')->{$stat} . "\n"); - } + $self->log_stats(); $self->log_sep(); $self->log("Finished at ${date}\n"); diff -Nru sbuild-0.60.4/lib/Sbuild/ChrootSetup.pm sbuild-0.60.5/lib/Sbuild/ChrootSetup.pm --- sbuild-0.60.4/lib/Sbuild/ChrootSetup.pm 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/ChrootSetup.pm 2010-11-14 13:21:00.000000000 +0100 @@ -63,7 +63,7 @@ my $conf = shift; $session->run_apt_command( - { COMMAND => [$conf->get('APT_GET'), '-uy', 'upgrade'], + { COMMAND => [$conf->get('APT_GET'), '-uy', '-o', 'Dpkg::Options::=--force-confold', 'upgrade'], ENV => {'DEBIAN_FRONTEND' => 'noninteractive'}, USER => 'root', DIR => '/' }); @@ -75,7 +75,7 @@ my $conf = shift; $session->run_apt_command( - { COMMAND => [$conf->get('APT_GET'), '-uy', 'dist-upgrade'], + { COMMAND => [$conf->get('APT_GET'), '-uy', '-o', 'Dpkg::Options::=--force-confold', 'dist-upgrade'], ENV => {'DEBIAN_FRONTEND' => 'noninteractive'}, USER => 'root', DIR => '/' }); diff -Nru sbuild-0.60.4/lib/Sbuild/ConfBase.pm sbuild-0.60.5/lib/Sbuild/ConfBase.pm --- sbuild-0.60.4/lib/Sbuild/ConfBase.pm 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/ConfBase.pm 2010-11-14 13:21:00.000000000 +0100 @@ -278,6 +278,19 @@ } +sub check { + my $self = shift; + my $key = shift; + + my $entry = $self->{'KEYS'}->{$key}; + + if (defined($entry)) { + if (defined($entry->{'CHECK'})) { + $entry->{'CHECK'}->($self, $entry); + } + } +} + sub warn_deprecated { my $oldtype = shift; my $oldopt = shift; diff -Nru sbuild-0.60.4/lib/Sbuild/Conf.pm sbuild-0.60.5/lib/Sbuild/Conf.pm --- sbuild-0.60.4/lib/Sbuild/Conf.pm 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/Conf.pm 2010-11-14 13:21:00.000000000 +0100 @@ -461,21 +461,60 @@ die '$key: Invalid build-dependency resolver \'' . $self->get($key) . - "'\nValid algorthms are 'internal' and 'aptitude'\n" + "'\nValid algorthms are 'internal', 'apt' and 'aptitude'\n" if !isin($self->get($key), - qw(internal aptitude)); + qw(internal apt aptitude)); }, }, 'LINTIAN' => { - CHECK => $validate_program, + CHECK => sub { + my $self = shift; + my $entry = shift; + my $key = $entry->{'NAME'}; + + # Only validate if needed. + if ($self->get('RUN_LINTIAN')) { + $validate_program->($self, $entry); + } + }, DEFAULT => $Sbuild::Sysconfig::programs{'LINTIAN'}, }, 'RUN_LINTIAN' => { + CHECK => sub { + my $self = shift; + $self->check('LINTIAN'); + }, DEFAULT => 0 }, 'LINTIAN_OPTIONS' => { DEFAULT => [] }, + 'PIUPARTS' => { + CHECK => sub { + my $self = shift; + my $entry = shift; + my $key = $entry->{'NAME'}; + + # Only validate if needed. + if ($self->get('RUN_PIUPARTS')) { + $validate_program->($self, $entry); + } + }, + DEFAULT => $Sbuild::Sysconfig::programs{'PIUPARTS'}, + }, + 'RUN_PIUPARTS' => { + CHECK => sub { + my $self = shift; + $self->check('PIUPARTS'); + }, + DEFAULT => 0 + }, + 'PIUPARTS_OPTIONS' => { + DEFAULT => [] + }, + 'PIUPARTS_ROOT_ARGS' => { + DEFAULT => [] + }, 'EXTERNAL_COMMANDS' => { DEFAULT => { "pre-build-commands" => [], @@ -583,6 +622,10 @@ my $lintian = undef; my $run_lintian = undef; my $lintian_opts = undef; + my $piuparts = undef; + my $run_piuparts = undef; + my $piuparts_opts = undef; + my $piuparts_root_args = undef; my $external_commands = undef; my $log_external_command_output = undef; my $log_external_command_error = undef; @@ -697,9 +740,13 @@ $self->get('BIN_NMU')) { die "A maintainer name, uploader name or key ID must be specified in .sbuildrc,\nor use -m, -e or -k, when performing a binNMU\n"; } - $self->set('LINTIAN', $lintian); $self->set('RUN_LINTIAN', $run_lintian); + $self->set('LINTIAN', $lintian); $self->set('LINTIAN_OPTIONS', $lintian_opts); + $self->set('RUN_PIUPARTS', $run_piuparts); + $self->set('PIUPARTS', $piuparts); + $self->set('PIUPARTS_OPTIONS', $piuparts_opts); + $self->set('PIUPARTS_ROOT_ARGS', $piuparts_root_args); $self->set('EXTERNAL_COMMANDS', $external_commands); push(@{${$self->get('EXTERNAL_COMMANDS')}{"chroot-setup-commands"}}, $chroot_setup_script) if ($chroot_setup_script); diff -Nru sbuild-0.60.4/lib/Sbuild/DB/Makefile.in sbuild-0.60.5/lib/Sbuild/DB/Makefile.in --- sbuild-0.60.4/lib/Sbuild/DB/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/DB/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -172,6 +172,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/lib/Sbuild/InternalResolver.pm sbuild-0.60.5/lib/Sbuild/InternalResolver.pm --- sbuild-0.60.4/lib/Sbuild/InternalResolver.pm 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/InternalResolver.pm 2010-11-14 13:21:00.000000000 +0100 @@ -114,7 +114,7 @@ if ($self->get_conf('RESOLVE_VIRTUAL')) { debug("Finding virtual packages\n"); if (!$self->virtual_dependencies(\@positive)) { - $builder->log("Package installation not possible\n"); + $builder->log("Package installation not possible: failed to find virtual dependencies\n"); return 0; } } @@ -316,6 +316,25 @@ ($d->{'Package'}, $d->{'Rel'}, $d->{'Version'}); my $stat = $status->{$name}; if (!$stat->{'Installed'}) { + # If a package is Provided by an installed package, + # mark it satisfied. + if ($self->get_conf('RESOLVE_VIRTUAL')) { + my @virtuals = $self->get_virtual($name); + my $vstatus = $self->get_dpkg_status(@virtuals); + foreach my $vpkg (@virtuals) { + my $vstat = $vstatus->{$vpkg}; + if ($vpkg ne $name && + $vstat->{'Installed'}) { + debug("$name: pos dep, provided by $vpkg\n"); + $builder->log("$name: provided by $vpkg\n"); + $is_satisfied = 1; + last; + } + } + } + + last if ($is_satisfied); + debug("$name: pos dep, not installed\n"); $builder->log("$name: missing\n"); diff -Nru sbuild-0.60.4/lib/Sbuild/Makefile.am sbuild-0.60.5/lib/Sbuild/Makefile.am --- sbuild-0.60.4/lib/Sbuild/Makefile.am 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/Makefile.am 2010-11-14 13:21:00.000000000 +0100 @@ -39,6 +39,7 @@ ChrootInfoSudo.pm \ ResolverBase.pm \ AptitudeResolver.pm \ + AptResolver.pm \ InternalResolver.pm \ Conf.pm \ ConfBase.pm \ diff -Nru sbuild-0.60.4/lib/Sbuild/Makefile.in sbuild-0.60.5/lib/Sbuild/Makefile.in --- sbuild-0.60.4/lib/Sbuild/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -212,6 +212,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ @@ -302,6 +303,7 @@ ChrootInfoSudo.pm \ ResolverBase.pm \ AptitudeResolver.pm \ + AptResolver.pm \ InternalResolver.pm \ Conf.pm \ ConfBase.pm \ diff -Nru sbuild-0.60.4/lib/Sbuild/Options.pm sbuild-0.60.5/lib/Sbuild/Options.pm --- sbuild-0.60.4/lib/Sbuild/Options.pm 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/Options.pm 2010-11-14 13:21:00.000000000 +0100 @@ -190,6 +190,25 @@ push(@{$self->get_conf('LINTIAN_OPTIONS')}, $_[1]); }, + "run-piuparts" => sub { + $self->set_conf('RUN_PIUPARTS', 1); + }, + "piuparts-opts=s" => sub { + push(@{$self->get_conf('PIUPARTS_OPTIONS')}, + split(/\s+/, $_[1])); + }, + "piuparts-opt=s" => sub { + push(@{$self->get_conf('PIUPARTS_OPTIONS')}, + $_[1]); + }, + "piuparts-root-args=s" => sub { + push(@{$self->get_conf('PIUPARTS_ROOT_ARGS')}, + split(/\s+/, $_[1])); + }, + "piuparts-root-arg=s" => sub { + push(@{$self->get_conf('PIUPARTS_ROOT_ARGS')}, + $_[1]); + }, "pre-build-commands=s" => sub { my @command = split(/\s+/, $_[1]); push(@{${$self->get_conf('EXTERNAL_COMMANDS')}{"pre-build-commands"}}, diff -Nru sbuild-0.60.4/lib/Sbuild/ResolverBase.pm sbuild-0.60.5/lib/Sbuild/ResolverBase.pm --- sbuild-0.60.4/lib/Sbuild/ResolverBase.pm 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/ResolverBase.pm 2010-11-14 13:21:00.000000000 +0100 @@ -186,19 +186,22 @@ my $builder = $self->get('Builder'); - return 1 if !@packages; - $msgs = ""; # redirection of stdin from /dev/null so that conffile question # are treated as if RETURN was pressed. # dpkg since 1.4.1.18 issues an error on the conffile question if # it reads EOF -- hardwire the new --force-confold option to avoid # the questions. + my @apt_command = ($builder->get_conf('APT_GET'), '--purge', + '-o', 'DPkg::Options::=--force-confold', + '-o', 'DPkg::Options::=--refuse-remove-essential', + '-q', '--no-install-recommends'); + push @apt_command, '--allow-unauthenticated' if + ($self->get_conf('APT_ALLOW_UNAUTHENTICATED')); + push @apt_command, "$mode", $action, @packages; my $pipe = $builder->get('Session')->pipe_apt_command( - { COMMAND => [$builder->get_conf('APT_GET'), '--purge', - '-o', 'DPkg::Options::=--force-confold', - '-q', "$mode", $action, @packages], + { COMMAND => \@apt_command, ENV => {'DEBIAN_FRONTEND' => 'noninteractive'}, USER => 'root', PRIORITY => 0, diff -Nru sbuild-0.60.4/lib/Sbuild/Sysconfig.pm.in sbuild-0.60.5/lib/Sbuild/Sysconfig.pm.in --- sbuild-0.60.4/lib/Sbuild/Sysconfig.pm.in 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/lib/Sbuild/Sysconfig.pm.in 2010-11-14 13:21:00.000000000 +0100 @@ -98,6 +98,7 @@ 'DPKG_PARSECHANGELOG' => '@DPKG_PARSECHANGELOG@', 'DPKG_SOURCE' => '@DPKG_SOURCE@', 'LINTIAN' => '@LINTIAN@', + 'PIUPARTS' => '@PIUPARTS@', 'DU' => '@DU@', 'FAKEROOT' => '@FAKEROOT@', 'GPG' => '@GPG@', diff -Nru sbuild-0.60.4/lib/WannaBuild/Makefile.in sbuild-0.60.5/lib/WannaBuild/Makefile.in --- sbuild-0.60.4/lib/WannaBuild/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/lib/WannaBuild/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -172,6 +172,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/Makefile.in sbuild-0.60.5/Makefile.in --- sbuild-0.60.4/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -204,6 +204,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/man/Makefile.in sbuild-0.60.5/man/Makefile.in --- sbuild-0.60.4/man/Makefile.in 2010-11-09 20:57:32.000000000 +0100 +++ sbuild-0.60.5/man/Makefile.in 2010-11-14 13:39:28.000000000 +0100 @@ -194,6 +194,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_MODULE_DIR = @PERL_MODULE_DIR@ PGP = @PGP@ +PIUPARTS = @PIUPARTS@ PLATFORM = @PLATFORM@ PS = @PS@ RELEASE_DATE = @RELEASE_DATE@ diff -Nru sbuild-0.60.4/man/sbuild.1.in sbuild-0.60.5/man/sbuild.1.in --- sbuild-0.60.4/man/sbuild.1.in 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/man/sbuild.1.in 2010-11-14 13:21:00.000000000 +0100 @@ -50,6 +50,11 @@ .RB [ \-\-run\-lintian ] .RB [ \-\-lintian\-opt=\fIoptions\fP ] .RB [ \-\-lintian\-opts=\fIoptions\fP ] +.RB [ \-\-run\-piuparts ] +.RB [ \-\-piuparts\-opt=\fIoptions\fP ] +.RB [ \-\-piuparts\-opts=\fIoptions\fP ] +.RB [ \-\-piuparts\-root\-arg=\fIoptions\fP ] +.RB [ \-\-piuparts\-root\-args=\fIoptions\fP ] .RB [ \-\-pre\-build\-commands=\fIstring\fP ] .RB [ \-\-chroot\-setup\-commands=\fIstring\fP ] .RB [ \-\-chroot\-cleanup\-commands=\fIstring\fP ] @@ -273,6 +278,23 @@ .BR \-\-lintian\-opts=\fIoptions\fP Append extra options to existing options passed to lintian. .TP +.BR \-\-run\-piuparts +Run piuparts after a successful build. +.TP +.BR \-\-piuparts\-opt=\fIoptions\fP +Run piuparts with the specified options. +.TP +.BR \-\-piuparts\-opts=\fIoptions\fP +Append extra options to existing options passed to piuparts. +.TP +.BR \-\-piuparts\-root\-arg=\fIoptions\fP +Add an argument that is used to launch piuparts as root. If no arguments are +specified, piuparts will be launched via sudo. +.TP +.BR \-\-piuparts\-root\-args=\fIoptions\fP +Add arguments that are used to launch piuparts as root. If no arguments are +specified, piuparts will be launched via sudo. +.TP .BR \-\-pre\-build\-commands=\fIstring\fP Run this command before a build starts. This option can be used multiple times to add multiple commands. @@ -362,12 +384,12 @@ defined at the end of a build, so using \fI%c\fR will only be substituted for post-build-commands. .PP -Here's an example of using an escape to run piuparts on a .changes file after -a build is done. +Here's an example of using an escape to run a program foo on a .changes file +after a build is done. .PP \f[CB]$ sbuild \-\-post\-build\-commands \\\fP .br -\f[CB] 'piuparts %SBUILD_CHANGES'\fP +\f[CB] 'foo %SBUILD_CHANGES'\fP .PP One final note, external commands are processed in the order they are given. Also, the commands given in a configuration file are processed first, then the diff -Nru sbuild-0.60.4/NEWS sbuild-0.60.5/NEWS --- sbuild-0.60.4/NEWS 2010-11-09 20:55:43.000000000 +0100 +++ sbuild-0.60.5/NEWS 2010-11-14 13:21:00.000000000 +0100 @@ -1,12 +1,24 @@ NEWS -*- outline -*- ---- -Welcome to sbuild 0.60.4. Please read these release notes carefully. +Welcome to sbuild 0.60.5. Please read these release notes carefully. Full installation instructions are provided in the INSTALL file. The README file also contains more specific notes regarding building and configuration. +* Major changes in 0.60.5: + + 1) A new resolver, 'apt', has been added. Like the aptitude + resolver, this installs a dependency package to install build + dependencies and remove build conflicts, but uses apt-get rather + than aptitude. This resolver is currently experimental and may + not yet perform correctly under all circumstances. Use at your + own risk. + + 2) It is now possible to run piuparts on the build packages with the + new --run-piuparts option. + * Major changes in 0.60.4: 1) The default dependency resolver has been reverted back to diff -Nru sbuild-0.60.4/VERSION sbuild-0.60.5/VERSION --- sbuild-0.60.4/VERSION 2010-11-09 20:57:29.000000000 +0100 +++ sbuild-0.60.5/VERSION 2010-11-14 13:39:24.000000000 +0100 @@ -1,5 +1,5 @@ Package: sbuild -Version: 0.60.4 -Release-Date: 09 Nov 2010 +Version: 0.60.5 +Release-Date: 14 Nov 2010 Released-By: Roger Leigh -Git-Tag: release/sbuild-0.60.4 +Git-Tag: release/sbuild-0.60.5