diff -Nru sbuild-0.60.9/aclocal.m4 sbuild-0.62.2/aclocal.m4 --- sbuild-0.60.9/aclocal.m4 2011-02-15 00:18:04.000000000 +0000 +++ sbuild-0.62.2/aclocal.m4 2011-04-05 09:48:06.000000000 +0000 @@ -144,6 +144,268 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -325,6 +587,58 @@ rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 diff -Nru sbuild-0.60.9/bin/create-chroot sbuild-0.62.2/bin/create-chroot --- sbuild-0.60.9/bin/create-chroot 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/create-chroot 2011-03-27 11:18:34.000000000 +0000 @@ -1,9 +1,9 @@ #!/bin/bash # GPLv2. -# (C) 2009 Philipp Kern -# (C) 2009 Marc Brockschmidt -# (C) 2010 Andreas Barth +# (C) 2009 Philipp Kern +# (C) 2009 Marc Brockschmidt +# (C) 2010-1 Andreas Barth set -e @@ -79,9 +79,9 @@ fi BASE="$SUITE" -OLDSTABLE="etch" -STABLE="lenny" -TESTING="squeeze" +OLDSTABLE="lenny" +STABLE="squeeze" +TESTING="wheezy" case "$SUITE" in oldstable) BASE=$OLDSTABLE ;; oldstable-security) BASE=$OLDSTABLE; VARIANT="security" ;; @@ -249,14 +249,6 @@ EOT fi - if [ -z "$VARIANT" ] && [ "$BASE" = "etch" ] && [ -n "$VGNAME" ]; then - echo "I: Adding proposed-updates entries to sources.list..." - cat >> "${TEMPFILE}" <get('MAINTAINER_NAME') && + ($conf->get('BIN_NMU') || $conf->get('APPEND_TO_VERSION'))) { + die "A maintainer name, uploader name or key ID must be specified in .sbuildrc,\nor use -m, -e or -k, when performing a binNMU or appending a version suffix\n"; +} + +umask(002); # Job state my %jobs = (); @@ -83,23 +89,36 @@ push @ARGV, '.' unless (@ARGV); # Create jobs - foreach my $job (@ARGV) { - $jobs{$job} = Sbuild::Build->new($job, $conf); - $jobs{$job}->set('Pkg Status Trigger', \&status_trigger) - } - write_jobs_file(); # Will now update on trigger. + eval { + foreach my $job (@ARGV) { + $jobs{$job} = Sbuild::Build->new($job, $conf); + $jobs{$job}->set('Pkg Status Trigger', \&status_trigger) + } + write_jobs_file(); # Will now update on trigger. - # Run each job. Potential for parallelising this step. - foreach (keys %jobs) { - my $jobname = $_; + # Run each job. Potential for parallelising this step. + foreach (keys %jobs) { + my $jobname = $_; - my $job = $jobs{$jobname}; - $current_job = $jobname; + my $job = $jobs{$jobname}; + $current_job = $jobname; - # Do the build - $job->run(); + # Do the build + $job->run(); - dump_main_state() if $conf->get('DEBUG'); + dump_main_state() if $conf->get('DEBUG'); + } + }; + + my $e; + if ($e = Exception::Class->caught('Sbuild::Exception::Build')) { + print STDERR "E: $e\n"; + print STDERR "I: " . $e->info . "\n" + if ($e->info); + if ($debug_level) { + dump_main_state(); + print STDERR $e->trace->as_string, "\n"; + } } close_log($conf); @@ -182,8 +201,6 @@ sub shutdown ($) { my $job = undef; my $signame = shift; - my(@npkgs,@pkgs); - local( *F ); $SIG{'INT'} = 'IGNORE'; $SIG{'QUIT'} = 'IGNORE'; @@ -194,80 +211,16 @@ $job = $jobs{$current_job} if (defined($current_job) && defined($jobs{$current_job})); - # TODO: Use main log if (defined($job)) { - $job->log("sbuild received SIG$signame -- shutting down\n"); - } - - if (defined($job)) { - my $session = $job->get('Session'); - my $resolver = $job->get('Dependency Resolver'); - - # Kill currently running command (if any) - if ($job->get('Sub PID')) { - print "Killing " . $job->get('Sub Task') . - " subprocess " . $job->get('Sub PID') . "\n"; - $job->get('Session')->run_command( - { COMMAND => ['perl', '-e', - "\"kill( \\\"TERM\\\", " . - $job->get('Sub PID') . - " )\""], - USER => 'root', - PRIORITY => 0, - DIR => '/' }); - } - - if (defined($session) && $conf->get('BATCH_MODE') && - !$conf->get('SBUILD_MODE') eq "buildd") { - # next: say which packages should be uninstalled - if (defined ($session->get('Session Purged')) && $session->get('Session Purged') == 1) { - print "Not removing build depends: cloned chroot in use\n"; - } else { - @pkgs = keys %{$resolver->get('Changes')->{'installed'}}; - if (@pkgs) { - if (open( F, ">>NEED-TO-UNINSTALL" )) { - print F "@pkgs\n"; - close( F ); - } - print "The following packages still need to be uninstalled ", - "(--purge):\n@pkgs\n"; - } - } - } - - # Close logs and send mails - if (defined($session) && - $conf->get('PURGE_BUILD_DIRECTORY') eq "always" && - defined($job->get('Chroot Build Dir'))) { - $job->log("Purging " . $job->get('Chroot Build Dir') . "\n"); - my $bdir = $job->get('Session')->strip_chroot_path($job->get('Chroot Build Dir')); - $job->get('Session')->run_command( - { COMMAND => ['rm', '-rf', $bdir], - USER => 'root', - PRIORITY => 0, - DIR => '/' }); - } - - if (defined($resolver)) { - $resolver->cleanup(); - } - - if (defined($session)) { - $session->unlock_chroot(); - $session->end_session(); - $job->set('Session', undef); - } - - $job->close_build_log(); - $job->set('binNMU Name', undef); + $job->request_abort("Received $signame signal"); + } else { + exit(1); } - close_log($conf); - - # Restore the signal handler to let a self-kill result in the appropriate - # exit code. - $SIG{$signame} = 'DEFAULT'; - kill($signame, $$) or die("self-kill failed"); + $SIG{'INT'} = \&main::shutdown; + $SIG{'TERM'} = \&main::shutdown; + $SIG{'ALRM'} = \&main::shutdown; + $SIG{'PIPE'} = \&main::shutdown; } sub dump_main_state () { diff -Nru sbuild-0.60.9/bin/sbuild-apt sbuild-0.62.2/bin/sbuild-apt --- sbuild-0.60.9/bin/sbuild-apt 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/sbuild-apt 2011-04-04 17:43:53.000000000 +0000 @@ -26,6 +26,8 @@ use Sbuild::Utility qw(setup cleanup); use Sbuild::Conf qw(); use Sbuild::OptionsBase; +use Sbuild::InternalResolver; +use Sbuild::ChrootRoot; my $conf = Sbuild::Conf::new(); exit 1 if !defined($conf); @@ -49,8 +51,13 @@ } my $session = setup('source', $chroot, $conf) or die "Chroot setup failed"; +my $host = Sbuild::ChrootRoot->new($conf); +$host->begin_session() or die "Chroot setup (host) failed"; -$session->run_apt_command( +my $resolver = Sbuild::InternalResolver->new($conf, $session, $host); +$resolver->setup(); + +$resolver->run_apt_command( { COMMAND => [$command, @ARGV], ENV => {'DEBIAN_FRONTEND' => 'noninteractive'}, USER => 'root', diff -Nru sbuild-0.60.9/bin/sbuild-createchroot sbuild-0.62.2/bin/sbuild-createchroot --- sbuild-0.60.9/bin/sbuild-createchroot 2011-05-06 14:15:15.000000000 +0000 +++ sbuild-0.62.2/bin/sbuild-createchroot 2011-03-19 14:51:03.000000000 +0000 @@ -157,7 +157,8 @@ # Make sure fakeroot and build-essential are installed $conf->set('INCLUDE', add_items($conf->get('INCLUDE'), "fakeroot", - "build-essential")); + "build-essential", + "debfoster")); my $suite = $ARGV[0]; # Create the target directory in advance so abs_path (which is buggy) diff -Nru sbuild-0.60.9/bin/sbuild-update sbuild-0.62.2/bin/sbuild-update --- sbuild-0.60.9/bin/sbuild-update 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/sbuild-update 2011-04-04 17:43:53.000000000 +0000 @@ -138,17 +138,19 @@ my $status = 0; +my $host = Sbuild::ChrootRoot->new($conf); + if ($conf->get('KEYGEN')) { print "Generating archive key.\n"; - my $session = Sbuild::ChrootRoot->new($conf); - if (!$session->begin_session()) { + my $host = Sbuild::ChrootRoot->new($conf); + if (!$host->begin_session()) { die "Chroot setup failed"; } - $status = generate_keys($session, $conf); + $status = generate_keys($host, $conf); - $session->end_session(); + $host->end_session(); $status >>= 8; if ($status) { @@ -162,7 +164,6 @@ my $chroot = Sbuild::Utility::get_dist($_); my $session = setup('source', $chroot, $conf) or die "Chroot setup failed"; - my $host = Sbuild::ChrootRoot->new($conf); if (!$host->begin_session()) { die "Chroot setup failed"; } diff -Nru sbuild-0.60.9/bin/wanna-build sbuild-0.62.2/bin/wanna-build --- sbuild-0.60.9/bin/wanna-build 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/wanna-build 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -#!/usr/bin/perl -# -# Copyright © 1998 Roman Hodek -# Copyright © 2005-2008 Ryan Murray -# Copyright © 2008 Roger Leigh . -# -####################################################################### - -use strict; -use warnings; - -use POSIX; -use Sbuild qw(isin usage_error); -use WannaBuild::Conf; -use Sbuild::Sysconfig; -use Sbuild::DB::Info; -use Sbuild::DB::MLDBM; -use Sbuild::DB::Postgres; -use WannaBuild::Database; -use WannaBuild::Options; - -# global vars -$| = 1; - -my $conf = WannaBuild::Conf::new(); -exit 1 if !defined($conf); -my $options = WannaBuild::Options->new($conf, "wanna-build", 1); -exit 1 if !defined($options); -my $database = Wannabuild::Database->new($conf); -exit 1 if !defined($database); - -# map program invocation names to operation modes -my %prognames = ( "uploaded-build" => "set-uploaded", - "failed-build" => "set-failed", - "no-build" => "set-not-for-us", - "give-back-build" => "set-needs-build", - "dep-wait-build" => "set-dep-wait", - "forget-build" => "forget", - "merge-quinn" => "merge-quinn", - "merge-packages" => "merge-packages", - "merge-sources" => "merge-sources", - "build-info" => "info" ); - - -my $progname; -($progname = $0) =~ s,.*/,,; - -if ($prognames{$progname}) { - $conf->set('DB_OPERATION', $prognames{$progname}); -} elsif ($progname =~ /^list-(.*)$/) { - $conf->set('DB_OPERATION', 'list'); - $conf->set('DB_LIST_STATE', ($1 eq "all") ? "" : $1); -} - -# All logging is to standard out and error; no log stream to set. -my $status = $database->run(); - -exit $status; - -END { - if (defined($database)) { - my $databases = $database->get('Databases'); - foreach (keys %{$databases}) { - $databases->{$_}->close(); - undef $databases->{$_}; - } - } -} diff -Nru sbuild-0.60.9/bin/wanna-build-catdb sbuild-0.62.2/bin/wanna-build-catdb --- sbuild-0.60.9/bin/wanna-build-catdb 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/wanna-build-catdb 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -#!/usr/bin/perl -# -# Copyright © 1999 Roman Hodek -# Copyright © 2008 Roger Leigh . -# -####################################################################### - -use strict; -use warnings; -use File::Basename; -my $progname = basename($0); -my %db; - -use DB_File; -use GDBM_File; -use MLDBM qw(GDBM_File Storable); - -die "Filename missing\n" if !@ARGV; -die "$ARGV[0]: $!\n" if !-f $ARGV[0]; - -if ($progname =~ /catdb/) { - tie %db, 'DB_File', $ARGV[0], O_RDONLY, 0664, $DB_HASH; -} -elsif ($progname =~ /catgdbm/) { - tie %db, 'GDBM_File', $ARGV[0], GDBM_READER, 0644; -} -elsif ($progname =~ /catmldbm/) { - tie %db, 'MLDBM', $ARGV[0], GDBM_READER, 0644; -} -else { - die "Called for unknown db type\n"; -} -shift; - -my ($key, $val); - -my @keys = sort(keys(%db)); -@keys = @ARGV if (@ARGV > 0); - -foreach $key (@keys) { - print "-"x78, "\n"; - if (exists $db{$key}) { - my $val = $db{$key}; - if (ref($val) eq "HASH") { - print "$key:\n"; - foreach (keys(%{$val})) { - print " $_: $val->{$_}\n"; - } - } else { - print "$key:\n$db{$key}\n"; - } - } - else { - print "*UNDEFINED*\n"; - } -} - -untie %db; -exit 0; diff -Nru sbuild-0.60.9/bin/wanna-build-mail sbuild-0.62.2/bin/wanna-build-mail --- sbuild-0.60.9/bin/wanna-build-mail 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/wanna-build-mail 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -#!/usr/bin/perl -# -# wanna-build-mail: mail interface to wanna-build -# Copyright © 1998 Roman Hodek -# Copyright © 2009 Roger Leigh -# -# 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 -# . -# -####################################################################### - -use strict; -use warnings; - -use WannaBuild::Conf; -use WannaBuild::Options; -use WannaBuild::Mail; - -my $conf = WannaBuild::Conf::new(); -exit 1 if !defined($conf); -my $options = WannaBuild::Options->new($conf, "wanna-build", 1); -exit 1 if !defined($options); -my $mail = WannaBuild::Mail->new($conf); -exit 1 if !defined($mail); - -# All logging is to standard out and error; no log stream to set. -my $status = $mail->run(); - -exit $status; - -END { - #TODO: unlink real tempfile -# unlink( $tmpf ); -} diff -Nru sbuild-0.60.9/bin/wanna-build-merge-packages sbuild-0.62.2/bin/wanna-build-merge-packages --- sbuild-0.60.9/bin/wanna-build-merge-packages 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/wanna-build-merge-packages 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ -#!/usr/bin/perl -# -# wanna-build-merge-packages: merge current Packages and Sources files into -# wanna-build database -# Copyright © 1998-2000 Roman Hodek -# -# 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 conf; -use WannaBuild::Conf; - -package main; - -sub cleanup ($); - -use strict; -use warnings; -use vars qw($HOME $tmpdir $arch @dists $locked); - -$HOME = $ENV{'HOME'} -or die "HOME not defined in environment!\n"; -@dists = qw(stable frozen unstable); - -open( STDOUT, ">>$HOME/lib/merge.log" ); -open( STDERR, ">&STDOUT" ); -$| = 1; -select(STDERR); $| = 1; select(STDOUT); -chomp( my $date = `date` ); -print "-------------- merge-packages $date --------------\n"; - -$tmpdir = "/tmp/merge-packages.$$"; -$arch = `dpkg --print-architecture`; - -# make backups of databases -my $d; -foreach $d (@dists) { - my $db = "$conf::basedir/$conf::dbbase-$d"; - system "cp", "-p", $db, "$db.bak" if -d $db; -} - -mkdir( $tmpdir, 0755 ) or die "mkdir $tmpdir: $!\n"; -chdir( $tmpdir ) or die "chdir $tmpdir: $!\n"; - -foreach (qw(HUP INT QUIT PIPE TERM __DIE__)) { - $SIG{$_} = \&cleanup; -} - -system "wanna-build", "--create-maintenance-lock" - and die "wanna-build --create-maintenance-lock error status $?\n"; -$locked = 1; - -# fetch Packages files and run wanna-build -my ($dist, $sect); -foreach $dist ("proposed-updates", @dists) { - my @sects = ($dist eq "proposed-updates") ? ("") : @conf::sections; - my $bindir = ($dist eq "proposed-updates") ? "" : "binary-$arch"; - my $sect; - - foreach $sect (@sects) { - unlink( "Packages", "Packages.gz" ); - my $f = "$conf::pkgs_source/dists/$dist/$sect/$bindir/Packages.gz"; - if ($f =~ m,^/,) { - if (system "gunzip -dc '$f' >Packages") { - warn "gunzip Packages.gz error status $?\n"; - unlink( "Packages" ); - next; - } - } - else { - system "wget", "-q", $f and next; - if (system "gunzip", "Packages.gz") { - warn "gunzip Packages.gz error status $?\n"; - unlink( "Packages", "Packages.gz" ); - next; - } - } - print "Got $f\n"; - if (! -s "Packages") { - warn "$0: Packages file for $dist/$sect is zero length; skipping\n"; - unlink( "Packages" ); - next; - } - - my $d = ($dist eq "proposed-updates") ? "stable" : $dist; - next if ! -f "$conf::basedir/$conf::dbbase-$d"; - print "--> $dist/$sect\n"; - system "wanna-build", "--merge-packages", "-v", "--dist=$d", "Packages" - and warn "wanna-build --merge-packages error status $?\n"; - unlink( "Packages" ); - } -} - -# make Sources files -foreach $dist (@dists) { - foreach $sect (@conf::sections) { - unlink( "Sources", "Sources.gz" ); - my $f = "$conf::pkgs_source/dists/$dist/$sect/sources/Sources.gz"; - if ($f =~ m,^/,) { - if (system "gunzip -dc '$f' >Sources") { - warn "gunzip Sources.gz error status $?\n"; - unlink( "Sources" ); - next; - } - } - else { - system "wget", "-q", $f and next; - if (system "gunzip", "Sources.gz") { - warn "gunzip Sources.gz error status $?\n"; - unlink( "Sources", "Sources.gz" ); - next; - } - } - print "Got $f\n"; - - if (! -s "Sources") { - warn "$0: Sources file for $dist/$sect is zero length; skipping\n"; - unlink( "Sources" ); - next; - } - - next if ! -f "$conf::basedir/$conf::dbbase-$dist"; - print "--> $dist/$sect (src)\n"; - system "wanna-build", "--merge-sources", "-v", "--dist=$dist","Sources" - and warn "wanna-build --merge-sources error status $?\n"; - unlink( "Sources" ); - } -} - -system "wanna-build", "--remove-maintenance-lock" - and die "wanna-build --remove-maintenance-lock error status $?\n"; -$locked = 0; - -chdir( "/" ) or die "chdir /: $!\n"; -system "rm", "-rf", $tmpdir and die "rm -rf $tmpdir error status $?"; - -system "buildd-addpkg", "--clean" - if -x "/usr/bin/buildd-addpkg"; - -exit( 0 ); - -sub cleanup ($) { - system "wanna-build", "--remove-maintenance-lock" if $locked; - system "rm -rf $tmpdir" if $tmpdir; -} diff -Nru sbuild-0.60.9/bin/wanna-build-merge-quinn sbuild-0.62.2/bin/wanna-build-merge-quinn --- sbuild-0.60.9/bin/wanna-build-merge-quinn 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/wanna-build-merge-quinn 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -#!/usr/bin/perl -# -# wanna-build-merge-quinn: merge current quinn-diff output into wanna-build -# database and make wanna-build statistics -# Copyright © 1998-2000 Roman Hodek -# -# 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 conf; -use WannaBuild::Conf; - -package main; - -sub cleanup ($); - -use strict; -use warnings; -use vars qw($HOME $tmpdir $arch @dists $locked); - -$HOME = $ENV{'HOME'} -or die "HOME not defined in environment!\n"; -@dists = qw(stable frozen unstable); - -open( STDOUT, ">>$HOME/lib/merge.log" ); -open( STDERR, ">&STDOUT" ); -$| = 1; -select(STDERR); $| = 1; select(STDOUT); -chomp( my $date = `date` ); -print "-------------- merge-quinn $date --------------\n"; - -$tmpdir = "/tmp/merge-quinn.$$"; -chomp( $arch = `dpkg --print-architecture` ); - -mkdir( $tmpdir, 0755 ) or die "mkdir $tmpdir: $!\n"; -chdir( $tmpdir ) or die "chdir $tmpdir: $!\n"; - -my $stats_only = 1 if @ARGV >= 1 && $ARGV[0] eq "--stat-only"; - -foreach (qw(HUP INT QUIT PIPE TERM __DIE__)) { - $SIG{$_} = \&cleanup; -} - -my ($dist, $sect); - -if (!$stats_only) { - - system "wanna-build", "--create-maintenance-lock" - and die "wanna-build --create-maintenance-lock error status $?\n"; - $locked = 1; - - foreach $dist (@dists) { - my $ofile = "quinn-$dist"; - unlink( $ofile ); - - foreach $sect (@conf::sections) { - my $bf = ($conf::quinn_source_multi_section ? - $dist : "by_section-$arch.txt"); - unlink( $bf ); - my $f = ($conf::quinn_source_multi_section ? - "$conf::quinn_source/$arch/$sect/$dist" : - "$conf::quinn_source/$dist/by_section-$arch.txt"); - if ($f =~ m,^/,) { - if (system "cat '$f' >>$ofile") { - warn "cat $f >>$ofile error status $?\n"; - next; - } - } - else { - system "wget", "-q", $f and next; - if (system "cat '$bf' >>$ofile") { - warn "cat $bf >>$ofile error status $?\n"; - unlink( $bf ); - next; - } - } - print "Got $f\n"; - unlink( $bf ); - } - - next if ! -s $ofile; - next if ! -f "$conf::basedir/$conf::dbbase-$dist"; - print "--> $dist\n"; - system "wanna-build", "--merge-quinn", "-v", "--dist=$dist", "$ofile" - and warn "wanna-build --merge-quinn error status $?\n"; - unlink( $ofile ); - } - - system "wanna-build", "--remove-maintenance-lock"; - $locked = 0; -} - -unlink( "stats" ); -foreach $dist (@dists) { - system "wanna-build-statistics --dist=$dist >>stats"; - system "echo '' >>stats"; -} - -if (-s "stats" && defined($conf::stat_mail) && $conf::stat_mail) { - system "mail -s 'wanna-build statistics $date' $conf::stat_mail $conf::web_stats" ) - or die "Cannot create $conf::web_stats: $!\n"; - print F "wanna-build statistics $date\n"; - print F "===================================================\n\n"; - close( F ); - system "cat stats >>'$conf::web_stats'"; - system "chmod", "644", $conf::web_stats; - } -} - -chdir( "/" ) or die "chdir /: $!\n"; -system "rm", "-rf", $tmpdir and die "rm -rf $tmpdir error status $?"; - -exit( 0 ); - -sub cleanup ($) { - system "wanna-build", "--remove-maintenance-lock" if $locked; - system "rm -rf $tmpdir" if $tmpdir; -} diff -Nru sbuild-0.60.9/bin/wanna-build-statistics sbuild-0.62.2/bin/wanna-build-statistics --- sbuild-0.60.9/bin/wanna-build-statistics 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/bin/wanna-build-statistics 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -#!/usr/bin/perl -# -# wanna-build-statistics: print statistics for wanna-build databases -# Copyright © 1998 Roman Hodek -# -# 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 -# . -# -####################################################################### - -use strict; -use warnings; -use vars qw($verbose $dist $database); - -sub percent (@); -sub isin ($@); - -$verbose = 0; -$dist = "unstable"; -$database = "build-db"; - -# TODO: Use Getopt::Long. -while( @ARGV && $ARGV[0] =~ /^-/ ) { - $_ = shift @ARGV; - if (/^-v$/ || /^--verbose$/) { - $verbose++; - } - elsif (/^-d/ || /^--dist/) { - if (/^-d(.)/ || /^--dist=(.)/) { - $dist = $1.$'; - } - elsif (!@ARGV) { - die "$_ option missing argument\n"; - } - else { - $dist = shift @ARGV; - } -# TODO: Use distribution list from main configuration - $dist = "oldstable" if $dist eq "o"; - $dist = "stable" if $dist eq "s"; - $dist = "testing" if $dist eq "t"; - $dist = "unstable" if $dist eq "u"; - die "Bad distribution\n" if !isin($dist, qw(stable testing unstable stable-security testing-security oldstable oldstable-security)); - } - elsif (/^--$/) { - last; - } - elsif (/^--database=(.*)$/) { - $database = $1; - } - else { - die "Unknown option: $_\n"; - } -} - -my($lastmsg, %n_state, $total, %n_builder); -open( PIPE, "wanna-build --database=$database --dist=$dist --list=all 2>&1 |" ) - or die "Cannot spawn wanna-build: $!\n"; -while( ) { - if (/^Database for $dist doesn't exist$/) { - exit 1; - } - elsif (/^Total (\d+) package\(s\) in state (\S+)\.$/) { - $n_state{$2} = $1; - } - elsif (/^Total (\d+) package\(s\)$/) { - $total = $1; - } - elsif (/^\S+: (\S+) by (\S+)/) { - $n_builder{$1}->{$2}++; - } - $lastmsg = $_; -} -close( PIPE ); -if ($?) { - print "$lastmsg"; - die "Bad exit status $? from wanna-build\n"; -} - -print "Distribution $dist:\n"; -print "--------------", "-" x length($dist), "\n"; - -my $total_width = 78; - -my @state_list = qw(Installed Needs-Build Building Built - Build-Attempted Uploaded Failed Dep-Wait - Failed-Removed Dep-Wait-Removed Not-For-Us); - -my $statewidth = 0; -grep { $statewidth = length($_) if length($_) > $statewidth } @state_list; -my $startcol = $statewidth + 9; - -my($state, $builder); -foreach $state (@state_list) { - printf "%-${statewidth}s: %5d", $state, $n_state{$state}; - if (!keys %{$n_builder{$state}}) { - print "\n"; - next; - } - my $sum = 0; - foreach $builder (keys %{$n_builder{$state}}) { - $sum += $n_builder{$state}->{$builder}; - } - $n_builder{$state}->{"unknown"} = $n_state{$state} - $sum; - print " ("; - my $is_first = 1; - my $pos = $startcol; - foreach $builder (sort keys %{$n_builder{$state}}) { - next if !$n_builder{$state}->{$builder}; - my $str = "$builder: $n_builder{$state}->{$builder}"; - $str = ", $str" if !$is_first; - $is_first = 0; - if ($pos + length($str) > $total_width) { - print ",\n", " " x $startcol; - $pos = $startcol; - $str =~ s/^, //; - } - print $str; - $pos += length($str); - } - print ")\n"; -} -printf "%-${statewidth}s: %5d\n", "total", $total; -print "\n"; - -$total -= $n_state{"Not-For-Us"}; -print percent(qw(Installed)), " up-to-date, "; -print percent(qw(Installed Uploaded)), " if also counting uploaded pkgs\n"; -print percent(qw(Built Installed Uploaded)), " if also counting built pkgs\n"; -print percent(qw(Needs-Build)), " uncompiled\n"; -print percent(qw(Building)), " currently building (short-term delay)\n"; -print percent(qw(Build-Attempted)), " currently failed building (short-term delay)\n"; -print percent(qw(Failed Dep-Wait)), " failed or waiting (long-term delay)\n"; - -exit 0; - -sub percent (@) { - my $n = 0; - foreach (@_) { - $n += $n_state{$_}; - } - - return sprintf "%6.2f%%", $n*100/$total if $total; - return sprintf "%6.2f%%", 0; -} - -sub isin ($@) { - my $val = shift; - return grep( $_ eq $val, @_ ); -} diff -Nru sbuild-0.60.9/ChangeLog sbuild-0.62.2/ChangeLog --- sbuild-0.60.9/ChangeLog 2011-02-15 00:18:23.000000000 +0000 +++ sbuild-0.62.2/ChangeLog 2011-04-05 09:49:44.000000000 +0000 @@ -1,3 +1,1605 @@ +commit fd9c9216f5c33d20d5b5011655be0f273ee010e7 +Author: Roger Leigh +Date: Tue Apr 5 10:46:54 2011 +0100 + + debian: Log colouring is configurable + +commit 4e4a7c90dd158394e67611c1880af05807ed6d47 +Author: Roger Leigh +Date: Tue Apr 5 10:46:15 2011 +0100 + + NEWS: Log colouring is configurable + +commit 6f8534d2e503245903ce5f0cd81c888f396918ee +Author: Roger Leigh +Date: Tue Apr 5 10:45:57 2011 +0100 + + Sbuild: Allow log colouring to be disabled + +commit 64ff82618b84282a98398ddb3c2d59991e3eeef6 +Author: Roger Leigh +Date: Tue Apr 5 00:26:50 2011 +0100 + + debian: Close #620758 + +commit 9f395ee14caf33352957728a28a2b90ecf7851e1 +Author: Roger Leigh +Date: Tue Apr 5 00:25:18 2011 +0100 + + Sbuild::ConfBase: Set MAILTO from hash in DISTRIBUTION SET trigger + +commit 6d45c877df377f2cc09ea4e62111dc149cde8226 +Author: Roger Leigh +Date: Tue Apr 5 00:24:39 2011 +0100 + + Sbuild::Conf: Set maintainer name in trigger + +commit 328b2f05918edf99d1db8cf8664e00805d7f2579 +Author: Roger Leigh +Date: Tue Apr 5 00:21:44 2011 +0100 + + sbuild: Move binNMU check to top level + + Must be done after processing options, or else it will never work. + +commit 9af4466c20cfb9a31f99cb50a132a433e58cceed +Author: Roger Leigh +Date: Tue Apr 5 00:05:19 2011 +0100 + + debian: Merge buildd-0.61.0 changes + +commit 4bb4614487f3eb2dfcf410121c50406a5dd514ce +Author: Philipp Kern +Date: Sat Apr 2 13:43:14 2011 +0200 + + [Buildd::Daemon] move_to_upload: fix binNMU uploading + +commit b8fba2de0b2c273d2983007135502cc3edc196bc +Author: Philipp Kern +Date: Tue Mar 29 20:11:12 2011 +0200 + + [Buildd::Daemon] support autosigning of binNMUs + +commit 3382ef353c61963d9983a2892731db4f6c9c2f0a +Author: Philipp Kern +Date: Mon Mar 28 21:50:39 2011 +0200 + + [Sbuild::Conf] adjust ENVIRONMENT_FILTER to be sane + +commit b20bb0f6848f8f0b17414ac47f53b523607dc20e +Author: Philipp Kern +Date: Mon Apr 4 23:46:13 2011 +0100 + + Sbuild::Build: Forward port build autosigning + + Sbuild::Conf: Put SIGNING_OPTIONS into an array instead of overwriting + values. + Sbuild::Conf: Handle command-line signing options correctly. + Sbuild::Build: Invoke debsign post-build. + Passing -k to dpkg-buildpackage involves the chroot having access to + key material. Invoking debsign post-build outside of the chroot + seems to make much more sense. It might be interactive at this point + but at least for the buildd.d.o case that's not going to happen, so + that's ignored in this design. + Sbuild::Build: Only try to invoke debsign on successful builds. + +commit 6f9df8381a31b9d4ca8928fe8e6f0cdaec9c3d60 +Author: Roger Leigh +Date: Mon Apr 4 23:18:01 2011 +0100 + + Sbuild::Build: Add extra checks when doing binNMU + + If the maintainer name is unset, this can lead to errors. + Note that this should be detected earlier, but check here + as well to ensure we never use maintainer name undefined. + +commit 5d822d9f99c1601c281cd9cedc337ffeec097beb +Author: Roger Leigh +Date: Mon Apr 4 22:02:59 2011 +0100 + + debian: Close #620112 + +commit 961752291078ffa5f5dcea15be508917dfa0d15d +Author: Anders Kaseorg +Date: Mon Apr 4 21:57:36 2011 +0100 + + Sbuild::Build: Improve binNMU changelog handling + + According to https://wiki.ubuntu.com/MultiarchSpec#Binary%20NMUs , + although a Multi-Arch: same package may not be binNMU’d on individual + architectures, it should be possible to schedule a binNMU on all + architectures at once, and have the resulting packages remain + co-installable. However, this does not quite work right now for a silly + reason: sbuild generates a different timestamp for the binNMU changelog + entry in each build, and the differing changelog.gz files break + co-installability. + + This fixes the problem by generating the timestamp in a deterministic way: + we just copy the timestamp from the previous changelog entry. (Since the + source has not changed since that time, it seems like as good a time as + any to write into the changelog.) + + Certain automated backport setups that use --append-to-version are also + affected by this issue and require this fix as well. + + Use dpkg-parsechangelog to parse previous changelog entry to acquire + all needed information, including the correct date. + + Signed-off-by: Roger Leigh + +commit 40205e7eb6ba199e7a900f27c12c61edd20a6b7c +Author: Roger Leigh +Date: Mon Apr 4 18:11:12 2011 +0100 + + debian: Close #620589 + +commit 9a73da4e5c4b261a549d3942b4469ffe4935bdb3 +Author: Roger Leigh +Date: Mon Apr 4 18:10:21 2011 +0100 + + NEWS: Document log filtering changes + +commit baf300b302d2fab45eaa96c06eea2a95b353600d +Author: Roger Leigh +Date: Mon Apr 4 18:08:16 2011 +0100 + + Sbuild::Conf: Add LOG_FILTER + + Allows disabling of log filtering. + +commit 7bfce2207291c4299f36c85fada45cdb6e43638f +Author: Roger Leigh +Date: Mon Apr 4 18:05:45 2011 +0100 + + Sbuild::Build: Improve clarity of log filtering + + Surround filter string with "«" and "»" so that strings such as + CHROOT and BUILDDIR can't be confused with any actual appearance of + the same string in the build log. + +commit c8e986d023df635dd8e9fc73a4cf45c4b0510765 +Author: Roger Leigh +Date: Mon Apr 4 17:45:30 2011 +0100 + + debian: Close #620797 + +commit cefa705393f0ae4c1f38f8d740eea5f77d0a9a78 +Author: Roger Leigh +Date: Mon Apr 4 17:42:17 2011 +0100 + + Sbuild::ResolverBase: sources.list fragments must have 0644 permissions + + This is needed in order for apt-cache to be able to read them when + running as a normal user (not root). + +commit ead64a7794af0bbac877746c278b41de37ba94a4 +Author: Roger Leigh +Date: Mon Mar 28 23:51:05 2011 +0100 + + Revert "man: Document --suppress-successful-logs" + + This reverts commit c448d24981d6e405e410f40ff83af726a5931edf. + +commit 1bf2b951365ef04ab4492516e32bc0662b8c3cc6 +Author: Roger Leigh +Date: Mon Mar 28 23:50:50 2011 +0100 + + Revert "sbuild: Add new option to suppress log mails for successful builds" + + This reverts commit 81f4ee05f49275fc0417099a9e3f2bd57b3ac001. + +commit ef4dc57770f5ef497ace28310bd20abd3a327136 +Author: Modestas Vainius +Date: Sun Mar 27 00:56:37 2011 +0200 + + Sbuild::Conf: Rename end_session to purge_session + + Rename: + $end_session -> $purge_session + END_SESSION -> PURGE_SESSION + for consistency with the rest of similar sbuild.conf settings. + + Also fix PURGE_SESSION key properties (TYPE, HELP, CHECK) which were forgotten + after copy&paste from PURGE_BUILD_DEPS. + + Signed-off-by: Roger Leigh + +commit c47a8ab88cedc9423aabad7914bb4374952e9cc4 +Author: Roger Leigh +Date: Sat Mar 26 20:52:41 2011 +0000 + + debian: Close #619332 + +commit c703076f82f400ba29990d7f1aee50499698cf13 +Author: Roger Leigh +Date: Sat Mar 26 20:50:43 2011 +0000 + + NEWS: Document --purge-session and $end_session + +commit edec8e64208bc31f8dac4d16f5b03099d73ea7c6 +Author: Roger Leigh +Date: Sat Mar 26 20:46:35 2011 +0000 + + Sbuild::Conf: END_SESSION allows same purge modes as purge options + +commit 466a633a279268bf74db3a385b40d0a70435d73b +Author: Roger Leigh +Date: Sat Mar 26 20:23:26 2011 +0000 + + debian: Close #619526 + +commit 5df906cd22c7f073edb6a51af8a6d49a5e208aa7 +Author: Marc Deslauriers +Date: Sat Mar 26 20:20:27 2011 +0000 + + Sbuild::Build: Add work around for wrong build-essential entry on Ubuntu Lucid + + Work around Lucid issue that has diff listed in build-essential + instead of diffutils. This causes schroots that don't have + universe enabled to fail to install dependencies. (LP: #741897). + This may be worthwhile for Debian users who want to build packages for + Ubuntu. + + Signed-off-by: Roger Leigh + +commit e40ed8704cc7858065d2e443785c9381fc1b1c69 +Author: Roger Leigh +Date: Sat Mar 26 20:18:42 2011 +0000 + + debian: Close #619002 + +commit c448d24981d6e405e410f40ff83af726a5931edf +Author: Roger Leigh +Date: Sat Mar 26 16:28:14 2011 +0000 + + man: Document --suppress-successful-logs + +commit 81f4ee05f49275fc0417099a9e3f2bd57b3ac001 +Author: Philipp Kern +Date: Fri Mar 25 16:19:10 2011 +0100 + + sbuild: Add new option to suppress log mails for successful builds + + With autosigning one might just be interested in processing the failed logs as + the successful logs do not need any manual handling. + +commit 00293ecbb9cd4d639f5d2ad69fd973c66b3fe4f8 +Author: Philipp Kern +Date: Fri Mar 25 15:48:32 2011 +0100 + + [Buildd::Daemon] add arch_all building support + +commit f096e18462a2be6117739bab7eadc383a32ec7b5 +Author: Philipp Kern +Date: Thu Mar 24 21:40:22 2011 +0100 + + [Sbuild::Build] invoke debsign post-build + + Passing -k to dpkg-buildpackage involves the chroot having access to key + material. Invoking debsign post-build outside of the chroot seems to make much + more sense. It might be interactive at this point but at least for the + buildd.d.o case that's not going to happen, so that's ignored in this design. + +commit c725c0a269282654376aa154043c51596205b928 +Author: Philipp Kern +Date: Thu Mar 24 20:46:12 2011 +0100 + + [Sbuild::Conf] handle command-line signing options correctly + + SIGNING_OPTIONS put into an array instead of overwriting values. + +commit a4d14a3b0b19c120b3ff640badfb8d6ce853cefa +Author: Philipp Kern +Date: Thu Mar 24 20:42:29 2011 +0100 + + [Sbuild::Build] check correctly for SIGNING_OPTIONS being an ARRAY + +commit d8cc7e5bea0d51d7550e2eeb66a36eb75906f365 +Author: Philipp Kern +Date: Thu Mar 24 19:58:17 2011 +0100 + + [Buildd::Uploader] make .changes -> .upload substitution clearer + +commit d0de2ffcf4bd31b3235e04938d8e6c7b20aabb9e +Author: Philipp Kern +Date: Thu Mar 24 19:22:45 2011 +0100 + + [Sbuild::Build] attach a .summary file to MIME build logs + +commit 1f688ed937015682b393862c7d8edaaf0295430e +Author: Philipp Kern +Date: Thu Mar 24 15:34:26 2011 +0100 + + [Sbuild::Build] put KEY_ID into the log mail header if set + +commit 914e22d60ccd95ea8cba4733ed698fa81014bc72 +Author: Philipp Kern +Date: Thu Mar 24 15:29:48 2011 +0100 + + [Buildd::Daemon] put signed builds into the upload queue + +commit 76bb3689f4ebd1c8a38b936d38c1a13c9e08cdca +Author: Philipp Kern +Date: Thu Mar 24 15:07:25 2011 +0100 + + [Buildd::Daemon] pass SIGN_WITH as keyid to sbuild + +commit da7e48b9b33c289b5342e51dfd822f32ae5767b9 +Author: Philipp Kern +Date: Thu Mar 24 15:02:45 2011 +0100 + + [Buildd::DistConf] SIGN_WITH added as a new variable + +commit 7e4e1f96a86c6b624649643fb79657d150a78535 +Author: Philipp Kern +Date: Thu Mar 24 14:53:43 2011 +0100 + + [Buildd::Daemon] remove unused read_config function + +commit 276a761cdbba468d787b4340c5ccec83f76d1a7f +Author: Philipp Kern +Date: Sat Mar 19 14:48:55 2011 +0100 + + debian/rules: do not install the init script on buildd builds + +commit 1759b73076705676e14747c174efe86184928746 +Author: Philipp Kern +Date: Sat Mar 19 14:44:12 2011 +0100 + + debian/buildd.*{inst,rm}: remove 0.58.3-1 upgrade code + +commit 66024919a6f64ecec8873b3bc1a34249f5112b94 +Author: Andreas Barth +Date: Sat Feb 19 14:03:52 2011 +0100 + + squeeze released: git rid of etch-only code, change codenames in creat-chroot + +commit 83012e2f6001c2391c9ebccd339b7e5bed56c1b0 +Author: Andreas Barth +Date: Sun Mar 13 22:50:09 2011 +0100 + + take build_dep_resolver from wanna-build if not locally configured + +commit 90d94ba3b20c9bb84f78b0b4ac03170039df1e05 +Author: Roger Leigh +Date: Sat Mar 26 15:08:15 2011 +0000 + + .gitignore: Add newly-generated files + +commit 1489e252d1479bb60adc6eef590b86191e5ea847 +Author: Philipp Kern +Date: Fri Mar 25 22:10:35 2011 +0100 + + [Buildd::Daemon] fix up retry + +commit 085708fe07458005b4c2495d37af705447b0dbf5 +Author: Roger Leigh +Date: Wed Mar 23 23:56:58 2011 +0000 + + Sbuild::Build: Don't log repeated schroot deprecation warnings + + Log only once, then ignore subsequent messages. + +commit 65cc424b4e54a8d61a3a451473b750b50b5258dd +Author: Roger Leigh +Date: Wed Mar 23 23:26:11 2011 +0000 + + TODO: Update + +commit faca465524877d3a6e77888e96ca96402b541d08 +Author: Roger Leigh +Date: Wed Mar 23 23:25:57 2011 +0000 + + debian: Close #619416 + +commit e6089d3188af7ff9c24b00f5f310cbf88e8cc62c +Author: Roger Leigh +Date: Wed Mar 23 23:23:16 2011 +0000 + + Sbuild::Conf: Don't output BUILD_DIR by default + + Since it's build-specific, don't use in sbuild.conf or + sbuild.conf(5). + +commit 2b7bf4a4bdaf2819b11a7c267e558c8b1f2746dd +Author: Roger Leigh +Date: Wed Mar 23 12:50:44 2011 +0000 + + Sbuild::ConfBase: Warn if $HOME is unset + +commit f5ea293c906298ffd2b3f7a974d90d072becdad0 +Author: Roger Leigh +Date: Wed Mar 23 10:40:57 2011 +0000 + + debian: Close #619288 + +commit 53f56cc34a416b60573fb7d0f5fb2ad39e4671c6 +Author: Roger Leigh +Date: Wed Mar 23 10:36:16 2011 +0000 + + Sbuild::ConfBase: Don't fail if HOME is unset + + If HOME not set in the environment, fall back to passwd.pw_dir. + Fail outright if passwd entry for the current user does not exist, + and don't fall back to LOGNAME or USER in the environment, just + take it directly from passwd. + +commit b6f226ff0f7477f939b1c6498da526cc0a8be533 +Author: Roger Leigh +Date: Mon Mar 21 14:53:30 2011 +0000 + + debian: Close #619128 + +commit 45ef2313c76e40cee0bdc13f9405a07217c87f4e +Author: Roger Leigh +Date: Mon Mar 21 14:52:22 2011 +0000 + + wrapper: Allow root to bypass sbuild group membership checks + +commit 7f52bf7c7e7881d49e549b0b3e46d53e6bc806d0 +Author: Roger Leigh +Date: Mon Mar 21 14:52:02 2011 +0000 + + debian: Bump version to 0.62.2-1 and document new options + +commit 7f07ed01fedc85d9ac4c66d4ecfcce4758412333 +Author: Roger Leigh +Date: Mon Mar 21 14:51:16 2011 +0000 + + NEWS: Bump version to 0.62.2 and document new options + +commit b192bfc15d13e4f2d1be9b8ac065c0a4b9b556ba +Author: Roger Leigh +Date: Mon Mar 21 14:41:32 2011 +0000 + + Buildd::Daemon: Don't upgrade or distupgrade running sbuild + +commit f311dfece392534f25b03dace02d75fed6997e86 +Author: Roger Leigh +Date: Mon Mar 21 11:00:33 2011 +0000 + + sbuild: Add --no-apt-* options to disable default actions + + Allows disabling of apt clean, update, upgrade and distupgrade + actions. + +commit 516552e446a47e5908ca3b17dc5ebaa172962066 +Author: Roger Leigh +Date: Sun Mar 20 23:06:58 2011 +0000 + + debian: Bump version to 0.62.1-1 and fix sbuild-schroot wrapper + +commit 767defee367ff548f14c6347aff899307c52e7d5 +Author: Roger Leigh +Date: Sun Mar 20 23:06:37 2011 +0000 + + NEWS: Document sbuild-schroot permissions checking fix + +commit 9607fdaacebe9c4008efbeaaaa7defa5ec36ce56 +Author: Roger Leigh +Date: Sun Mar 20 22:58:58 2011 +0000 + + Sbuild::ResolverBase: Remove File::Path dependency + +commit a4527c3dfc782204b6d1c6b28818e52249aef9f6 +Author: Roger Leigh +Date: Sun Mar 20 22:36:25 2011 +0000 + + wrapper: Enforce group access checks + +commit 07bf64f9c1c9664b2a7562412bacaba316faf802 +Author: Roger Leigh +Date: Wed Mar 16 18:57:32 2011 +0000 + + Sbuild::ConfBase: Really permit check disabling during build + +commit cb626bfbac1d562ac9861a097bba50130e91b42a +Author: Roger Leigh +Date: Wed Mar 16 18:57:10 2011 +0000 + + debian: Add missing perl modules for autobuilding + +commit 0cff4863c1753b16efeaab4a73e693ce2d60493b +Author: Roger Leigh +Date: Wed Mar 16 16:10:44 2011 +0000 + + debian: Document MIME and compression of log mails + +commit 0414e5c0c6828050a6f2cc93f34bc64e8b358b1f +Author: Roger Leigh +Date: Wed Mar 16 16:10:06 2011 +0000 + + NEWS: Document MIME and compression of log mails + +commit 89a5a371ae375f23a7622ee2396f19bde04f77b2 +Author: Roger Leigh +Date: Wed Mar 16 16:09:46 2011 +0000 + + Sbuild::Conf: Make MIME and log compression the default + +commit ecdac9e186cde1f47ca4f656bbf302ac064c6730 +Author: Roger Leigh +Date: Wed Mar 16 12:52:59 2011 +0000 + + Sbuild::Chroot: Don't run sudo with -p + + '-p' leads to $USER being root, and consequent permissions errors + when trying to read files under /root. + +commit f4318e2d2fa499539ae29fbfe6d9a7327b64a1b3 +Author: Roger Leigh +Date: Wed Mar 16 12:52:15 2011 +0000 + + Sbuild::ChrootSetup: Enable privilege separation for generating keys + +commit 7a8d8fc292a3568e338634b7caf899325da55ede +Author: Roger Leigh +Date: Wed Mar 16 12:51:43 2011 +0000 + + sbuild-update: Create only one ChrootRoot object + +commit bb252ed2a5484b420ab14300d1531292ae656129 +Author: Roger Leigh +Date: Wed Mar 16 11:48:15 2011 +0000 + + Sbuild::Build: Remove log compression without MIME + +commit 1fbe5fec065681938d8ee8c106300b48c8a52f64 +Author: Roger Leigh +Date: Fri Mar 11 09:47:26 2011 +0000 + + debian: Add lintian override for sbuild setuid wrapper + +commit 206b6b0f547966ca2363450608403cc31a37c779 +Author: Roger Leigh +Date: Fri Mar 11 09:45:46 2011 +0000 + + debian: Fix buildd sbuild dependency for binNMU now it's arch-any + +commit 347a63f7f8c5895e0e874af17895777ead34e38e +Author: Roger Leigh +Date: Fri Mar 11 09:41:25 2011 +0000 + + debian: Bump version to 0.62.0-1 + +commit ba9f20e072c57651205594b146a48cbca339439a +Author: Roger Leigh +Date: Fri Mar 11 09:41:06 2011 +0000 + + NEWS: Bump version to 0.62.0 + +commit b3a341b7738599a7530641ef99feca411ec7347c +Author: Roger Leigh +Date: Fri Mar 11 09:39:40 2011 +0000 + + debian: Tidy changelog + +commit c1915ab66ddce10766c8f2439b45ba13edcb1eed +Author: Roger Leigh +Date: Fri Mar 11 09:39:32 2011 +0000 + + NEWS: Tidy + +commit 70174465eb0f23caf0f9e99246bb4080e5c43327 +Author: Roger Leigh +Date: Thu Mar 10 22:39:32 2011 +0000 + + debian: Document build dir name change + +commit 937047e1a574e575dcd047ef2ac943ae4c06b789 +Author: Roger Leigh +Date: Thu Mar 10 22:39:17 2011 +0000 + + NEWS: Document build dir name change + +commit 4905add4b224678d0cb82aa124e5a23d56b6af1d +Author: Roger Leigh +Date: Thu Mar 10 22:34:42 2011 +0000 + + Sbuild::Build: Shorted chroot build directory. + + Now /build/packagename-XXXXXX instead of + /build-packagename_shortversion-archname-XXXXXX. + + This will reduce the chance of build failure on some architectures + with path length limitations, and also for (buggy) packages using + sockets, which also have a very short length limit. + +commit 94cf8c681f899241da9b97b93c0e5b2c3e286f08 +Author: Roger Leigh +Date: Thu Mar 10 20:07:01 2011 +0000 + + debian: Amend wanna-build removal comments + +commit e9e5d41bffaf712c6d1540c5597716eafaceb218 +Author: Roger Leigh +Date: Thu Mar 10 20:06:44 2011 +0000 + + NEWS: Document wanna-build removal + +commit 72f987c0a03e58358ea616628514efa0113f0332 +Author: Roger Leigh +Date: Thu Mar 10 19:02:33 2011 +0000 + + Sbuild::DB::Client*: Rename to Buildd::Client* + +commit bcb2ba816074de1a97582eff100aa0b0e5658bd5 +Author: Roger Leigh +Date: Thu Mar 10 18:54:30 2011 +0000 + + etc: Remove wanna-build.conf + +commit 087047679e8845e38041224d0f0bf21b83f959a0 +Author: Roger Leigh +Date: Thu Mar 10 18:50:53 2011 +0000 + + wanna-build: Remove + +commit cb5ffa9e11129a822e9ea117adfef266467b0b0b +Author: Roger Leigh +Date: Thu Mar 10 17:43:10 2011 +0000 + + debian: Remove wanna-build + +commit e0d3a270a3b1dfdd59b589a800a0ff424806bba5 +Author: Roger Leigh +Date: Thu Mar 10 16:37:29 2011 +0000 + + build: Add uninstall logic + +commit 23c116163a8fa3f3f77d45f32d76814367c87678 +Author: Roger Leigh +Date: Thu Mar 10 16:36:57 2011 +0000 + + Sbuild::Build: Only send mail after the build log has been closed + +commit d98e17dbccd0846abf2801edbe470aa23f357a3c +Author: Roger Leigh +Date: Thu Mar 10 16:36:25 2011 +0000 + + Sbuild::AptitudeResolver: Don't use Dpkg::Deps + +commit 13cfcfc820f93aeca30f8ee883575889958d462d +Author: Roger Leigh +Date: Thu Mar 10 15:21:43 2011 +0000 + + debian: Document coloured messages + +commit 00569948192cefd57d7ce7517d830b5f18e4a61f +Author: Roger Leigh +Date: Thu Mar 10 15:21:33 2011 +0000 + + NEWS: Document coloured messages + +commit f3c4b06fdc107a82e98edb2596a2b01adcbd2586 +Author: Roger Leigh +Date: Thu Mar 10 15:17:28 2011 +0000 + + Sbuild::Build: Colourise logs when logging to a TTY + + Errors, Warnings and Info messages are coloured red, yellow and + green respectively. Build status is also coloured green for + success and red for all failures. Note that this does not affect + the logfiles or noninteractive log redirection. It is only + enabled when running interactively and attached to a TTY. + +commit a0149d3f01947517ef6e7a300c02af850f9e69f4 +Author: Roger Leigh +Date: Thu Mar 10 14:42:53 2011 +0000 + + debian: Close #605763 + +commit 08c2db2a0c73b15f2cf73e21eb6c68a699053b9e +Author: Roger Leigh +Date: Thu Mar 10 14:42:43 2011 +0000 + + NEWS: Document log filtering + +commit d75049aef03682935686863a487ea65559c47886 +Author: Roger Leigh +Date: Thu Mar 10 14:28:45 2011 +0000 + + Sbuild::Build: Filter log messages + + Add the ability to filter out certain strings in the build log and + replace them with a shorter form. This makes the build logs + diffable between builds because the temporary chroot and build + directory paths are replaced with a constant short name. + +commit 9d21d901b62e39c9275adbae4e9e2da5f515ebf4 +Author: Roger Leigh +Date: Thu Mar 10 14:27:58 2011 +0000 + + Sbuild::Build: Minor logging enhancements + +commit 3e1be14f06aad40fa59b00466c72d041ef57f124 +Author: Roger Leigh +Date: Thu Mar 10 14:25:44 2011 +0000 + + Sbuild::Build Rename abort to request_abort + + This avoids a name clash with the POSIX::abort function + +commit cca8c8fa2483bcd2bdb9b040b0fc94231e7d0e50 +Author: Roger Leigh +Date: Thu Mar 10 12:45:50 2011 +0000 + + debian: Document signal handling + +commit 1d48ef90bd8c51ee41aa0bb803065fc56c1f812f +Author: Roger Leigh +Date: Thu Mar 10 12:45:38 2011 +0000 + + NEWS: Document signal handling + +commit e206f9620435f2a18bad2464a7d904c649a42cde +Author: Roger Leigh +Date: Thu Mar 10 12:39:24 2011 +0000 + + sbuild: Add safe signal handling + + Remove all cleanup logic from the shutdown signal handler. The + handler now just calls the abort method on the Build object, which + sets an ABORT variable containing the reason for aborting. The build + sequence calls the check_abort method to poll for an ABORT request at + frequent intervals (before every long running job, and for each log + line printed when dpkg-buildpackage is being run. + + The normal cleanup and shutdown logic is used on trapping a signal, + so the chroot should always be left clean. Once exception is if hitting + C-c from a shell, which may cause SIGINT to be sent to all processes in + the process group when apt-get or aptitude are part way through + installing packages. This may or may not result in a bad package state + inside the chroot (but is more reliable than the existing method). + Signals may now also be received multiple times, leading to multiple + ABORT requests, but not premature program termination. + +commit fe05ff0952d19bee8e9eac601eece95772fcc2dc +Author: Roger Leigh +Date: Thu Mar 10 00:51:31 2011 +0000 + + debian: Document exceptions and logging + +commit 9701ec6c0faa8b2cf60e4aef11ac88f6909d8922 +Author: Roger Leigh +Date: Thu Mar 10 00:51:21 2011 +0000 + + NEWS: Document exceptions and logging + +commit 690c24bea7b3ee436ab3947cb166f040da1d6513 +Merge: ce5254c 35a80fb +Author: Roger Leigh +Date: Thu Mar 10 00:46:52 2011 +0000 + + Merge branch 'master' into exception-handling + + Conflicts: + lib/Sbuild/Build.pm + +commit 35a80fb0e6ee4c28e4a266abbe2da1281e8a8b25 +Author: Roger Leigh +Date: Thu Mar 10 00:38:37 2011 +0000 + + debian: Document sbuild user and privilege separation + +commit a634b464889693c9170f73c56d03d8c37046d2ac +Author: Roger Leigh +Date: Thu Mar 10 00:38:19 2011 +0000 + + NEWS: Document sbuild user and privilege separation + +commit d2a2d43a7e3ea2d7ce109172299d3e5f7cadf01d +Author: Roger Leigh +Date: Thu Mar 10 00:29:44 2011 +0000 + + sbuild: Use sbuild user for building + + Rather than using the user invoking sbuild, everything inside the + chroot is done either as root or sbuild. The intention behind this + is to increase the privilege separation between the user and sbuild, + with the ultimate aim being the user having no access to the build + chroot; all access will be mediated via sbuild. The current change + has several implications: + + - a wrapper program, sbuild-schroot is used to run schroot. This + handles switching to the sbuild user inside the chroot. + - all files created inside the chroot must be owned and writable + by user and group sbuild. The user ownership is required so that + the sbuild user can create and delete files. The group ownership + is so that the user can create and delete files. + - group write access is removed during the build stage, to prevent + external tampering. + + Note that due to the architecture of sbuild, the user may still + interfere with the process themselves, and gain root inside the + chroot either via schroot or sbuild-schroot. These loopholes will + be closed by future changes. The current changes do prevent + accidental tampering, but not deliberate interference. + +commit 5342feb52ef29b803bcccf5a8a56e14017d5ee1d +Author: Roger Leigh +Date: Wed Mar 9 22:34:11 2011 +0000 + + debian: Install sbuild-schroot wrapper + + sbuild is now an arch-any package + Also add build-arch/indep and install-arch/indep rules. + +commit d260a28f26a1ef2693343a7b92bf1d80a6a75bcf +Author: Roger Leigh +Date: Wed Mar 9 22:31:34 2011 +0000 + + Sbuild::Conf: Allow consistency checks to be avoided for dumpconfig + + sbuild-dumpconfig should be able to dump the defaults whether or + not the system or user configuration is sane. Here, we don't load + the system configuration, and avoid validation of everything else. + + Also, print 1; at the end of the configuration output to make it + valid Perl. + +commit b485bb3e5a213a4a7bf40547327d6dacc02c3439 +Author: Roger Leigh +Date: Wed Mar 9 22:30:07 2011 +0000 + + debian: libexecdir is /usr/lib + +commit c6887d7e28ceafda86c915dea54379125a3d070f +Author: Roger Leigh +Date: Wed Mar 9 22:29:16 2011 +0000 + + build: Use datadir rather than libexecdir for scripts + +commit ee04dc8f8cff2d7a3ee200c50bd695f2c801a25a +Author: Roger Leigh +Date: Wed Mar 9 22:14:08 2011 +0000 + + wrapper: Wrap schroot invocation to run as sbuild user + +commit ce5254cbf8e2b962b0c4ce2aaf67fbd4977087c4 +Author: Roger Leigh +Date: Tue Mar 8 23:50:55 2011 +0000 + + Sbuild::Build: Fail Stage only set in run() functions + +commit 2e366ac92eb597be2f399fde716f49006a34ac06 +Author: Roger Leigh +Date: Tue Mar 8 23:48:43 2011 +0000 + + Sbuild::Build: Throw exceptions doing hack binNMU + +commit 6d43309aedaf0712f0c79c348bfe0d9b0169382c +Author: Roger Leigh +Date: Tue Mar 8 23:44:22 2011 +0000 + + Sbuild::Build: Throw exception in build version check + +commit 162ce402b1f4ae2346815f1812920380fe0b06e5 +Author: Roger Leigh +Date: Tue Mar 8 23:37:27 2011 +0000 + + Sbuild::Build: build does not remove build tree + + There's no need to remove a dirty tree before unpacking; we now always + build in a unique temporary directory, so this is a no longer existing + problem. We also don't remove the build tree on failure--this has + been taken care of by the top-level cleanup routines for ages. + +commit 3dd5f7659cb0aa679a5df69c0d4168af9fb90850 +Author: Roger Leigh +Date: Tue Mar 8 23:35:20 2011 +0000 + + Sbuild::Build: Throw exceptions in open_build_log and build + +commit 6d7c7eee0eb496c850ba5b9b6a5ac8249e6760d1 +Author: Roger Leigh +Date: Tue Mar 8 23:24:52 2011 +0000 + + Sbuild::Build: chroot_arch throws exception on failure + +commit 2699a5c80b17b8bb96feb30c9428683ce5951b06 +Author: Roger Leigh +Date: Tue Mar 8 23:21:09 2011 +0000 + + Sbuild::Build: Split source packing and chroot update from run() + +commit a7bcb3b86198aaaecbb161fdef08e8e5913b3ddb +Author: Roger Leigh +Date: Tue Mar 8 22:49:28 2011 +0000 + + Sbuild::Build: Add exceptions for arch and space checks + +commit 6ece8b6899a3d2304983cfe0bbd485fd6aaab38a +Author: Roger Leigh +Date: Tue Mar 8 22:49:00 2011 +0000 + + Sbuild::Build: Remove unused 'Pkg Fail Stage' setting + +commit a6c0a057fe7269d9959b7cf9b8b1c537020901b5 +Author: Roger Leigh +Date: Tue Mar 8 22:48:18 2011 +0000 + + Sbuild::Build: Log exceptions prior to closing build log + +commit 6fe66218642eb128d5ba0e7cc83ac4c007148674 +Author: Roger Leigh +Date: Tue Mar 8 22:46:29 2011 +0000 + + Sbuild::Exception: Add status field + +commit c533951b86d51f8c00e8e5598750a0eadf89209e +Author: Roger Leigh +Date: Tue Mar 8 21:59:32 2011 +0000 + + sbuild: Add exception handler around Sbuild::Build::run + +commit 0580049fa2344260c739371a176aef94e21fbd58 +Author: Roger Leigh +Date: Tue Mar 8 21:59:12 2011 +0000 + + Sbuild::Build: set_dsc throws exception on failure + +commit 06049e6177c2e15ffa74b56eeb607db903af9230 +Author: Roger Leigh +Date: Tue Mar 8 22:19:38 2011 +0000 + + Sbuild::Build: Add exceptions to run() + + run() currently uses a number of gotos and labels to clean up on + error. Unfortunately, this logic is both complex and fragile; + cleanup tasks need doing in the correct order, or not at all. + run() has been split up into separate functions to make the nested + logic explicit, and now throws exceptions on failure; cleanup can + be done before or inside the exception handlers, and the exceptions + may be rethrown to allow cleanup back up the call stack. + +commit 11c9c7eca504748408c57f96aacbf5f58e51336c +Author: Roger Leigh +Date: Tue Mar 8 22:12:44 2011 +0000 + + debian: Build-Depend upon libexception-class-perl + +commit 99e127e446470810057960b8886288a222be7fa9 +Author: Roger Leigh +Date: Tue Mar 8 22:19:00 2011 +0000 + + Sbuild::Exception: New exception classes + + Add exception classes using Exception::Class. + +commit 8180f64ddead777c63778c671c417e57799a9b7d +Merge: 6befac4 39ac178 +Author: Roger Leigh +Date: Tue Mar 8 00:23:07 2011 +0000 + + Merge branch 'master' of ssh+git://git.debian.org/git/buildd-tools/sbuild + +commit 6befac4735626faae4192e4fd878aa9123206b92 +Author: Roger Leigh +Date: Tue Mar 8 00:09:59 2011 +0000 + + sbuild-apt: Run apt via the resolver + +commit 6f9ea88265ccaff48ab51d8c331b3fcde7799576 +Author: Roger Leigh +Date: Mon Mar 7 21:16:41 2011 +0000 + + debian: Document buildd.conf and buildd.conf(5) + +commit ded886270586faf49c9085a4783097ff57ef12fa +Author: Roger Leigh +Date: Mon Mar 7 21:16:28 2011 +0000 + + debian: Install buildd.conf(5) + +commit 61ad3b41be09d9b47ed20767070cebdf980f6ef3 +Author: Roger Leigh +Date: Mon Mar 7 21:16:11 2011 +0000 + + NEWS: Document buildd.conf and buildd.conf(5) generation + +commit 2d23287c3d6139089a95c7cbfa12266775e50b85 +Author: Roger Leigh +Date: Mon Mar 7 21:11:04 2011 +0000 + + build: Use absolute paths when running scripts + +commit f80c16669d0c66e7f1e92e2dc824599118ed432c +Author: Roger Leigh +Date: Mon Mar 7 18:51:38 2011 +0000 + + Build::Conf: Add metadata and use generic Sbuild::Conf read + +commit 39ac17865eb723923748b6edac215d983a9b82d1 +Merge: 871a916 62ff1e4 +Author: Philipp Kern +Date: Mon Mar 7 22:02:33 2011 +0100 + + Merge branch 'buildd-0.61.0' + +commit 62ff1e479fe132fb7125e62b7a4fd0577396d5a9 +Author: Philipp Kern +Date: Mon Mar 7 21:59:49 2011 +0100 + + etc/25nssdatabases: exit cleanly if 20nssdatabases is found + + By exiting when 20nssdatabases is present we should achieve compatibility with + both schroot from lenny (which doesn't ship this script) and squeeze (which + has its nssdtabases configuration file format a bit different). + +commit a098125508ac39c65865db7a78330187eb8bdb29 +Author: Philipp Kern +Date: Mon Mar 7 21:47:07 2011 +0100 + + [Buildd::Daemon] only push NICE_LEVEL to sbuild_args if not zero + +commit 16a72bafe4c0f5dd21d1fd19f66064174578813d +Author: Roger Leigh +Date: Mon Mar 7 18:49:56 2011 +0000 + + Sbuild::Conf: Use Sbuild::ConfBase generic read + +commit 8a3f9d4336abe1a63e33dc3645004b977f4e4095 +Author: Roger Leigh +Date: Mon Mar 7 18:49:25 2011 +0000 + + Sbuild::ConfBase: Add generic read function + +commit 871a916a77cefef550ad6b5886de7b67a724d3e9 +Author: Philipp Kern +Date: Mon Mar 7 18:22:06 2011 +0100 + + [Buildd::Uploader] drop unused Sbuild module usage + +commit ccc1fd505d0bd3dc0edce56743669f1546801598 +Merge: 2d2dc6a 8614f40 +Author: Philipp Kern +Date: Sun Mar 6 23:51:14 2011 +0100 + + Merge branch 'buildd-0.61.0' + + * buildd-0.61.0: + [Sbuild::Chroot] guard ENVIRONMENT_FILTER usage + [Buildd::Daemon] configuration loading is now implicit + + * Dropped for master (buildd-specific): + debian: Bump version to 0.61.0buildd0 + debian: Enable compatibility features on buildds + +commit 8614f407e7b04f68096f577f22edddbdf6186876 +Author: Philipp Kern +Date: Sun Mar 6 23:30:00 2011 +0100 + + [Sbuild::Chroot] guard ENVIRONMENT_FILTER usage + +commit e1f7219828e799941dea5974178f066752b04742 +Author: Philipp Kern +Date: Sun Mar 6 23:23:08 2011 +0100 + + [Buildd::Daemon] configuration loading is now implicit + +commit 2d2dc6abde59abf0ac6940cf35aad7449d6ed564 +Merge: 0878859 28f3d0e +Author: Philipp Kern +Date: Sat Mar 5 11:25:52 2011 +0100 + + Merge branch 'buildd-0.60.0' + + Conflicts: + debian/control + lib/Sbuild.pm + lib/Sbuild/Build.pm + lib/Sbuild/Conf.pm + +commit 28f3d0e67853098788e9701e247a96de1911f876 +Author: Philipp Kern +Date: Fri Mar 4 18:32:37 2011 +0100 + + Allow MIME encoded build logs. + + If $mime_build_log_mails is set to 1, then you will get a multipart/mixed mail + comprising either one or two parts: the build log is always included as an + attached file, the .changes file is attached only if the build completed + successfully. If $compress_build_log_mails is set to 1, then the build log + will be sent gzip-encoded instead of plain text. + + Signed-off-by: Philipp Kern + +commit f1a7d0b06ff02c95b92f4f025450063e5c281e10 +Author: Philipp Kern +Date: Wed Mar 10 14:31:52 2010 +0000 + + sbuild: implement build log mail compression + +commit 08788592fc0000f87504b7ace9c2d4bea9292155 +Merge: a3041fc 0f256e9 +Author: Philipp Kern +Date: Tue Mar 1 22:41:33 2011 +0100 + + Merge branch 'buildd-0.60.0' + +commit 0f256e92e6f4e017b60c24aea7895b4d551f1a01 +Author: Philipp Kern +Date: Tue Mar 1 22:40:42 2011 +0100 + + [Buildd::Mail] add more logging for check_state retries + +commit a3041fce9351dad1a9e1ca5b009d4f69afac6d60 +Merge: c940aa2 1c08113 +Author: Roger Leigh +Date: Mon Feb 28 23:03:07 2011 +0000 + + Merge branch 'master' of ssh+git://git.debian.org/git/buildd-tools/sbuild + +commit c940aa2c73088cf6d2136a0fb84831cdb13238de +Author: Roger Leigh +Date: Mon Feb 28 22:58:42 2011 +0000 + + build: Automatically generate sbuild.conf and buildd.conf + +commit 1675af614617dc19a5e88ee17af32193f72993c4 +Author: Roger Leigh +Date: Mon Feb 28 22:51:41 2011 +0000 + + man: Add buildd.conf.5 manpage (generated) + +commit 3f48017ace6919484c327016a2f44727b5562db8 +Author: Roger Leigh +Date: Mon Feb 28 22:50:57 2011 +0000 + + sbuild-dumpconfig: Don't dump ignored defaults for manpages + +commit edc83413821f2abf44a0ffeac3e471902d15888f +Author: Roger Leigh +Date: Mon Feb 28 22:45:01 2011 +0000 + + Buildd::Conf: Ignore correct keys + +commit 5bcff99b458b591f7dab5beaf84fb87677f3fa79 +Author: Roger Leigh +Date: Mon Feb 28 22:39:18 2011 +0000 + + Buildd::Conf: Annotate all configuration keys + + Ignore DISTRIBUTIONS and UPLOAD_QUEUES because these are complex + types that don't currently dump cleanly. + +commit 1536dff220f92be2209f727cb9ff8593922d6438 +Author: Roger Leigh +Date: Mon Feb 28 22:39:00 2011 +0000 + + Sbuild::DB::ClientConf: Annotate all configuration keys + +commit a6a3b48b083d96ae489df4135ef59ec117553635 +Author: Roger Leigh +Date: Mon Feb 28 22:38:31 2011 +0000 + + sbuild-dumpconfig: Allow defaults to be ignored + +commit 1c08113c274be1d08d87f59145a0583b0d540658 +Merge: 4638fbc 81e7444 +Author: Philipp Kern +Date: Mon Feb 28 21:16:36 2011 +0100 + + Merge branch 'buildd-0.60.0' + + Conflicts: + lib/Buildd/Mail.pm + +commit 81e744406835e8ca553d142185219393dc5840fb +Author: Philipp Kern +Date: Mon Feb 28 20:51:41 2011 +0100 + + [Buildd::Mail] check_state: back off for 0..120s on db query failure + +commit f5cccb5808f38a2a66b2c761c0e2905ad1cc8fa5 +Author: Philipp Kern +Date: Mon Feb 28 19:45:58 2011 +0100 + + [Buildd::Mail] also import exitstatus from Buildd + +commit 764cfe9451c2965d387f9371c0eeeec5943c3e35 +Author: Philipp Kern +Date: Mon Feb 28 19:35:28 2011 +0100 + + [Buildd::Mail] check_state: check w-b pipe exit status + +commit 4638fbcf4888008a0fe34a20ea1fd56643b0ebb9 +Author: Roger Leigh +Date: Sun Feb 27 22:01:19 2011 +0000 + + debian: Fix typo + +commit 8cbc575717549801b9b272a66136f6f126fa7d4a +Author: Roger Leigh +Date: Sun Feb 27 22:00:45 2011 +0000 + + NEWS: Fix typo + +commit bc951c6a74b08b58d5de42870e0f3bbefd1e5999 +Author: Roger Leigh +Date: Sun Feb 27 17:43:49 2011 +0000 + + Sbuild::ConfBase: Add GET handler for OVERRIDE_DISTRIBUTION + +commit 2f0206570584a61e24144788ca25fff84ed6510d +Author: Roger Leigh +Date: Sun Feb 27 17:43:17 2011 +0000 + + Sbuild::Conf: Handle VERBOSE correctly in interactive sessions + +commit dd7d4c5461a77e1e333381a452d0af9a1ea94643 +Author: Roger Leigh +Date: Sun Feb 27 17:42:51 2011 +0000 + + Sbuild::Conf: Use _get where defaults are useful + +commit a448fb449644eb9934b06bba800a94065e6e2bae +Author: Roger Leigh +Date: Sun Feb 27 17:42:16 2011 +0000 + + Sbuild::Conf: Add GET handler for MAILTO + +commit 835f9d3f0e9852b2cfeaf5295b148cc81f9f9041 +Author: Roger Leigh +Date: Sun Feb 27 17:41:18 2011 +0000 + + Sbuild::Conf: Don't directly set LOG_DIR_AVAILABLE + +commit 3c0d7efb10f05d9f5db1c78940ad88b3b38dd85e +Author: Roger Leigh +Date: Sun Feb 27 17:40:14 2011 +0000 + + Sbuild::ConfBase: Add _get method to get value or default + + Useful in GET blocks. + +commit b1c0767264002f26269b6e27ce3b2cc8e5b73a44 +Author: Roger Leigh +Date: Sun Feb 27 15:48:42 2011 +0000 + + debian: Close #609658 + +commit c0674eb4d2abe0819867f5dd2116f7d5d4917535 +Author: Roger Leigh +Date: Sun Feb 27 15:48:26 2011 +0000 + + NEWS: Document --keep-session + +commit a7cf2535290add1a6b7c90fbfc4b534be201bb28 +Author: Roger Leigh +Date: Sun Feb 27 15:44:36 2011 +0000 + + Sbuild::Build: Purge options do not affect session ending. + + Add separate END_SESSION configuration key, which is changed with + the --keep-session option. + +commit 098b2c964c4994a37d0411aa560ff020e8075bb2 +Author: Roger Leigh +Date: Sun Feb 27 15:34:34 2011 +0000 + + debian: Document dist-upgrade change + +commit 2404bd3f88a296361c70d33bcf13bf3f00a0dec9 +Author: Roger Leigh +Date: Sun Feb 27 15:34:25 2011 +0000 + + NEWS: Document dist-upgrade change + +commit 4c29db4de7587e12c3b609e4350408b0280b82c2 +Author: Roger Leigh +Date: Sun Feb 27 15:31:23 2011 +0000 + + Sbuild::Conf: Run apt-get dist-upgrade by default + + Previously, we were running upgrade by default. dist-upgrade + is not much more dangerous, and it means that less manual + intervention is required to keep chroots up-to-date. + +commit ae7f064807fa475f36e04fe2b42d92b848d4139b +Author: Roger Leigh +Date: Sun Feb 27 14:05:44 2011 +0000 + + debian: Close #610995 + +commit fcaf31910d4b5cb12c026fe7f02e44fd76e0164c +Author: Roger Leigh +Date: Sun Feb 27 13:59:58 2011 +0000 + + debian: Close #576508 and #609932 + +commit 6dbcbe4489e28ac9954e074efece6df17cb72706 +Author: Roger Leigh +Date: Sun Feb 27 12:57:16 2011 +0000 + + debian: Deprecate non scalar types in sbuild.conf + +commit b468818a6f03baf0443e7b9254c8037ce49ef035 +Author: Roger Leigh +Date: Sun Feb 27 12:56:58 2011 +0000 + + NEWS: Deprecate non scalar types in sbuild.conf + +commit 3fa12596c1004deebb9999a6bbe21bd6ee2d061b +Author: Roger Leigh +Date: Sun Feb 27 12:52:36 2011 +0000 + + Sbuild::Conf: Use dynamically generated script to parse configuration + + This removes the need to hand-maintain the parser. + Non-scalar types are special-cased for backward compatibility (and + deprecated). + +commit 0b6cf0e259996e4dccae8f20e2f8c7e1c5810a82 +Author: Roger Leigh +Date: Sun Feb 27 12:38:34 2011 +0000 + + Sbuild::ConfBase: Add GET handler for VERBOSE + + Allows more sensible default interactive/noninteractive behaviour. + +commit 0983eb261b3805bdb7bffb0dd20a981273075a7d +Author: Roger Leigh +Date: Sun Feb 27 11:31:42 2011 +0000 + + debian: Document sbuild.conf and sbuild.conf.5 autogeneration + +commit 7d3c72d0c013c9bc60dacd2b2eedd3e1979fc6d7 +Author: Roger Leigh +Date: Sun Feb 27 11:31:21 2011 +0000 + + NEWS: Document sbuild.conf and sbuild.conf.5 autogeneration + +commit 9931fc4cafe6a339aec87a69f803aa6a0697e89b +Author: Roger Leigh +Date: Sun Feb 27 11:25:43 2011 +0000 + + man: sbuild.1 references sbuild.conf.5 + +commit b14c66ca327433308abed2bfffe11bc3603c1ee0 +Author: Roger Leigh +Date: Sun Feb 27 11:25:22 2011 +0000 + + debian: sbuild includes sbuild.conf.5 + +commit 73ddeb9d925994c308601a50edcf7cfa5883fa61 +Author: Roger Leigh +Date: Sun Feb 27 11:25:05 2011 +0000 + + Ignore sbuild.conf.man + +commit 93a77758d389f0a07471abaa8c8b0565939271af +Author: Roger Leigh +Date: Sun Feb 27 11:24:31 2011 +0000 + + man: Add sbuild.conf.5 manual page + +commit 7a58e6e66f993a03b6c02769c2894c638b7df40f +Author: Roger Leigh +Date: Sun Feb 27 10:12:00 2011 +0000 + + man: All manpages source definitions in defs.man + + This saves the need to process with config.status, and keeps + variable stuff in a single place. + +commit 64705a3dd0f302c1c87cf7518d1f8f2c02721add +Author: Roger Leigh +Date: Sun Feb 27 10:10:26 2011 +0000 + + build: Distribute sbuild-dumpconfig + +commit 8737643de24d2f8f7faf4bc1d2b7f8dcbc8b62df +Author: Roger Leigh +Date: Sun Feb 27 00:33:29 2011 +0000 + + sbuild-dumpconfig: Add support for buildd.conf, and man output + +commit 98b16659473d07452f84db3472acbe937f24b5c0 +Author: Roger Leigh +Date: Sat Feb 26 20:17:32 2011 +0000 + + tools: Add sbuild-dumpconfig + + sbuild-dumpconfig can dump the Sbuild::Conf class and its default values + as a fully documented sbuild.conf, with syntactically correct examples. + +commit 78bb4e5591df86d677ca60a37c54254a1f05877a +Author: Roger Leigh +Date: Sat Feb 26 20:11:49 2011 +0000 + + Sbuild::Conf: Add additional key tags + + Include TYPE, VARNAME and GROUP tags. This is sufficient information + to allow dumping of the entire configuration file as sbuild.conf or + a manual page. + +commit e533066f3ef41580866e81cb286ad9bd9c8507c6 +Author: Roger Leigh +Date: Sat Feb 26 11:01:11 2011 +0000 + + Sbuild::Conf: Add help text for all settings + +commit aa2bea11fe10531251cbd5a69bebb44fc77c1f42 +Author: Roger Leigh +Date: Thu Feb 24 22:46:57 2011 +0000 + + debian: Close #403246 + +commit 681d3beb2e5de58fb282752644b8473ab8313255 +Author: Roger Leigh +Date: Thu Feb 24 22:31:56 2011 +0000 + + debian: Document alternative resolving defaults + +commit e9640a93aeec3e609ab6a9138821548df66c846d +Author: Roger Leigh +Date: Thu Feb 24 22:31:33 2011 +0000 + + NEWS: Document alternative resolving defaults + +commit 126c8c3b42e6504b243b9268eae0342aa205456f +Author: Roger Leigh +Date: Thu Feb 24 22:27:40 2011 +0000 + + sbuild.1: Document alternative resolving defaults + +commit 746c52bf7a99626c3aa043cf8359475ccabdfcd6 +Author: Roger Leigh +Date: Thu Feb 24 22:22:09 2011 +0000 + + Sbuild::Conf: Resolve alternatives by default with the aptitude resolver + + This default may be overridden with $resolve_alternatives. + apt and internal do not resolve alternatives by default + aptitude resolves alternatives by default + +commit 328646e1c6ea407df64befdcea30fde1b6b11658 +Author: Roger Leigh +Date: Thu Feb 24 22:21:46 2011 +0000 + + Sbuild::Conf: Fix typo in deprecation warning + +commit f1798273068c33f9c486ef43f103c826e500bc97 +Author: Roger Leigh +Date: Wed Feb 23 23:08:37 2011 +0000 + + debian: Document resolver changes from NEWS + +commit e1eebe2148e7ff24bfd85e7829bc9dfb4262ebef +Author: Roger Leigh +Date: Wed Feb 23 23:07:34 2011 +0000 + + NEWS: apt is the default resolver, internal is deprecated + +commit 813930a1f948beaced1186e1c25ac2073f84f6c9 +Author: Roger Leigh +Date: Wed Feb 23 23:07:00 2011 +0000 + + sbuild.conf: Document resolver default + +commit decf817cf3e5ef8c6e6e7ab61324145c24b1db05 +Author: Roger Leigh +Date: Wed Feb 23 23:06:43 2011 +0000 + + sbuild.1: Document resolver default + +commit 3ec40bc72716d74c2d0617decb83233621fd0c02 +Author: Roger Leigh +Date: Wed Feb 23 23:06:04 2011 +0000 + + Sbuild::Conf: Make apt the default resolver + + Add deprecation warning for the internal resolver. + +commit 24a7504164a6417695742451c1c3568d9d13b827 +Author: Roger Leigh +Date: Wed Feb 23 23:05:35 2011 +0000 + + sbuild-update.1: Add additional guidance for --keygen + +commit 77f3c862a2c68ebdb4a1d68e3d8b02b18a5f5e2d +Author: Roger Leigh +Date: Wed Feb 23 22:36:34 2011 +0000 + + debian: Bump version to 0.61.1-1 + +commit 7ffd78a5c108d8d6bb470099399844c2f9474e5d +Author: Roger Leigh +Date: Wed Feb 23 22:36:00 2011 +0000 + + NEWS: Bump version to 0.61.1 + +commit e1b1156de3fb1388b13e8d2355a4727371545fa8 +Author: Roger Leigh +Date: Wed Feb 23 13:43:59 2011 +0000 + + debian: Bump version to 0.61.0buildd0 + +commit 46ce90058c2f7c3e0f646680bacf3ca55d9de4c8 +Author: Roger Leigh +Date: Wed Feb 23 13:42:01 2011 +0000 + + debian: Enable compatibility features on buildds + +commit 74d5dada13bc6bf34781d88a9508199c06a08192 +Author: Roger Leigh +Date: Wed Feb 23 13:10:24 2011 +0000 + + sbuild.conf: Fix typo in $resolve_alternatives + +commit c2741662ba7c8d79fb41cdb958c04851ca3ac0f0 +Author: Roger Leigh +Date: Wed Feb 23 13:09:06 2011 +0000 + + debian: Tidy changelog + +commit 794c40b0dee186dbbfa91625b735f8f52af6ab43 +Author: Roger Leigh +Date: Wed Feb 23 13:07:39 2011 +0000 + + debian: Document aptitude use of dpkg --force-confold + +commit a114e0c2245442986c95e901757da834392c2fe7 +Author: Roger Leigh +Date: Wed Feb 23 13:06:59 2011 +0000 + + Buildd::DistConf: Don't use init_allowed_keys + +commit d85946cd004c6dee4262dcafc30beb773a9ba897 +Author: Roger Leigh +Date: Wed Feb 23 13:00:33 2011 +0000 + + sbuild.conf: Correct $resolve_alternatives to use proper name + +commit 570640acf6c31e6c3d7338983b3fdbe36e16e8c9 +Author: Roger Leigh +Date: Sat Feb 19 12:58:33 2011 +0000 + + Sbuild::AptitudeResolver: Run dpkg with --force-confold + + This was already done for apt and internal, and was causing a number + of packages to FTBFS, + +commit d8f453ea7f1414d3a30421e5d7aaca043455fb21 +Author: Roger Leigh +Date: Wed Feb 23 12:09:50 2011 +0000 + + debian: Bump version to 0.61.0-1 + +commit a70e8e2b9c7403a9b06abe440eb55291de0851dd +Author: Roger Leigh +Date: Wed Feb 23 12:09:22 2011 +0000 + + NEWS: Bump version to 0.61.0 + +commit 96efc522f6309d91a08bb76019cd00742570e39d +Author: Roger Leigh +Date: Wed Feb 23 12:02:10 2011 +0000 + + Sbuild::ResolverBase: Implement alternative stripping + + The apt and aptitude resolvers now only use the first alternative + in alternative dependencies. This does not include architecture- + specific alternatives, which are reduced prior to stripping. + + This feature is configurable ($resolve_alternatives), defaulting + to being enabled. For suites which can take advantage of + alterntatives (e.g. backports), this may be disabled. For unstable, + where we want the strict consistency and reproducibility guaranteed + by stripping, this makes the apt and aptitude resolvers behave + exactly like the internal resolver. + +commit 5a9a0cf451190f440f48b82890457f848aa912b6 +Author: Roger Leigh +Date: Wed Feb 23 12:01:22 2011 +0000 + + Sbuild::Build: Add missing fail stages + + If a build failed very early, the fail stage wasn't initialised + and was incorrectly reported. + commit 2e9d85edbd65c7098dd3111fef409ae4fde742ee Author: Roger Leigh Date: Mon Feb 14 23:46:01 2011 +0000 diff -Nru sbuild-0.60.9/config.h.in sbuild-0.62.2/config.h.in --- sbuild-0.60.9/config.h.in 2011-02-15 00:18:05.000000000 +0000 +++ sbuild-0.62.2/config.h.in 2011-04-05 09:48:07.000000000 +0000 @@ -55,7 +55,7 @@ #undef SBUILD_CONF /* Package data directory */ -#undef SBUILD_DATADIR +#undef SBUILD_DATA_DIR /* Enable debugging */ #undef SBUILD_DEBUG @@ -75,9 +75,6 @@ /* Package libexec directory */ #undef SBUILD_LIBEXEC_DIR -/* Package module directory */ -#undef SBUILD_MODULEDIR - /* Platform type, used to modify run-time platform-specific behaviour */ #undef SBUILD_PLATFORM @@ -89,12 +86,3 @@ /* Version number of package */ #undef VERSION - -/* wanna-build config file path */ -#undef WANNA_BUILD_CONF - -/* Package libexec directory */ -#undef WANNA_BUILD_LIBEXEC_DIR - -/* wanna-build system configuration directory */ -#undef WANNA_BUILD_SYSCONF_DIR diff -Nru sbuild-0.60.9/configs/Makefile.in sbuild-0.62.2/configs/Makefile.in --- sbuild-0.60.9/configs/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/configs/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -128,21 +128,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -157,6 +165,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -165,14 +174,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ diff -Nru sbuild-0.60.9/configure sbuild-0.62.2/configure --- sbuild-0.60.9/configure 2011-02-15 00:18:05.000000000 +0000 +++ sbuild-0.62.2/configure 2011-04-05 09:48:07.000000000 +0000 @@ -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.9. +# Generated by GNU Autoconf 2.67 for sbuild 0.62.2. # # Report bugs to . # @@ -569,23 +569,23 @@ # Identity of this package. PACKAGE_NAME='sbuild' PACKAGE_TARNAME='sbuild' -PACKAGE_VERSION='0.60.9' -PACKAGE_STRING='sbuild 0.60.9' +PACKAGE_VERSION='0.62.2' +PACKAGE_STRING='sbuild 0.62.2' PACKAGE_BUGREPORT='buildd-tools-devel@lists.alioth.debian.org' PACKAGE_URL='' ac_unique_file="bin/sbuild-createchroot" -ac_subst_vars='LTLIBOBJS +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS LIBOBJS -WANNA_BUILD_CONF +SBUILD_DATA_DIR SCHROOT_CONF -WANNA_BUILD_SYSCONF_DIR SCHROOT_SYSCONF_DIR BUILDD_CONF BUILDD_SYSCONF_DIR SBUILD_CONF SBUILD_SYSCONF_DIR -WANNA_BUILD_LIBEXEC_DIR SBUILD_LIBEXEC_DIR PERL_MODULE_DIR PLATFORM_FREEBSD_FALSE @@ -603,6 +603,22 @@ build_vendor build_cpu build +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CXX +CPPFLAGS +LDFLAGS +CXXFLAGS +CXX SBUILD_CHROOT_CHECKS_FALSE SBUILD_CHROOT_CHECKS_TRUE SBUILD_CHROOT_CHECKS @@ -680,10 +696,17 @@ enable_debug enable_compat enable_chroot_checks +enable_dependency_tracking ' ac_precious_vars='build_alias host_alias -target_alias' +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC' # Initialize some variables set by options. @@ -1226,7 +1249,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.9 to adapt to many kinds of systems. +\`configure' configures sbuild 0.62.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1296,7 +1319,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sbuild 0.60.9:";; + short | recursive ) echo "Configuration of sbuild 0.62.2:";; esac cat <<\_ACEOF @@ -1311,6 +1334,20 @@ older Debian stable releases --enable-chroot-checks Enable additional chroot checks in testsuite (requires "unstable" chroot) + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF @@ -1375,7 +1412,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sbuild configure 0.60.9 +sbuild configure 0.62.2 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1406,11 +1443,49 @@ ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile cat >config.log <<_ACEOF 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.9, which was +It was created by sbuild $as_me 0.62.2, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2231,7 +2306,7 @@ # Define the identity of the package. PACKAGE='sbuild' - VERSION='0.60.9' + VERSION='0.62.2' cat >>confdefs.h <<_ACEOF @@ -2364,8 +2439,8 @@ esac AM_BACKSLASH='\' -RELEASE_DATE='14 Feb 2011' -RELEASE_DATE_S='1297641600' +RELEASE_DATE='05 Apr 2011' +RELEASE_DATE_S='1301958000' cat >>confdefs.h <<_ACEOF #define RELEASE_DATE "$RELEASE_DATE_S" @@ -2476,6 +2551,708 @@ # Checks for programs. +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; 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_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +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_prog_CXX="$ac_tool_prefix$ac_prog" + $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 + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +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_prog_ac_ct_CXX="$ac_prog" + $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 + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +$as_echo_n "checking whether the C++ compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +$as_echo_n "checking for C++ compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + # Check for host platform # Make sure we can run config.sub. @@ -2685,14 +3462,6 @@ _ACEOF -WANNA_BUILD_LIBEXEC_DIR="${PACKAGE_LIBEXEC_DIR}/wanna-build" - - -cat >>confdefs.h <<_ACEOF -#define WANNA_BUILD_LIBEXEC_DIR "$WANNA_BUILD_LIBEXEC_DIR" -_ACEOF - - if test "x${localstatedir}" = 'x${prefix}/var'; then if test "x${prefix}" = "xNONE"; then @@ -2771,23 +3540,6 @@ - -if test "x${sysconfdir}" = 'x${prefix}/etc'; then - if test "x${prefix}" = "xNONE"; then - WANNA_BUILD_SYSCONF_DIR="${ac_default_prefix}/etc" - else - WANNA_BUILD_SYSCONF_DIR="${prefix}/etc" - fi -else - WANNA_BUILD_SYSCONF_DIR="${sysconfdir}" -fi -WANNA_BUILD_SYSCONF_DIR="${WANNA_BUILD_SYSCONF_DIR}/buildd" -cat >>confdefs.h <<_ACEOF -#define WANNA_BUILD_SYSCONF_DIR "$WANNA_BUILD_SYSCONF_DIR" -_ACEOF - - - SCHROOT_CONF="${SCHROOT_SYSCONF_DIR}/schroot.conf" @@ -2797,26 +3549,19 @@ _ACEOF -WANNA_BUILD_CONF="${WANNA_BUILD_SYSCONF_DIR}/wanna-build.conf" - - - -cat >>confdefs.h <<_ACEOF -#define WANNA_BUILD_CONF "$WANNA_BUILD_CONF" -_ACEOF - - - -SBUILD_DATADIR="${PACKAGE_DATA_DIR}/${PACKAGE_VERSION}" -cat >>confdefs.h <<_ACEOF -#define SBUILD_DATADIR "$SBUILD_DATADIR" -_ACEOF - +if test "x${datadir}" = 'x${prefix}/share' || test "x${datadir}" = 'x${datarootdir}'; then + if test "x${prefix}" = "xNONE"; then + SBUILD_DATA_DIR="${ac_default_prefix}/share/sbuild" + else + SBUILD_DATA_DIR="${prefix}/share/sbuild" + fi +else + SBUILD_DATA_DIR="${datadir}/sbuild" +fi -SBUILD_MODULEDIR="${PACKAGE_LIB_DIR}/${PACKAGE_VERSION}/modules" cat >>confdefs.h <<_ACEOF -#define SBUILD_MODULEDIR "$SBUILD_MODULEDIR" +#define SBUILD_DATA_DIR "$SBUILD_DATA_DIR" _ACEOF @@ -2836,55 +3581,11 @@ ac_config_files="$ac_config_files lib/Sbuild/Makefile" -ac_config_files="$ac_config_files lib/Sbuild/DB/Makefile" - -ac_config_files="$ac_config_files lib/WannaBuild/Makefile" - ac_config_files="$ac_config_files lib/Sbuild/Sysconfig.pm" ac_config_files="$ac_config_files man/Makefile" -ac_config_files="$ac_config_files man/buildd.1" - -ac_config_files="$ac_config_files man/buildd-mail.1" - -ac_config_files="$ac_config_files man/buildd-uploader.1" - -ac_config_files="$ac_config_files man/buildd-vlog.1" - -ac_config_files="$ac_config_files man/buildd-watcher.1" - -ac_config_files="$ac_config_files man/sbuild.1" - -ac_config_files="$ac_config_files man/sbuild-abort.1" - -ac_config_files="$ac_config_files man/sbuild-adduser.8" - -ac_config_files="$ac_config_files man/sbuild-apt.1" - -ac_config_files="$ac_config_files man/sbuild-checkpackages.1" - -ac_config_files="$ac_config_files man/sbuild-createchroot.8" - -ac_config_files="$ac_config_files man/sbuild-hold.1" - -ac_config_files="$ac_config_files man/sbuild-setup.7" - -ac_config_files="$ac_config_files man/sbuild-shell.1" - -ac_config_files="$ac_config_files man/sbuild-stats.1" - -ac_config_files="$ac_config_files man/sbuild-update.1" - -ac_config_files="$ac_config_files man/wanna-build.1" - -ac_config_files="$ac_config_files man/wanna-build-catdb.1" - -ac_config_files="$ac_config_files man/wanna-build-mail.1" - -ac_config_files="$ac_config_files man/wanna-build-merge-packages.1" - -ac_config_files="$ac_config_files man/wanna-build-statistics.1" +ac_config_files="$ac_config_files man/defs.man" ac_config_files="$ac_config_files test/Makefile" @@ -2906,6 +3607,10 @@ ac_config_files="$ac_config_files test/sbuild" +ac_config_files="$ac_config_files tools/Makefile" + +ac_config_files="$ac_config_files wrapper/Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3005,6 +3710,13 @@ LTLIBOBJS=$ac_ltlibobjs + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi if test -z "${SBUILD_COMPAT_TRUE}" && test -z "${SBUILD_COMPAT_FALSE}"; then as_fn_error $? "conditional \"SBUILD_COMPAT\" was never defined. @@ -3014,6 +3726,14 @@ as_fn_error $? "conditional \"SBUILD_CHROOT_CHECKS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${PLATFORM_GENERIC_TRUE}" && test -z "${PLATFORM_GENERIC_FALSE}"; then as_fn_error $? "conditional \"PLATFORM_GENERIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -3434,7 +4154,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.9, which was +This file was extended by sbuild $as_me 0.62.2, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3461,6 +4181,7 @@ # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" +config_commands="$ac_config_commands" _ACEOF @@ -3490,13 +4211,16 @@ Configuration headers: $config_headers +Configuration commands: +$config_commands + Report bugs to ." _ACEOF 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.9 +sbuild config.status 0.62.2 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" @@ -3612,6 +4336,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -3621,6 +4350,7 @@ do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "configs/Makefile") CONFIG_FILES="$CONFIG_FILES configs/Makefile" ;; @@ -3629,31 +4359,9 @@ "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/Buildd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Buildd/Makefile" ;; "lib/Sbuild/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Sbuild/Makefile" ;; - "lib/Sbuild/DB/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Sbuild/DB/Makefile" ;; - "lib/WannaBuild/Makefile") CONFIG_FILES="$CONFIG_FILES lib/WannaBuild/Makefile" ;; "lib/Sbuild/Sysconfig.pm") CONFIG_FILES="$CONFIG_FILES lib/Sbuild/Sysconfig.pm" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; - "man/buildd.1") CONFIG_FILES="$CONFIG_FILES man/buildd.1" ;; - "man/buildd-mail.1") CONFIG_FILES="$CONFIG_FILES man/buildd-mail.1" ;; - "man/buildd-uploader.1") CONFIG_FILES="$CONFIG_FILES man/buildd-uploader.1" ;; - "man/buildd-vlog.1") CONFIG_FILES="$CONFIG_FILES man/buildd-vlog.1" ;; - "man/buildd-watcher.1") CONFIG_FILES="$CONFIG_FILES man/buildd-watcher.1" ;; - "man/sbuild.1") CONFIG_FILES="$CONFIG_FILES man/sbuild.1" ;; - "man/sbuild-abort.1") CONFIG_FILES="$CONFIG_FILES man/sbuild-abort.1" ;; - "man/sbuild-adduser.8") CONFIG_FILES="$CONFIG_FILES man/sbuild-adduser.8" ;; - "man/sbuild-apt.1") CONFIG_FILES="$CONFIG_FILES man/sbuild-apt.1" ;; - "man/sbuild-checkpackages.1") CONFIG_FILES="$CONFIG_FILES man/sbuild-checkpackages.1" ;; - "man/sbuild-createchroot.8") CONFIG_FILES="$CONFIG_FILES man/sbuild-createchroot.8" ;; - "man/sbuild-hold.1") CONFIG_FILES="$CONFIG_FILES man/sbuild-hold.1" ;; - "man/sbuild-setup.7") CONFIG_FILES="$CONFIG_FILES man/sbuild-setup.7" ;; - "man/sbuild-shell.1") CONFIG_FILES="$CONFIG_FILES man/sbuild-shell.1" ;; - "man/sbuild-stats.1") CONFIG_FILES="$CONFIG_FILES man/sbuild-stats.1" ;; - "man/sbuild-update.1") CONFIG_FILES="$CONFIG_FILES man/sbuild-update.1" ;; - "man/wanna-build.1") CONFIG_FILES="$CONFIG_FILES man/wanna-build.1" ;; - "man/wanna-build-catdb.1") CONFIG_FILES="$CONFIG_FILES man/wanna-build-catdb.1" ;; - "man/wanna-build-mail.1") CONFIG_FILES="$CONFIG_FILES man/wanna-build-mail.1" ;; - "man/wanna-build-merge-packages.1") CONFIG_FILES="$CONFIG_FILES man/wanna-build-merge-packages.1" ;; - "man/wanna-build-statistics.1") CONFIG_FILES="$CONFIG_FILES man/wanna-build-statistics.1" ;; + "man/defs.man") CONFIG_FILES="$CONFIG_FILES man/defs.man" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/perl-syntax") CONFIG_FILES="$CONFIG_FILES test/perl-syntax" ;; "test/sbuild-checkpackages") CONFIG_FILES="$CONFIG_FILES test/sbuild-checkpackages" ;; @@ -3664,6 +4372,8 @@ "test/sbuild-distupgrade") CONFIG_FILES="$CONFIG_FILES test/sbuild-distupgrade" ;; "test/sbuild-clean") CONFIG_FILES="$CONFIG_FILES test/sbuild-clean" ;; "test/sbuild") CONFIG_FILES="$CONFIG_FILES test/sbuild" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "wrapper/Makefile") CONFIG_FILES="$CONFIG_FILES wrapper/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac @@ -3677,6 +4387,7 @@ if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -3971,7 +4682,7 @@ fi # test -n "$CONFIG_HEADERS" -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do @@ -4248,11 +4959,108 @@ s/.*/./; q'`/stamp-h$_am_stamp_count ;; - + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; esac case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; "test/perl-syntax":F) chmod +x test/perl-syntax ;; "test/sbuild-checkpackages":F) chmod +x test/sbuild-checkpackages ;; "test/sbuild-hold":F) chmod +x test/sbuild-hold ;; diff -Nru sbuild-0.60.9/configure.ac sbuild-0.62.2/configure.ac --- sbuild-0.60.9/configure.ac 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/configure.ac 2011-04-04 17:43:53.000000000 +0000 @@ -121,6 +121,8 @@ AM_CONDITIONAL([SBUILD_CHROOT_CHECKS], [test "$enable_chroot_checks" = "yes"]) # Checks for programs. +AC_PROG_CXX +AC_LANG([C++]) # Check for host platform AC_CANONICAL_HOST @@ -213,11 +215,6 @@ AH_TEMPLATE(SBUILD_LIBEXEC_DIR, [Package libexec directory]) AC_DEFINE_UNQUOTED(SBUILD_LIBEXEC_DIR, ["$SBUILD_LIBEXEC_DIR"]) -WANNA_BUILD_LIBEXEC_DIR="${PACKAGE_LIBEXEC_DIR}/wanna-build" -AC_SUBST(WANNA_BUILD_LIBEXEC_DIR) -AH_TEMPLATE(WANNA_BUILD_LIBEXEC_DIR, [Package libexec directory]) -AC_DEFINE_UNQUOTED(WANNA_BUILD_LIBEXEC_DIR, ["$WANNA_BUILD_LIBEXEC_DIR"]) - dnl Set PACKAGE_LOCALSTATE_DIR in config.h. AH_TEMPLATE(PACKAGE_LOCALSTATE_DIR, [Package localstate directory]) if test "x${localstatedir}" = 'x${prefix}/var'; then @@ -288,40 +285,24 @@ AC_DEFINE_UNQUOTED([SCHROOT_SYSCONF_DIR], ["$SCHROOT_SYSCONF_DIR"]) AC_SUBST([SCHROOT_SYSCONF_DIR]) -dnl Set WANNA_BUILD_SYSCONF_DIR in config.h. -AH_TEMPLATE(WANNA_BUILD_SYSCONF_DIR, [wanna-build system configuration directory]) -if test "x${sysconfdir}" = 'x${prefix}/etc'; then - if test "x${prefix}" = "xNONE"; then - WANNA_BUILD_SYSCONF_DIR="${ac_default_prefix}/etc" - else - WANNA_BUILD_SYSCONF_DIR="${prefix}/etc" - fi -else - WANNA_BUILD_SYSCONF_DIR="${sysconfdir}" -fi -WANNA_BUILD_SYSCONF_DIR="${WANNA_BUILD_SYSCONF_DIR}/buildd" -AC_DEFINE_UNQUOTED([WANNA_BUILD_SYSCONF_DIR], ["$WANNA_BUILD_SYSCONF_DIR"]) -AC_SUBST([WANNA_BUILD_SYSCONF_DIR]) - SCHROOT_CONF="${SCHROOT_SYSCONF_DIR}/schroot.conf" AC_SUBST([SCHROOT_CONF]) AH_TEMPLATE(BUILDD_CONF, [buildd config file path]) AC_DEFINE_UNQUOTED(BUILDD_CONF, ["$BUILDD_CONF"]) -WANNA_BUILD_CONF="${WANNA_BUILD_SYSCONF_DIR}/wanna-build.conf" -AC_SUBST([WANNA_BUILD_CONF]) - -AH_TEMPLATE(WANNA_BUILD_CONF, [wanna-build config file path]) -AC_DEFINE_UNQUOTED(WANNA_BUILD_CONF, ["$WANNA_BUILD_CONF"]) - -AH_TEMPLATE(SBUILD_DATADIR, [Package data directory]) -SBUILD_DATADIR="${PACKAGE_DATA_DIR}/${PACKAGE_VERSION}" -AC_DEFINE_UNQUOTED(SBUILD_DATADIR, ["$SBUILD_DATADIR"]) - -AH_TEMPLATE(SBUILD_MODULEDIR, [Package module directory]) -SBUILD_MODULEDIR="${PACKAGE_LIB_DIR}/${PACKAGE_VERSION}/modules" -AC_DEFINE_UNQUOTED(SBUILD_MODULEDIR, ["$SBUILD_MODULEDIR"]) +AH_TEMPLATE(SBUILD_DATA_DIR, [Package data directory]) +if test "x${datadir}" = 'x${prefix}/share' || test "x${datadir}" = 'x${datarootdir}'; then + if test "x${prefix}" = "xNONE"; then + SBUILD_DATA_DIR="${ac_default_prefix}/share/sbuild" + else + SBUILD_DATA_DIR="${prefix}/share/sbuild" + fi +else + SBUILD_DATA_DIR="${datadir}/sbuild" +fi +AC_SUBST(SBUILD_DATA_DIR) +AC_DEFINE_UNQUOTED(SBUILD_DATA_DIR, ["$SBUILD_DATA_DIR"]) dnl Configure which files to generate. AC_CONFIG_FILES([Makefile]) @@ -332,31 +313,9 @@ AC_CONFIG_FILES([lib/Makefile]) AC_CONFIG_FILES([lib/Buildd/Makefile]) AC_CONFIG_FILES([lib/Sbuild/Makefile]) -AC_CONFIG_FILES([lib/Sbuild/DB/Makefile]) -AC_CONFIG_FILES([lib/WannaBuild/Makefile]) AC_CONFIG_FILES([lib/Sbuild/Sysconfig.pm]) AC_CONFIG_FILES([man/Makefile]) -AC_CONFIG_FILES([man/buildd.1]) -AC_CONFIG_FILES([man/buildd-mail.1]) -AC_CONFIG_FILES([man/buildd-uploader.1]) -AC_CONFIG_FILES([man/buildd-vlog.1]) -AC_CONFIG_FILES([man/buildd-watcher.1]) -AC_CONFIG_FILES([man/sbuild.1]) -AC_CONFIG_FILES([man/sbuild-abort.1]) -AC_CONFIG_FILES([man/sbuild-adduser.8]) -AC_CONFIG_FILES([man/sbuild-apt.1]) -AC_CONFIG_FILES([man/sbuild-checkpackages.1]) -AC_CONFIG_FILES([man/sbuild-createchroot.8]) -AC_CONFIG_FILES([man/sbuild-hold.1]) -AC_CONFIG_FILES([man/sbuild-setup.7]) -AC_CONFIG_FILES([man/sbuild-shell.1]) -AC_CONFIG_FILES([man/sbuild-stats.1]) -AC_CONFIG_FILES([man/sbuild-update.1]) -AC_CONFIG_FILES([man/wanna-build.1]) -AC_CONFIG_FILES([man/wanna-build-catdb.1]) -AC_CONFIG_FILES([man/wanna-build-mail.1]) -AC_CONFIG_FILES([man/wanna-build-merge-packages.1]) -AC_CONFIG_FILES([man/wanna-build-statistics.1]) +AC_CONFIG_FILES([man/defs.man]) AC_CONFIG_FILES([test/Makefile]) AC_CONFIG_FILES([test/perl-syntax], [chmod +x test/perl-syntax]) @@ -376,6 +335,8 @@ [chmod +x test/sbuild-clean]) AC_CONFIG_FILES([test/sbuild], [chmod +x test/sbuild]) +AC_CONFIG_FILES([tools/Makefile]) +AC_CONFIG_FILES([wrapper/Makefile]) dnl Output the generated config.status script. AC_OUTPUT diff -Nru sbuild-0.60.9/db/db.sql sbuild-0.62.2/db/db.sql --- sbuild-0.60.9/db/db.sql 2011-02-15 00:18:18.000000000 +0000 +++ sbuild-0.62.2/db/db.sql 2011-03-23 23:11:56.000000000 +0000 @@ -22,11 +22,11 @@ SET search_path = public; -\i /usr/local/share/wanna-build/postgresql/install/language.sql -\i /usr/local/share/wanna-build/postgresql/install/schema.sql -\i /usr/local/share/wanna-build/postgresql/install/archive.sql -\i /usr/local/share/wanna-build/postgresql/install/build.sql -\i /usr/local/share/wanna-build/postgresql/install/functions.sql +\i /usr/share/wanna-build/postgresql/install/language.sql +\i /usr/share/wanna-build/postgresql/install/schema.sql +\i /usr/share/wanna-build/postgresql/install/archive.sql +\i /usr/share/wanna-build/postgresql/install/build.sql +\i /usr/share/wanna-build/postgresql/install/functions.sql -\i /usr/local/share/wanna-build/postgresql/install/archive-data.sql -\i /usr/local/share/wanna-build/postgresql/install/build-data.sql +\i /usr/share/wanna-build/postgresql/install/archive-data.sql +\i /usr/share/wanna-build/postgresql/install/build-data.sql diff -Nru sbuild-0.60.9/db/Makefile.in sbuild-0.62.2/db/Makefile.in --- sbuild-0.60.9/db/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/db/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -128,21 +128,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -157,6 +165,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -165,14 +174,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ diff -Nru sbuild-0.60.9/debian/buildd.install sbuild-0.62.2/debian/buildd.install --- sbuild-0.60.9/debian/buildd.install 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/buildd.install 2011-04-04 17:43:53.000000000 +0000 @@ -2,6 +2,7 @@ debian/install/etc/schroot etc debian/install/usr/bin/buildd* usr/bin debian/install/usr/share/man/man1/buildd* usr/share/man/man1 +debian/install/usr/share/man/man5/buildd* usr/share/man/man5 debian/install/usr/share/man/man8/buildd* usr/share/man/man8 debian/install/usr/share/perl5/Buildd* usr/share/perl5 debian/install/var/lib/buildd var/lib diff -Nru sbuild-0.60.9/debian/buildd.postinst sbuild-0.62.2/debian/buildd.postinst --- sbuild-0.60.9/debian/buildd.postinst 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/buildd.postinst 2011-04-04 17:43:53.000000000 +0000 @@ -22,25 +22,9 @@ # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. -# Move a conffile without triggering a dpkg question -mv_conffile() { - OLDCONFFILE="$1" - NEWCONFFILE="$2" - - if [ -e "$OLDCONFFILE" ]; then - echo "Preserving user changes to $NEWCONFFILE ..." - mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new - mv -f "$OLDCONFFILE" "$NEWCONFFILE" - fi -} - case "$1" in configure) - if dpkg --compare-versions "$2" le "0.58.3-1"; then - mv_conffile "/etc/buildd.conf" "/etc/buildd/buildd.conf" - fi - if ! getent passwd buildd > /dev/null; then adduser --system --quiet --home /var/lib/buildd --no-create-home \ --shell /bin/bash --group --gecos "Debian build daemon" buildd diff -Nru sbuild-0.60.9/debian/buildd.postrm sbuild-0.62.2/debian/buildd.postrm --- sbuild-0.60.9/debian/buildd.postrm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/buildd.postrm 2011-04-04 17:43:53.000000000 +0000 @@ -16,40 +16,6 @@ # * `disappear' overwrit>r> # for details, see /usr/share/doc/packaging-manual/ -PACKAGE="buildd" - -# Remove a conffile which has been forgotten by dpkg -# If the file does not exist, or is owned by any package, do not remove it. -rm_conffile() { - CONFFILE="$1" - - local delete; delete="false" - - if [ -f "$CONFFILE" ]; then - local fpkg; fpkg="" - local pkg; pkg="" - if fpkg=$(dpkg -S "$CONFFILE" 2>/dev/null); then - # Don't delete, but check which package it came from. - pkg=$(echo $fpkg | sed -e 's/\(^[[:print:]][[:print:]]*\): .*$/\1/') - if [ "$pkg" = "$PACKAGE" ]; then - delete="true" - fi - else - rm -f "$CONFFILE" - delete="true" - fi - else - delete="true" - fi - - # Remove dpkg cruft - if [ "$delete" = "true" ]; then - rm -f "${CONFFILE}.dpkg-old" - rm -f "${CONFFILE}.dpkg-new" - rm -f "${CONFFILE}.dpkg-dist" - fi -} - case "$1" in remove|upgrade|failed-upgrade|abort-install|abort-upgrade) @@ -62,9 +28,6 @@ deluser --system buildd || true fi - rm_conffile "/etc/buildd.conf" - rm_conffile "/etc/buildd.conf.local" - ;; *) diff -Nru sbuild-0.60.9/debian/buildd.preinst sbuild-0.62.2/debian/buildd.preinst --- sbuild-0.60.9/debian/buildd.preinst 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/buildd.preinst 2011-04-04 17:43:53.000000000 +0000 @@ -11,27 +11,6 @@ # * `upgrade' # * `abort-upgrade' -# Prepare to move a conffile without triggering a dpkg question -prep_mv_conffile() { - PACKAGE="$1" - CONFFILE="$2" - - if [ -e "$CONFFILE" ]; then - md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" - old_md5sum="`dpkg-query -W -f='${Conffiles}' $PACKAGE | sed -n -e \"\\\\' $CONFFILE'{s/.* //;p}\"`" - if [ "$md5sum" = "$old_md5sum" ]; then - rm -f "$CONFFILE" - fi - fi -} - -case "$1" in - install|upgrade) - if dpkg --compare-versions "$2" le "0.58.3-1"; then - prep_mv_conffile "buildd" "/etc/buildd.conf" - fi -esac - # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. diff -Nru sbuild-0.60.9/debian/changelog sbuild-0.62.2/debian/changelog --- sbuild-0.60.9/debian/changelog 2011-05-06 14:15:15.000000000 +0000 +++ sbuild-0.62.2/debian/changelog 2011-05-06 14:01:12.000000000 +0000 @@ -1,3 +1,225 @@ +sbuild (0.62.2-1ubuntu1~natty1~ppa1) natty; urgency=low + + * No-change backport to natty + + -- Micah Gersten Fri, 06 May 2011 16:01:12 +0200 + +sbuild (0.62.2-1ubuntu1) oneiric; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/patches/do-not-install-debfoster-into-chroots.patch: + do not install debfoster into the chroots because it is in universe and + not needed for package building itself. + - debian/patches/run-pre-build-hooks-as-root.patch: + run pre-build hooks as root (Closes: #607228) + * Now that the package uses a patch system, don't modify the files directly; + instead, put the changes in the respective patches and add the DEP-3 + patch tagging guidelines to them. + + -- Lorenzo De Liso Sun, 01 May 2011 16:55:16 +0200 + +sbuild (0.62.2-1) unstable; urgency=low + + * New release. + * sbuild: + - New options --no-apt-clean, --no-apt-update, --no-apt-upgrade and + --no-apt-distupgrade have been added to allow these actions to be + disabled even when set as the default in the configuration. + - root is not required to be a member of the sbuild group in order + to run schroot via the sbuild-schroot wrapper + (Closes: #619128, #619002). + - Don't require HOME to be set in the environment (Closes: #619288). + - Work around broken build-essential on Ubuntu Lucid + (Closes: #619526). Thanks to Marc Deslauriers. + - --keep-session is replaced by + --purge-session=(always|successful|never). This will allow the + session to be purged for all, successful and no builds, + respectively (Closes: #619332). + - sources.list fragments stored in /etc/apt/sources.list.d have + 0644 permissions, so that normal users can run apt-cache in the + chroot during a build (Closes: #620797). Thanks to Julian Andres + Klode for identifying this problem. + - Log filtering may be disabled using $log_filter = 0 in the + configuration (Closes: #620589). The replacement text is now + also surrounded with "«" and "»" so that strings such as CHROOT + and BUILDDIR can't be confused with any actual appearance of the + same string in the build log. + - Log colouring may be disabled using $log_colour = 0 in the + configuration. + - Improve binNMU handling to permit binNMUs for multiarch packages + (Closes: #620112). Currently, binary NMUs use the current date + in the new changelog entry, but co-installable packages require + an identical changelog. To avoid this, take the date from the + previous changelog entry to ensure the same date for all binNMUs. + Thanks to Anders Kaseorg for this patch. + - Abort early if maintainer is not defined when performing a binNMU + or appending a version suffix (Closes: #620758). + * sbuild.conf: + - Don't set a default value for $build_dir (Closes: #619416). + This value is set each run, and so varies between builds when + generating the configuration file. Exclude from the generated + output to prevent unnecessary differences between builds. + - $purge_session uses the same purge modes as $purge_build_deps and + $purge_build_directory, rather than a boolean value. + * buildd: + - Merge latest changes from buildd-0.61.0. + + -- Roger Leigh Tue, 05 Apr 2011 10:46:49 +0100 + +sbuild (0.62.1-1) unstable; urgency=high + + * New release. + * Fixed security issue in the sbuild-schroot wrapper program which + did not enforce sbuild group membership in order to allow users + to access the chroots as user sbuild. + + -- Roger Leigh Sun, 20 Mar 2011 23:06:52 +0000 + +sbuild (0.62.0-1) unstable; urgency=low + + * New release. + * debian/control: + - Build-Depend upon libexception-class-perl. + * sbuild: + - Resolvers: + + 'apt' is now the default build dependency resolver. Users should + not see any significant changes compared with the old 'internal' + resolver. Please note that you may need to generate a GPG key + for the local archive created for dependency package + installation, if one does not already exist; see sbuild-update + (--keygen) for further details. + + The 'internal' build dependency resolver is deprecated. It is + not recommended for future use, and will be removed once it is no + longer used by the buildd infrastructure. Please use the 'apt' + resolver as a drop-in replacement. + + The 'aptitude' build dependency resolver will, unlike 'apt' and + 'internal', consider alternative dependencies by default, rather + than only using the first alternative. This is intended to both + preserve backward compatibility, and make the 'aptitude' + resolver the preferred choice for more complex situations, such + as building for experimental. + + The aptitude resolver can resolve complex dependencies, e.g. + A | B, where A is uninstallable now correctly falls back to B. + This is not the case for the internal or apt resolvers, which by + intent do not make use of alternatives (they use the first + alternative only. sbuild now has full support for resolving + alternatives, but this is not the default behaviour + (Closes: #403246). Please see #614807 for a proposed description + of autobuilder-imposed build dependency restrictions in Policy. + + All build dependency resolvers run dpkg with --force-confold. + This means packages with modified conffiles in the chroot to not + cause build failure. This includes /etc/services and + /etc/protocols from netbase (Closes: #576508). + - Logging: + + Long paths such as the chroot location and the build directory + inside the chroot are now filtered in the build log and replaced + with small, constant, abbreviations (Closes: #605763). This makes + the build logs comparable between builds with tools such as + diff(1). + + Logging messages have been improved, and important messages are + now coloured when running interactively (does not affect log + files). Errors, warnings and informational messages are coloured + red, yellow and green, respectively. Build status is coloured + green for success and red for all failure conditions. + + Build log mails are now compressed and mailed in MIME format by + default, together with a copy of the .changes file. The old + behaviour (plain mailing of uncompressed logs) may be restored by + setting $mime_build_log_mails=0 in the configuration, and + compression may also be disabled in the MIME mails by setting + $compress_build_log_mails=0. Note that it is no longer possible + to send compressed log mails unless MIME mailing is enabled. + Thanks to Philipp Kern for implementing this. + - Error handling: + + In order to handle errors more robustly, the build code now has + initial support for exception handling. Normal operation will + not be affected, but fatal errors may be logged in a different + order than seen previously. Fatal errors will now be seen at the + end of the build log, which should make it easier to spot + problems. + + sbuild now always cleans up fully when receiving a termination + signal such as SIGINT or SIGTERM. Note that you may need to wait + while the cleanup actions are performed, or the current task is + completed prior to initiating cleanup. When running + interactively, hitting Ctrl-C will sent SIGINT to the entire + process group; doing this while apt-get or aptitude are running + will potentially leave dpkg in an inconsistent state, so aborting + at this point is not recommended. Sending a SIGTERM to the + sbuild process will always work cleanly. + - General: + + sbuild now performs an apt dist-upgrade at the start of each + build by default, rather than an upgrade. This is to reduce the + amount of manual administration required to keep chroots up to + date, and is not much more risky than upgrade in this context. + + A new option, --keep-session, has been added (Closes: #609658). + This prevents the automatic removal of session-managed snapshot + chroots. Previously, snapshots would not be deleted if purging + of the build directory or build dependencies was disabled, but + this was not always desirable, hence it is now configurable + separately. + + Internally, building and other actions in the chroot are + performed by the 'sbuild' system user, where previously the user + invoking sbuild would be used instead. The aim of this change is + to separate privileges to increase security and reduce the chance + of accidental or deliberate tampering of the build environment. + While the latter is not addressed by these changes, this will be + taken care of during future architectural changes. + + The sbuild package build directory created inside the chroot now + has a reduced name length. It's now /build/packagename-XXXXXX + where XXXXXX are random characters. This helps reduce the chance + of hitting path length restrictions on some architectures, + particularly when using sockets. + * wanna-build: + - The wanna-build database has been removed entirely. This part of + the sbuild package was not used, and was not maintained for some + time. Users wishing to use wanna-build should investigate the + version in the wanna-build.git repository used by the Debian + autobuilding infrastructure. This version is actively maintained + and in continual use. + * sbuild.conf: + - sbuild.conf is now automatically generated from the help text and + defaults in the source code. This means that the examples will + always be syntactically correct, the help text will always be + current, and the defaults will always match the defaults in the + source code (Closes: #609932, #610995). + - Non-scalar (or reference) types are deprecated in sbuild.conf. + This is because it is not possible to tell the difference between + an empty and an undefined value. Values using array or hash + types should use the equivalent array reference or hash + reference, which have been supported for some time. The old + style array and hash values will remain supported for now, but + will be removed in a future release. + * buildd.conf: + - Automatically generated like sbuild.conf. As for sbuild.conf, + non-scalar types are deprecated. + * sbuild.conf.5: + - All of the allowed values in sbuild.conf are now documented in a + new sbuild.conf(5) manual page. Like sbuild.conf, this is + entirely generated from the source code, so will always match the + defaults for the same sbuild version. + * buildd.conf.5: + - New manual page. Like sbuild.conf(5), this documents all allowed + values. + + -- Roger Leigh Wed, 16 Mar 2011 16:10:31 +0000 + +sbuild (0.61.0-1) unstable; urgency=low + + * sbuild: + - The apt and aptitude build dependency resolvers now use only the + first alternative in alternative dependencies. The other + alternatives are stripped out entirely. This makes the apt and + aptitude resolvers behave exactly like the internal resolver. + Note that this is configurable with the $resolve_alternatives + option, so alternative resolving may be re-enabled with this + option if desired. This is useful for e.g. backports, but not + for unstable where the strict consistency and reproducibility + offered by only using the first alternative is required. + - The aptitude resolver now runs dpkg with --force-confold, to + match the behaviour of internal and apt. This prevents failure + when installing netbase into the build chroot, for example. + + -- Roger Leigh Wed, 23 Feb 2011 13:08:58 +0000 + sbuild (0.60.9-1ubuntu3) natty; urgency=low * lib/Sbuild/Build.pm: work around Lucid issue that has diff listed in @@ -76,6 +298,12 @@ -- Roger Leigh Mon, 14 Feb 2011 20:37:05 +0000 +sbuild (0.60.8-1ubuntu3) natty; urgency=low + + * lib/Sbuild/Build.pm: run pre-build hooks as root (Closes: #607228). + + -- Kees Cook Thu, 17 Feb 2011 21:35:11 -0800 + sbuild (0.60.8-1ubuntu2) natty; urgency=low * lib/Sbuild/ResolverBase.pm: use -o APT::Install-Recommends=false diff -Nru sbuild-0.60.9/debian/control sbuild-0.62.2/debian/control --- sbuild-0.60.9/debian/control 2011-05-06 14:15:15.000000000 +0000 +++ sbuild-0.62.2/debian/control 2011-05-01 14:58:07.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian buildd-tools Developers Uploaders: Michael Banck , Roger Leigh , Francesco Paolo Lovergine -Build-Depends: debhelper (>> 7.0.0) +Build-Depends: debhelper (>> 7.0.0), groff-base, perl-modules, libexception-class-perl, libfilesys-df-perl, libio-zlib-perl, libmime-lite-perl, libdpkg-perl (>= 1.15.5) Standards-Version: 3.9.1 Vcs-Browser: http://git.debian.org/?p=buildd-tools/sbuild.git Vcs-Git: git://git.debian.org/git/buildd-tools/sbuild @@ -12,7 +12,7 @@ Package: libsbuild-perl Architecture: all Section: perl -Depends: ${misc:Depends}, ${perl:Depends}, perl-modules, libfilesys-df-perl, libio-zlib-perl, adduser, apt, apt-utils, exim4 | mail-transport-agent, dpkg-dev, devscripts (>= 2.10.26), dctrl-tools, schroot (>= 1.4.12), libdpkg-perl (>= 1.15.5) +Depends: ${misc:Depends}, ${perl:Depends}, perl-modules, libexception-class-perl, libfilesys-df-perl, libio-zlib-perl, libmime-lite-perl, adduser, apt, apt-utils, exim4 | mail-transport-agent, dpkg-dev, devscripts (>= 2.10.26), dctrl-tools, schroot (>= 1.4.12), libdpkg-perl (>= 1.15.5) Replaces: sbuild (<= 0.58.4-1) Description: Tool for building Debian binary packages from Debian sources The sbuild suite of programs (wanna-build, buildd and sbuild) are @@ -25,49 +25,40 @@ programs. Package: sbuild -Architecture: all -Depends: ${misc:Depends}, ${perl:Depends}, perl-modules, libsbuild-perl (= ${source:Version}), adduser +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, perl-modules, libsbuild-perl (= ${source:Version}), adduser Recommends: fakeroot, debootstrap Suggests: wget, deborphan Description: Tool for building Debian binary packages from Debian sources - The sbuild suite of programs (wanna-build, buildd and sbuild) are - used to build binary packages from source packages. The wanna-build - database tracks packages which require building; buildd schedules - work from information it gets from the wanna-build database; sbuild - does the actual package building. + The sbuild suite of programs (buildd and sbuild) are used to build + binary packages from source packages. sbuild does the actual package + building. . - sbuild can do its work in chroots so both stable and unstable - environments can be used on the same machine. Useful for, say, - building the latest unstable packages against stable library - versions. And by keeping only essential and build-essential - in the chroots, you can find the correct build dependencies for - a package. - -Package: wanna-build -Architecture: all -Depends: ${misc:Depends}, ${perl:Depends}, perl-modules, libmldbm-perl, libsbuild-perl -Recommends: exim4 | mail-transport-agent, cron, wget, postgresql-8.4-debversion -Suggests: gnupg -Description: Database to track building of Debian binary packages from Debian sources - The sbuild suite of programs (wanna-build, buildd and sbuild) are - used to build binary packages from source packages. The wanna-build - database tracks packages which require building; buildd schedules - work from information it gets from the wanna-build database; sbuild - does the actual package building. + sbuild uses chroots to build packages, which act as virtual, minimal + operating system installations dedicated to package building. This + means that a number of environments may be used for building + simultaneously on the same machines, for example stable, testing, + unstable and experimental. When coupled with schroot to create + snapshots of chroots, sbuild may be used to build many packages in + parallel. A chroot envionment allows packages to be built in a + controlled, clean environment. sbuild installs only essential and + build-essential packages, plus those in the package build + dependencies. Package: buildd Architecture: all -Depends: ${misc:Depends}, ${perl:Depends}, libsbuild-perl, adduser, sbuild (= ${source:Version}), dupload, cron, exim4 | mail-transport-agent, libyaml-tiny-perl +Depends: ${misc:Depends}, ${perl:Depends}, libsbuild-perl, adduser, sbuild (>= ${source:Version}), sbuild (<< ${source:Version}.1~), dupload, cron, exim4 | mail-transport-agent, libyaml-tiny-perl Suggests: wanna-build Replaces: sbuild, ubuntu-dev-tools (<= 0.83) Breaks: ubuntu-dev-tools (<= 0.83) Description: Daemon for automatically building Debian binary packages from Debian sources - The sbuild suite of programs (wanna-build, buildd and sbuild) are + The sbuild suite of programs (buildd and sbuild) are used to build binary packages from source packages. The wanna-build database tracks packages which require building; buildd schedules work from information it gets from the wanna-build database; sbuild does the actual package building. . buildd is a daemon which will build Debian packages automatically - using the wanna-build database to identify which packages need to - be built. + using the wanna-build database to identify which packages need to be + built. Note that the wanna-build database is not packaged, and + requires installing separately. diff -Nru sbuild-0.60.9/debian/.gitignore sbuild-0.62.2/debian/.gitignore --- sbuild-0.60.9/debian/.gitignore 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -sbuild -buildd -files -build -install -wanna-build -libsbuild-perl -*.substvars -*.debhelper -*.log diff -Nru sbuild-0.60.9/debian/patches/do-not-install-debfoster-into-chroots.patch sbuild-0.62.2/debian/patches/do-not-install-debfoster-into-chroots.patch --- sbuild-0.60.9/debian/patches/do-not-install-debfoster-into-chroots.patch 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/debian/patches/do-not-install-debfoster-into-chroots.patch 2011-05-01 15:18:17.000000000 +0000 @@ -0,0 +1,19 @@ +Description: Do not install debfoster into the chroots because it is in +universe and not needed for package building itself. +Forwarded: not-needed (Ubuntu specific) +Origin: vendor +Author: Philipp Kern +Last-Update: 2011-05-01 + +--- sbuild-0.62.2.orig/bin/sbuild-createchroot ++++ sbuild-0.62.2/bin/sbuild-createchroot +@@ -157,8 +157,7 @@ usage_error("sbuild-createchroot", + # Make sure fakeroot and build-essential are installed + $conf->set('INCLUDE', add_items($conf->get('INCLUDE'), + "fakeroot", +- "build-essential", +- "debfoster")); ++ "build-essential")); + + my $suite = $ARGV[0]; + # Create the target directory in advance so abs_path (which is buggy) diff -Nru sbuild-0.60.9/debian/patches/run-pre-build-hooks-as-root.patch sbuild-0.62.2/debian/patches/run-pre-build-hooks-as-root.patch --- sbuild-0.60.9/debian/patches/run-pre-build-hooks-as-root.patch 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/debian/patches/run-pre-build-hooks-as-root.patch 2011-05-01 15:31:32.000000000 +0000 @@ -0,0 +1,17 @@ +Description: Run pre-build hooks as root +Forwarded: yes, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608840 +Origin: vendor +Author: Kees Cook +Last-Update: 2011-05-01 + +--- sbuild-0.62.2.orig/lib/Sbuild/Build.pm ++++ sbuild-0.62.2/lib/Sbuild/Build.pm +@@ -1770,7 +1770,7 @@ sub check_space { + foreach (@files) { + my $pipe = $self->get('Host')->pipe_command( + { COMMAND => ['du', '-k', '-s', $_], +- USER => $self->get_conf('USERNAME'), ++ USER => 'root', + PRIORITY => 0, + DIR => '/'}); + diff -Nru sbuild-0.60.9/debian/patches/series sbuild-0.62.2/debian/patches/series --- sbuild-0.60.9/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/debian/patches/series 2011-05-01 15:31:59.000000000 +0000 @@ -0,0 +1,2 @@ +do-not-install-debfoster-into-chroots.patch +run-pre-build-hooks-as-root.patch diff -Nru sbuild-0.60.9/debian/rules sbuild-0.62.2/debian/rules --- sbuild-0.60.9/debian/rules 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/rules 2011-04-04 17:43:53.000000000 +0000 @@ -3,6 +3,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +VERSION=$(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f 2) +BUILDD_BUILD=$(shell echo ${VERSION} | grep -q 'buildd' && echo yes || echo no) + debian/build/config.status: configure dh_testdir @@ -11,10 +14,11 @@ cd debian/build; \ CFLAGS="$(CFLAGS)" ../../configure \ --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ - --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/share \ + --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib \ --localstatedir=/var --mandir=\$${prefix}/share/man - +build-indep: build +build-arch: build build: debian/build/config.status debian/build-stamp debian/build-stamp: debian/build/config.status dh_testdir @@ -33,6 +37,8 @@ dh_clean +install-indep: install +install-arch: install install: build dh_testdir dh_testroot @@ -42,10 +48,14 @@ $(MAKE) -C debian/build install DESTDIR=$(CURDIR)/debian/install dh_install + cp debian/buildd.forward debian/buildd/var/lib/buildd/.forward + mkdir -p $(CURDIR)/debian/sbuild/usr/share/lintian/overrides + cp $(CURDIR)/debian/sbuild.lintian-overrides $(CURDIR)/debian/sbuild/usr/share/lintian/overrides/sbuild + # Build architecture-independent files here. -binary-indep: build install +binary-indep: build install-indep dh_testdir -i dh_testroot -i dh_installchangelogs -i ChangeLog @@ -53,7 +63,9 @@ dh_installexamples -i dh_installman -i dh_installcron -i - dh_installinit -i --no-start --no-restart-on-upgrade + if [ "${BUILDD_BUILD}" = "no" ]; then \ + dh_installinit -i --no-start --no-restart-on-upgrade; \ + fi dh_perl -i dh_link -i dh_compress -i @@ -70,7 +82,26 @@ dh_builddeb -i # Build architecture-dependent files here. -binary-arch: build install +binary-arch: build install-arch + dh_testdir -a + dh_testroot -a + dh_installchangelogs -a ChangeLog + dh_installdocs -a -A debian/cvslogs.old + dh_installexamples -a + dh_installman -a + dh_installinit -a --no-start --no-restart-on-upgrade + dh_perl -a + dh_link -a + dh_strip -a + dh_compress -a + dh_fixperms -a + chmod 4755 $(CURDIR)/debian/sbuild/usr/lib/sbuild/sbuild-schroot + dh_makeshlibs -a + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +.PHONY: build build-indep build-arch clean binary-indep binary-arch binary install install-indep install-arch diff -Nru sbuild-0.60.9/debian/sbuild.install sbuild-0.62.2/debian/sbuild.install --- sbuild-0.60.9/debian/sbuild.install 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/sbuild.install 2011-04-04 17:43:53.000000000 +0000 @@ -3,9 +3,11 @@ debian/install/etc/schroot/setup.d etc/schroot debian/install/usr/bin/sbuild* usr/bin debian/install/usr/sbin/sbuild* usr/sbin +debian/install/usr/lib/sbuild usr/lib debian/install/usr/share/sbuild usr/share debian/install/usr/share/doc/sbuild usr/share/doc debian/install/usr/share/man/man1/sbuild* usr/share/man/man1 +debian/install/usr/share/man/man5/sbuild* usr/share/man/man5 debian/install/usr/share/man/man7/sbuild* usr/share/man/man7 debian/install/usr/share/man/man8/sbuild* usr/share/man/man8 debian/install/var/lib/sbuild var/lib diff -Nru sbuild-0.60.9/debian/sbuild.lintian-overrides sbuild-0.62.2/debian/sbuild.lintian-overrides --- sbuild-0.60.9/debian/sbuild.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/debian/sbuild.lintian-overrides 2011-04-04 17:43:53.000000000 +0000 @@ -0,0 +1 @@ +sbuild binary: setuid-binary usr/lib/sbuild/sbuild-schroot 4755 root/root \ No newline at end of file diff -Nru sbuild-0.60.9/debian/sbuild.postinst sbuild-0.62.2/debian/sbuild.postinst --- sbuild-0.60.9/debian/sbuild.postinst 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/sbuild.postinst 2011-04-04 17:43:53.000000000 +0000 @@ -62,10 +62,19 @@ adduser $user sbuild done - chmod 2775 /var/lib/sbuild - chmod 2775 /var/lib/sbuild/apt-keys - # avg-* files from previous purge might have wrong GID - chown -R :sbuild /var/lib/sbuild + # Create dedicated sbuild user + if ! getent passwd sbuild > /dev/null; then + adduser --system --quiet --home /var/lib/sbuild --no-create-home \ + --shell /bin/bash --ingroup sbuild --gecos "Debian source builder" sbuild + fi + + chown -R sbuild:sbuild /var/lib/sbuild + chmod 02770 /var/lib/sbuild + chmod 02770 /var/lib/sbuild/apt-keys + [ -f /var/lib/sbuild/avg-build-space ] && \ + chmod 0664 /var/lib/sbuild/avg-build-space + [ -f /var/lib/sbuild/avg-build-times ] && \ + chmod 0664 /var/lib/sbuild/avg-build-times ;; diff -Nru sbuild-0.60.9/debian/source/format sbuild-0.62.2/debian/source/format --- sbuild-0.60.9/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/debian/source/format 2011-05-06 14:15:16.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru sbuild-0.60.9/debian/wanna-build.docs sbuild-0.62.2/debian/wanna-build.docs --- sbuild-0.60.9/debian/wanna-build.docs 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/wanna-build.docs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -NEWS - diff -Nru sbuild-0.60.9/debian/wanna-build.install sbuild-0.62.2/debian/wanna-build.install --- sbuild-0.60.9/debian/wanna-build.install 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/debian/wanna-build.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -debian/install/etc/buildd/wanna-build* etc/buildd -debian/install/usr/bin/wanna-build* usr/bin -debian/install/usr/share/wanna-build usr/share -debian/install/usr/share/man/man1/wanna-build* usr/share/man/man1 -debian/install/usr/share/perl5/WannaBuild* usr/share/perl5 -debian/install/var/lib/wanna-build var/lib diff -Nru sbuild-0.60.9/etc/25nssdatabases sbuild-0.62.2/etc/25nssdatabases --- sbuild-0.60.9/etc/25nssdatabases 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/etc/25nssdatabases 2011-03-19 14:51:03.000000000 +0000 @@ -19,6 +19,13 @@ set -e +if [ -f "/etc/schroot/setup.d/20nssdatabases" ]; then + # We're dealing with a schroot from squeeze. 20nssdatabases will + # handle everything for us. This script is only needed with + # schroot from lenny. So exit now. + exit 0 +fi + if [ -f "$CHROOT_SCRIPT_CONFIG" ]; then . "$CHROOT_SCRIPT_CONFIG" elif [ "$2" = "ok" ]; then diff -Nru sbuild-0.60.9/etc/99builddsourceslist sbuild-0.62.2/etc/99builddsourceslist --- sbuild-0.60.9/etc/99builddsourceslist 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/etc/99builddsourceslist 2011-03-27 11:18:34.000000000 +0000 @@ -46,7 +46,7 @@ } if [ "$1" = "setup-start" ] || [ "$1" = "setup-recover" ]; then - if [ -n "${SUITE_BASE}" ] && [ "${SUITE_BASE}" != "etch" ] && [ -f /etc/schroot/conf.buildd ]; then + if [ -n "${SUITE_BASE}" ] && [ -f /etc/schroot/conf.buildd ]; then APT_LIST="${CHROOT_PATH}/etc/apt/sources.buildd.list" APT_CONF="${CHROOT_PATH}/etc/apt/apt.conf.d/99buildd.conf" APT_KEYS="" @@ -142,22 +142,9 @@ APT_LIST_AUTO="${CHROOT_PATH}/etc/apt/sources.list.d/auto.list" if [ -f "$SOURCES_FILE_PATH" ]; then - if [ "$SUITE_BASE" = "etch" ]; then - cp $VERBOSE ${CHROOT_PATH}/etc/apt/sources.list ${CHROOT_PATH}/etc/apt/sources.list.backup - if [ ! -z "$VERBOSE" ]; then - echo cat '<'${SOURCES_FILE_PATH} '>>'"${CHROOT_PATH}/etc/apt/sources.list" - fi - cat <${SOURCES_FILE_PATH} >>"${CHROOT_PATH}/etc/apt/sources.list" - else cp $VERBOSE ${SOURCES_FILE_PATH} "${CHROOT_PATH}/etc/apt/sources.list.d/${SOURCES_FILE_NAME}.list" - fi elif [ ${SUITE_VARIANT} = 'security' ]; then - if [ "$SUITE_BASE" = "etch" ]; then - cp $VERBOSE ${CHROOT_PATH}/etc/apt/sources.list ${CHROOT_PATH}/etc/apt/sources.list.backup - APT_LIST_AUTO=${CHROOT_PATH}/etc/apt/sources.list - else : > ${APT_LIST_AUTO} - fi if [ -n "${security_mirror}" ]; then echo deb ${security_mirror} ${SUITE_BASE}/updates main contrib >> ${APT_LIST_AUTO} echo deb-src ${security_mirror} ${SUITE_BASE}/updates main contrib >> ${APT_LIST_AUTO} @@ -167,12 +154,7 @@ echo deb http://security-master.debian.org/buildd-${SUITE_BASE} / >> ${APT_LIST_AUTO} echo deb-src http://security-master.debian.org/buildd-${SUITE_BASE} / >> ${APT_LIST_AUTO} elif [ ${SUITE_VARIANT} = 'volatile' ]; then - if [ "$SUITE_BASE" = "etch" ]; then - cp $VERBOSE ${CHROOT_PATH}/etc/apt/sources.list ${CHROOT_PATH}/etc/apt/sources.list.backup - APT_LIST_AUTO=${CHROOT_PATH}/etc/apt/sources.list - else : > ${APT_LIST_AUTO} - fi if [ -n "${volatile_mirror}" ]; then echo deb ${volatile_mirror} ${SUITE_BASE}-proposed-updates/volatile main contrib non-free >> ${APT_LIST_AUTO} echo deb ${volatile_mirror} ${SUITE_BASE}/volatile main contrib non-free >> ${APT_LIST_AUTO} @@ -184,12 +166,7 @@ echo deb-src http://volatile.debian.net/debian-volatile ${SUITE_BASE}-proposed-updates/volatile main contrib non-free >> ${APT_LIST_AUTO} echo deb-src http://volatile.debian.net/debian-volatile ${SUITE_BASE}/volatile main contrib non-free >> ${APT_LIST_AUTO} elif [ ${SUITE_VARIANT%%-sloppy} = 'backports' ]; then - if [ "$SUITE_BASE" = "etch" ]; then - cp $VERBOSE ${CHROOT_PATH}/etc/apt/sources.list ${CHROOT_PATH}/etc/apt/sources.list.backup - APT_LIST_AUTO=${CHROOT_PATH}/etc/apt/sources.list - else : > ${APT_LIST_AUTO} - fi if [ -n "${backports_mirror}" ]; then echo deb ${backports_mirror} ${SUITE_BASE}-backports main contrib non-free >> ${APT_LIST_AUTO} echo deb-src ${backports_mirror} ${SUITE_BASE}-backports main contrib non-free >> ${APT_LIST_AUTO} @@ -222,7 +199,7 @@ fi fi elif [ "$1" = "setup-stop" ]; then - if [ -n "${SUITE_BASE}" ] && [ "${SUITE_BASE}" != "etch" ] && [ -f /etc/schroot/conf.buildd ]; then + if [ -n "${SUITE_BASE}" ] && [ -f /etc/schroot/conf.buildd ]; then APT_LIST="${CHROOT_PATH}/etc/apt/sources.buildd.list" APT_CONF="${CHROOT_PATH}/etc/apt/apt.conf.d/99buildd.conf" rm -f "${APT_LIST}" "${APT_CONF}" @@ -239,17 +216,9 @@ SOURCES_FILE_PATH="/etc/schroot/buildd.d/${SOURCES_FILE_NAME}" if [ -f "$SOURCES_FILE_PATH" ]; then - if [ "$SUITE_BASE" = "etch" ]; then - cp $VERBOSE ${CHROOT_PATH}/etc/apt/sources.list.backup ${CHROOT_PATH}/etc/apt/sources.list - else rm -f $VERBOSE "${CHROOT_PATH}/etc/apt/sources.list.d/${SOURCES_FILE_NAME}.list" - fi elif [ ${SUITE_VARIANT} = 'security' ] || [ ${SUITE_VARIANT} = 'volatile' ] || [ ${SUITE_VARIANT} = 'backports' ] || [ ${SUITE_VARIANT} = 'experimental' ] ; then - if [ "$SUITE_BASE" = "etch" ]; then - cp $VERBOSE ${CHROOT_PATH}/etc/apt/sources.list.backup ${CHROOT_PATH}/etc/apt/sources.list - else rm -f $VERBOSE "${CHROOT_PATH}/etc/apt/sources.list.d/auto.list" - fi fi fi fi diff -Nru sbuild-0.60.9/etc/buildd.conf sbuild-0.62.2/etc/buildd.conf --- sbuild-0.60.9/etc/buildd.conf 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/etc/buildd.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,188 +0,0 @@ -# buildd.conf: global buildd settings that will survive -*- Perl -*- -# an upgrade. -# -# Default settings are commented out. -# Note that all possible settings are listed here. -# Some may be set by each individual user in their -# ~/.builddrc, but are listed here for completeness. - -## -## LOGGING -## - -# Set to 1 to enable verbose messages. -#$verbose = 0; - -# Set to a number >= 1 to enable debugging messages. -#$debug = 0; - -# Disable becoming a daemon, for debugging purposes. -# Set to 1 to stop daemonising, otherwise set to 0 to become a daemon. -#$no_detach = 0; - - -## -## WANNA-BUILD DATABASE -## - -# Configure SSH to connect to a remote wanna-build host. If wanna-build -# is running locally, set $wanna_build_ssh_host to an empty string. - -# SSH program -#$ssh = "/usr/bin/ssh"; - -# nice level to run sbuild. Dedicated build daemons should not be -# niced. -#$nice_level = 10; - -# tell the packages build system to run in parallel -# check the number of available CPUs first -# $ENV{'DEB_BUILD_OPTIONS'} = 'parallel=2'; - -# time to sleep when idle (between wanna-build --list=needs-build calls) -#$idle_sleep_time = 5*60; - -# Minimum free space (in KiB) on build filesystem -#$min_free_space = 50*1024; # 50 MiB - -# how long to avoid packages that have automatically been given back by sbuild -# (in minutes) -#$delay_after_give_back = 8 * 60; # 8 hours - -# how many days until to archive package logs -#$pkg_log_keep = 7; - -# how many days until to archive build logs -#$build_log_keep = 2; - -# Main buildd daemon log file -#$daemon_log_file = "$HOME/daemon.log"; - -# how many days until to rotate daemon logs (one is kept as daemon.log.old, -# others are moved to old-logs and gzipped) -#$daemon_log_rotate = 1; - -# Whether or not to email rotated daemon logs via mail to the admin -#$daemon_log_send = 1; - -# how many days until to archive old daemon logs in a .tar.gz -#$daemon_log_keep = 7; - -# age (in days) after which a warning is issued for file in upload and -# dirs in build -#$warning_age = 7; - -# if more than 5 error mails are received within that time, they're -# not forwarded to avoid possible mail loops -#$error_mail_window = 8*60*60; - -# period for making of statistic summary -#$statistics_period = 7; - -# buildd-watcher doesn't complain about old files if they match the regexp -# below -#$no_warn_pattern = '^build/(SKIP|REDO|SBUILD-GIVEN-BACK|buildd\.pid|[^/]*.ssh|chroot-[^/]*)$'; - -# Should buildd send "Should I build" messages? -#$should_build_msgs = 1; - -#$autoclean_interval = 86400; - -# threshold for a secondary daemon to start (number of Needs-Build packages) -#$secondary_daemon_threshold = 70; - -# mail addr of admin -#$admin_mail = "root"; - -# mail address where to send statistics summaries -#$statistics_mail = 'root'; - -# log success messages from upload queue daemon? -#$log_queued_messages = 0; - -# PID file to identify running daemon -#$pidfile = "$HOME/build/daemon.pid" - -# list of distributions that buildd should take packages from -#@distributions = ( -# { -# # name of the suite to build (also used to query wanna-build) -# dist_name => ["unstable", "testing"], -# -# # architecture to be built (will be passed to sbuild and can be -# # used to compute wanna_build_db_name -# built_architecture => undef, -# -# # host on which wanna-build is run -# wanna_build_ssh_host => "buildd.debian.org", -# -# # user as who we are going to connect to the host running wanna-build -# wanna_build_ssh_user => "buildd_arch", -# -# # SSH control socket path for ssh -S option -# wanna_build_ssh_socket => '', -# -# # Additional SSH options used when connecting -# wanna_build_ssh_options => [], -# -# # database used for wanna-build -# wanna_build_db_name => "arch/build-db", -# -# # Username to use for wanna-build. -# wanna_build_db_user => $Buildd::username, -# -# # Local queue directory where binaries are stored before uploaded -# # by dupload. You need to configure this directory in -# # @upload_queues to get packages uploaded from there. -# dupload_local_queue_dir => "upload", -# -# # list of packages which shouldn't be picked up by buildd -# no_auto_build => [], -# -# # list of packages which should only be taken if there absolutely -# # nothing else to do (probably packages included in no_auto_build -# # because they take too long) -# weak_no_auto_build => [], -# -# # regex used to filter out unwanted packages: -# #no_build_regex => "^(contrib/|non-free/)?non-US/", -# -# # regex used to filter packages to build: -# #build_regex => "", -# -# # mail addr of buildd admin handling packages from this distribution -# logs_mailed_to => $admin_mail, -# -# # schroot name (or alias) of the chrooted environment to use for -# # building (will be passed to sbuild). sbuild's default is -# # the first of $distribution-$arch-sbuild, $distribution-sbuild, -# # $distribution-$arch and $distribution. -# sbuild_chroot => undef, -# -# } -#); - -#@upload_queues = ( -# { -# # Local queue directory where binaries are stored before uploaded -# # by dupload. -# dupload_local_queue_dir => "upload", -# -# # Upload site for buildd-upload to pass to dupload(1); see -# # /etc/dupload.conf for possible values. -# dupload_archive_name => "anonymous-ftp-master", -# }, -# -# { -# # Local queue directory where binaries are stored before uploaded -# # by dupload. -# dupload_local_queue_dir => "upload-security", -# -# # Upload site for buildd-upload to pass to dupload(1); see -# # /etc/dupload.conf for possible values. -# dupload_archive_name => "security", -# } -#); - -# don't remove this, Perl needs it -1; diff -Nru sbuild-0.60.9/etc/Makefile.am sbuild-0.62.2/etc/Makefile.am --- sbuild-0.60.9/etc/Makefile.am 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/etc/Makefile.am 2011-04-04 17:43:53.000000000 +0000 @@ -25,7 +25,7 @@ sbuildsysconf_DATA = sbuild.conf builddsysconfdir = $(BUILDD_SYSCONF_DIR) -builddsysconf_DATA = buildd.conf wanna-build.conf +builddsysconf_DATA = buildd.conf exampleconfdir = $(docdir)/examples exampleconf_DATA = example.sbuildrc @@ -33,6 +33,14 @@ COMPAT_SETUP = 25nssdatabases 99builddsourceslist SETUP = +sbuild.conf: $(abs_top_srcdir)/tools/sbuild-dumpconfig + PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ + $< sbuild config > $@ + +buildd.conf: $(abs_top_srcdir)/tools/sbuild-dumpconfig + PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ + $< buildd config > $@ + schrootsetupdir = $(SCHROOT_SYSCONF_DIR)/setup.d if SBUILD_COMPAT schrootsetup_SCRIPTS = $(COMPAT_SETUP) $(SETUP) @@ -61,13 +69,22 @@ done; \ done +uninstall-hook: + for profile in $(PROFILES); do \ + for file in "profiles/$$profile"/*; do \ + $(RM) "$(DESTDIR)$(SCHROOT_SYSCONF_DIR)/$$profile/$$(basename $$file)"; \ + done; \ + done + +CLEANFILES = \ + sbuild.conf \ + buildd.conf + clean-local: $(RM) -rf profiles $(RM) -f profiles-stamp EXTRA_DIST = \ - $(sbuildsysconf_DATA) \ - $(builddsysconf_DATA) \ $(exampleconf_DATA) \ $(COMPAT_SETUP) \ $(SETUP) \ diff -Nru sbuild-0.60.9/etc/Makefile.in sbuild-0.62.2/etc/Makefile.in --- sbuild-0.60.9/etc/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/etc/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -132,21 +132,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -161,6 +169,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -169,14 +178,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -225,7 +234,7 @@ sbuildsysconfdir = $(SBUILD_SYSCONF_DIR) sbuildsysconf_DATA = sbuild.conf builddsysconfdir = $(BUILDD_SYSCONF_DIR) -builddsysconf_DATA = buildd.conf wanna-build.conf +builddsysconf_DATA = buildd.conf exampleconfdir = $(docdir)/examples exampleconf_DATA = example.sbuildrc COMPAT_SETUP = 25nssdatabases 99builddsourceslist @@ -236,9 +245,11 @@ PROFILES = \ buildd +CLEANFILES = \ + sbuild.conf \ + buildd.conf + EXTRA_DIST = \ - $(sbuildsysconf_DATA) \ - $(builddsysconf_DATA) \ $(exampleconf_DATA) \ $(COMPAT_SETUP) \ $(SETUP) \ @@ -434,6 +445,7 @@ mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -510,8 +522,9 @@ uninstall-am: uninstall-builddsysconfDATA uninstall-exampleconfDATA \ uninstall-sbuildsysconfDATA uninstall-schrootsetupSCRIPTS - -.MAKE: install-am install-data-am install-strip + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am all-local check check-am clean clean-generic \ clean-local distclean distclean-generic distdir dvi dvi-am \ @@ -527,8 +540,17 @@ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am \ uninstall-builddsysconfDATA uninstall-exampleconfDATA \ - uninstall-sbuildsysconfDATA uninstall-schrootsetupSCRIPTS + uninstall-hook uninstall-sbuildsysconfDATA \ + uninstall-schrootsetupSCRIPTS + + +sbuild.conf: $(abs_top_srcdir)/tools/sbuild-dumpconfig + PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ + $< sbuild config > $@ +buildd.conf: $(abs_top_srcdir)/tools/sbuild-dumpconfig + PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ + $< buildd config > $@ profiles: profiles-stamp profiles-stamp: genprofile @@ -548,6 +570,13 @@ done; \ done +uninstall-hook: + for profile in $(PROFILES); do \ + for file in "profiles/$$profile"/*; do \ + $(RM) "$(DESTDIR)$(SCHROOT_SYSCONF_DIR)/$$profile/$$(basename $$file)"; \ + done; \ + done + clean-local: $(RM) -rf profiles $(RM) -f profiles-stamp diff -Nru sbuild-0.60.9/etc/sbuild.conf sbuild-0.62.2/etc/sbuild.conf --- sbuild-0.60.9/etc/sbuild.conf 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/etc/sbuild.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,356 +0,0 @@ -# sbuild.conf: global sbuild settings. -*- Perl -*- -# This makes it easier to drop this sbuild version into a buildd -# setting. (Also see example.sbuildrc for user .sbuildrc settings.) -# -# Default settings are commented out. -# Note that all possible settings are listed here. Many may be set on -# the command-line, and do not normally need setting here, -# e.g. $verbose. Others need setting by each individual user in their -# ~/.sbuildrc, but are listed here for completeness. - - -## -## LOGGING -## - -# Set to 1 to enable verbose messages. -#$verbose = 0; - -# Set to a number >= 1 to enable debugging messages. -#$debug = 0; - -# Set to 1 to disable logging. -#$nolog = 0; - -# Mail address where logs are sent to (mandatory, no default) -#$mailto = "frankie"; - -# Name of log sender -#$mailfrom = "Source Builder "; - - -## -## DPKG-BUILDPACKAGE OPTIONS -## - -# Name to use as override in .changes files for the Maintainer: field -# Defaults to the DEBEMAIL environment variable, if set, or else the -# Maintainer: field will not be overridden unless set here. -#$maintainer_name='Francesco Paolo Lovergine '; - -# Name to use as override in .changes file for the Changed-By: field. -#$uploader_name='Francesco Paolo Lovergine '; - -# Key ID to use in .changes for the current upload. -# It overrides both $maintainer_name and $uploader_name -#$key_id='Francesco Paolo Lovergine '; - -# PGP-related option to pass to dpkg-buildpackage. Usually neither .dsc -# nor .changes files shall be signed automatically. -#$pgp_options = ['-us', '-uc']; - -# By default, do not build arch-all packages -#$build_arch_all = 0; - -# By default, do not build a source package (binary only build). -# Set to 1 to force creation of a source package, but note that -# this is inappropriate for binary NMUs, where the option will -# always be disabled. -#$build_source = 0; - -# By default, the -s option only includes the .orig.tar.gz when needed -# (i.e. when the Debian revision is 0 or 1). By setting this option -# to 1, the .orig.tar.gz will always be included when -s is used. -# This is equivalent to --force-orig-source. -#$force_orig_source = 0; - -# PATH to set when running dpkg-buildpackage. -#$path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/games"; - -# LD_LIBRARY_PATH to set when running dpkg-buildpackage. -#$ld_library_path = ""; - -# Environment to filter when running dpkg-buildpackage. -# By default, sbuild will filter unwanted environment variables from -# the environment. $environment_filter is a reference to a list of -# regular expressions. Each environment variable will be matched -# against each of the regular expressions in the list. It will be -# removed from the environment none of the regular expressions match, -# and kept if one or more of the expressions match. -#$environment_filter = ['^PATH$', -# '^DEB(SIGN)?_[A-Z_]+$', -# '^(C(PP|XX)?|LD|F)FLAGS(_APPEND)?$']; - -# This command is run with the dpkg-buildpackage command line passed to it -# (in the chroot, if doing a chrooted build). It is used by the sparc buildd -# (which is sparc64) to call the wrapper script that sets the environment to -# sparc (32-bit). It could be used for other build environment setup scripts -# -#$build_env_cmnd = ""; - -## -## DPKG-SOURCE OPTIONS -## - -# Options to pass to dpkg-source. Each option is a separate arrayref -# element. -#$dpkg_source_opts = []; - -## -## SBUILD BEHAVIOUR -## - -# Default architecture. Defaults to host architecture. -#$arch = 'powerpc'; - -# Default distribution. By default, no distribution is defined, and -# the user must specify it with the -d option. However, a default may -# be configured here if desired. Users must take care not to upload -# to the wrong distribution when this option is set, for example -# experimental packages will be built for upload to unstable when this -# is not what is required. -#$distribution = 'unstable'; - -# Chroot mode. Valid modes are 'schroot' to use schroot for chroot -# access (the default), and 'sudo' to use sudo, requiring full sudo -# access to the host system. -#$chroot_mode = 'schroot'; - -# Chroot split. Set to 1 to run apt and dpkg outside the chroot, so -# the chroot does not require networking. Set to 0 to run all -# programs inside the chroot. Default 0. -#$chroot_split = 0; - -# Default chroot (defaults to distribution[-arch][-sbuild]) -#$chroot = 'unstable-powerpc-sbuild'; - -# When to purge the build directory afterwards; possible values are "never", -# "successful", and "always". "always" is the default. -#$purge_build_directory="successful"; - -# When to purge the build dependencies afterwards; possible values are "never", -# "successful", and "always". "always" is the default. -#$purge_build_deps="always"; - -# sbuild behaviour; possible values are "user" (exit status reports -# build failures) and "buildd" (exit status does not report build -# failures) for use in a buildd setup. "buildd" also currently -# implies enabling of "legacy features" such as chroot symlinks in the -# build directory and the creation of current symlinks in the build -# directory. -#$sbuild_mode = "user"; - -# Force APT to accept unauthenticated packages. By default, -# unauthenticated packages are not allowed. This is to keep the build -# environment secure, using apt-secure(8). By setting this to 1, -# APT::Get::AllowUnauthenticated is set to "true" when running apt-get. -# This is disabled by default: only enable it if you know what you are -# doing. -#$apt_allow_unauthenticated = 0; - -# 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 -# available in the APT cache, or 0 to disable. 0 is the traditional -# sbuild behaviour; 1 is needed to build from additional repositories -# such as sarge-backports or experimental, and has a small performance -# cost. -#$apt_policy = 1; - -# APT clean. 1 to enable running "apt-get clean" at the start of -# each build, or 0 to disable. -#$apt_clean = 0; - -# APT update. 1 to enable running "apt-get update" at the start of -# each build, or 0 to disable. -#$apt_update = 0; - -# APT upgrade. 1 to enable running "apt-get upgrade" at the start of -# each build, or 0 to disable. -#$apt_upgrade = 0; - -# APT distupgrade. 1 to enable running "apt-get dist-upgrade" at the start of -# each build, or 0 to disable. -#$apt_distupgrade = 0; - -# Check free disk space prior to starting a build. sbuild requires -# the free space to be at least twice the size of the unpacked sources -# to allow a build to proceed. Can be disabled to allow building if -# space is very limited, but the threshold to abort a build has been -# exceeded despite there being sufficient space for the build to -# complete. -#$check_space = 1; - -# Check watched packages to discover missing build dependencies. This -# can be disabled to increase the speed of builds -#$check_watches = 1; - -# Binaries for which the access time is controlled if they're not listed as -# source dependencies (note: /usr/bin is added if executable name doesn't -# start with '/') -# -# Most buildds run with clean chroots at the moment, so the default -# list is now empty. -#%watches = (); - -# Ignore watches on the following packages if the package doesn't have its own -# build dependencies in the .dsc -#@ignore_watches_no_build_deps = qw(); - -# Regular expressions identifying toolchain packages. -#@toolchain_regex = ( 'binutils$', 'gcc-[\d.]+$', 'g\+\+-[\d.]+$', 'libstdc\+\+', 'libc[\d.]+-dev$', 'linux-kernel-headers$' ); - -# Algorithm for build dependency checks: possible values are -# "first_only" (used by Debian buildds) or "alternatives". Default: -# "first_only". -#$check_depends_algorithm = "first-only"; - -## -## TIMEOUTS -## - -# Number of times to try waiting for a lock -#$max_lock_trys = 120; - -# Lock wait interval (seconds). Maximum wait time is -# (max_lock_trys × lock_interval). -#$lock_interval = 5; - -# Time (in minutes) of inactivity after which a build is terminated. Activity -# is measured by output to the log file. -#$stalled_pkg_timeout = 150; - -# Some packages may exceed the general timeout (e.g. redirecting output to -# a file) and need a different timeout. Below are some examples. -#%individual_stalled_pkg_timeout = (smalleiffel => 300, -# jade => 300, -# atlas => 300, -# glibc => 1000, -# 'gcc-3.3' => 300, -# kwave => 600); - - -## -## FILE AND DIRECTORY LOCATIONS -## - -# This option is deprecated. Directory for chroot symlinks and sbuild -# logs. Defaults to the current directory if unspecified. It is used -# as the location of chroot symlinks (obsolete) and for current build -# log symlinks and some build logs. There is no default; if unset, it -# defaults to the current working directory. $HOME/build is another -# common configuration. -#$build_dir = undef; - -# Directory for writing build logs to -#$log_dir = "$HOME/logs"; - -# Directory for writing build statistics to -#$stats_dir = "$HOME/stats"; - -# Name of a database for logging package build times (optional, no database -# is written if empty) -#$avg_time_db = "/var/lib/sbuild/avg-build-times"; - -# Name of a database for logging package space requirement (optional) -#$avg_space_db = "/var/lib/sbuild/avg-build-space"; - -# Job status file (only used in batch mode) -#$job_file = "build-progress"; - -## -## LINTIAN OPTIONS -## - -# lintian binary -#$lintian = "/usr/bin/lintian"; - -# Whether to run lintian -#$run_lintian = 0; - -# Options to pass to lintian. Each option is a separate arrayref -# element. For example, ['-i', '-v'] to add -i and -v. -#$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 -## - -# External commands to run at various stages of a build. Commands are held in a -# hash of arrays of arrays data structure. -#$external_commands = { -# "pre-build-commands" => [ -# ['foo', 'arg1', 'arg2'], -# ['bar', 'arg1', 'arg2', 'arg3'], -# ], -# "chroot-setup-commands" => [ -# ['foo', 'arg1', 'arg2'], -# ['bar', 'arg1', 'arg2', 'arg3'], -# ], -# "chroot-cleanup-commands" => [ -# ['foo', 'arg1', 'arg2'], -# ['bar', 'arg1', 'arg2', 'arg3'], -# ], -# "post-build-commands" => [ -# ['foo', 'arg1', 'arg2'], -# ['bar', 'arg1', 'arg2', 'arg3'], -# ], -#}; - -## -## PROGRAMS USED BY SBUILD -## - -# Program to mail log files. -#$mailprog = "/usr/sbin/sendmail"; -# dpkg binary. -#$dpkg = "/usr/bin/dpkg"; -# su binary. -#$su = "/bin/su"; -# schroot binary. -#$schroot = "/usr/bin/schroot"; -# schroot options; see schroot(1). -#$schroot_options = ['-q']; -# sudo binary. -#$sudo = "/usr/bin/sudo"; -# fakeroot command. Set to be fakeroot by default, but sudo is -# typically used on systems without fakeroot. -#$fakeroot = "/usr/bin/fakeroot"; -# apt-get binary. -#$apt_get = "/usr/bin/apt-get"; -# apt-cache binary. -#$apt_cache = "/usr/bin/apt-cache"; -# dpkg-source binary. -#$dpkg_source = "/usr/bin/dpkg-source"; -# dcmd binary. -#$dcmd = "/usr/bin/dcmd"; -# md5sum binary -#$md5sum = "/usr/bin/md5sum"; - - -# don't remove this, Perl needs it: -1; diff -Nru sbuild-0.60.9/etc/wanna-build.conf sbuild-0.62.2/etc/wanna-build.conf --- sbuild-0.60.9/etc/wanna-build.conf 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/etc/wanna-build.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -# wanna-build.conf: global wanna-build settings that will survive -*- Perl -*- -# an upgrade. -# -# Default settings are commented out. -# Note that all possible settings are listed here. -# Some may be set by each individual user in their -# ~/.wanna-buildrc, but are listed here for completeness. - - -## -## BUILD DATABASE CONFIGURATION (WANNA-BUILD) -## - -## -## DATABASE CONFIGURATION AND LOCATIONS -## - -# Database type. Valid values are 'mldbm' and 'postgresql' -#$db_type = 'mldbm'; - -# directory for the databases, lock files and log files -#$db_base_dir = '/var/lib/wanna-build'; - -# base name of the database, "-DIST" is appended automatically, and ".lock" -# for lock files -#$db_base_name = 'build-db'; - -# name of transaction log file (in base dir) -#$db_transaction_log = 'transactions.log'; - -## -## DISTRIBUTIONS -## - -# Valid distributions -#%db_distributions = ('experimental' => { priority => 4 }, -# 'unstable' => { priority => 3 }, -# 'testing' => { priority => 2 }, -# 'testing-security' => { noadw => 1, -# hidden => 1, -# priority => 2 }, -# 'stable' => { priority => 1 }, -# 'stable-security' => { noadw => 1, -# hidden => 1, -# priority => 1 }, -# 'oldstable' => { priority => 0 }, -# 'oldstable-security' => { noadw => 1, -# hidden => 1, -# priority => 0 }); - -# sections to import and maintain in the database -#@db_sections = qw(main contrib non-free); - -## -## DATA SOURCES -## - -# source for Packages files (for wanna-build--merge-packages) -# can be an ftp or http URL, or a local path -#$db_packages_source = "ftp://ftp.debian.org/debian"; - -# source for quinn-diff output (for wanna-build--merge-quinn) -# can be an ftp or http URL, or a local path -#$db_quinn_source = "http://buildd.debian.org/quinn-diff/output"; - -## -## USERS -## - -# Administrative users -#@db_admin_users = qw(buildd); - -## -## MAIL AND STATISTICS GENERATION -## - -# mail address of database maintainer (informed about a few things) -#$db_maintainer_email = "buildd"; - -# mail address of not-for-us maintainer (informed about Not-For-Us state -# changes) -#$db_notforus_maintainer_email = "buildd"; - -# mail address for logs of all state changes -#$db_log_mail = undef; - -# where to send wanna-build statistics mails -#$db_stat_mail = undef; - -# mail domain under which the build dæmons can be reached -#$db_mail_domain = undef; - -# file to publish statistics over WWW (optional) -#$db_web_stats = undef; - -# mail address of database maintainer (informed about a few things) -#$db_maint = "buildd"; - -# mail address of not-for-us maintainer (informed about Not-For-Us state -# changes) -$notforus_maint = "buildd"; - -# mail address for logs of all state changes -$log_mail = ""; - -# where to send wanna-build statistics mails -$stat_mail = ""; - -# file to publish statistics over WWW (optional) -$web_stats = "/var/lib/wanna-build/stats.txt"; - -# don't remove this, Perl needs it: -1; diff -Nru sbuild-0.60.9/lib/Buildd/Base.pm sbuild-0.62.2/lib/Buildd/Base.pm --- sbuild-0.60.9/lib/Buildd/Base.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/Base.pm 2011-04-04 17:43:53.000000000 +0000 @@ -117,7 +117,7 @@ my $self = shift; my $dist_config = shift; - my $db = Sbuild::DB::Client->new($dist_config); + my $db = Buildd::Client->new($dist_config); $db->set('Log Stream', $self->get('Log Stream')); return $db; } diff -Nru sbuild-0.60.9/lib/Buildd/ClientConf.pm sbuild-0.62.2/lib/Buildd/ClientConf.pm --- sbuild-0.60.9/lib/Buildd/ClientConf.pm 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/ClientConf.pm 2011-04-04 23:03:13.000000000 +0000 @@ -0,0 +1,168 @@ +# +# ClientConf.pm: configuration library for wanna-build clients +# Copyright © 1998 Roman Hodek +# Copyright © 2005 Ryan Murray +# Copyright © 2006-2009 Roger Leigh +# +# 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 Buildd::ClientConf; + +use strict; +use warnings; + +use Sbuild::Sysconfig; +use File::Spec; + +BEGIN { + use Exporter (); + our (@ISA, @EXPORT); + + @ISA = qw(Exporter); + + @EXPORT = qw(setup); +} + +sub setup ($) { + my $conf = shift; + + my $validate_program = sub { + my $conf = shift; + my $entry = shift; + my $key = $entry->{'NAME'}; + my $program = $conf->get($key); + + die "$key binary is not defined" + if !defined($program) || !$program; + + # Emulate execvp behaviour by searching the binary in the PATH. + my @paths = split(/:/, $ENV{'PATH'}); + # Also consider the empty path for absolute locations. + push (@paths, ''); + my $found = 0; + foreach my $path (@paths) { + $found = 1 if (-x File::Spec->catfile($path, $program)); + } + + die "$key binary '$program' does not exist or is not executable" + if !$found; + }; + + my $validate_ssh = sub { + my $conf = shift; + my $entry = shift; + +# TODO: Provide self, config and entry contexts, which functions to +# get at needed data. Provide generic configuration functions. +# + $validate_program->($conf, $conf->{'KEYS'}->{'SSH'}); + + my $ssh = $conf->get('SSH'); + my $sshuser = $conf->get('WANNA_BUILD_SSH_USER'); + my $sshhost = $conf->get('WANNA_BUILD_SSH_HOST'); + my @sshoptions = @{$conf->get('WANNA_BUILD_SSH_OPTIONS')}; + my $sshsocket = $conf->get('WANNA_BUILD_SSH_SOCKET'); + + my @command = (); + + if ($sshhost) { + push (@command, $ssh); + push (@command, '-l', $sshuser) if $sshuser; + push (@command, '-S', $sshsocket) if $sshsocket; + push (@command, @sshoptions) if @sshoptions; + push (@command, $sshhost); + } + + $conf->set('WANNA_BUILD_SSH_CMD', \@command); + }; + + our $HOME = $conf->get('HOME'); + my $arch = $conf->get('ARCH'); + + my %db_keys = ( + 'SSH' => { + TYPE => 'STRING', + VARNAME => 'ssh', + GROUP => 'Programs', + DEFAULT => 'ssh', + CHECK => $validate_ssh, + HELP => 'Path to ssh binary' + }, + 'WANNA_BUILD_SSH_CMD' => { + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => '', + HELP => 'Command to run wanna-build (set automatically from the other wanna-build options)' + }, + 'WANNA_BUILD_SSH_USER' => { + TYPE => 'STRING', + VARNAME => 'wanna_build_ssh_user', + GROUP => 'wanna-build client', + DEFAULT => '', + CHECK => $validate_ssh, + HELP => 'Username for SSH connection' + }, + 'WANNA_BUILD_SSH_HOST' => { + TYPE => 'STRING', + VARNAME => 'wanna_build_ssh_host', + GROUP => 'wanna-build client', + DEFAULT => '', + CHECK => $validate_ssh, + HELP => 'Host for SSH connection' + }, + 'WANNA_BUILD_SSH_SOCKET' => { + TYPE => 'STRING', + VARNAME => 'wanna_build_ssh_socket', + GROUP => 'wanna-build client', + DEFAULT => '', + CHECK => $validate_ssh, + HELP => 'Socket for SSH connection' + }, + 'WANNA_BUILD_SSH_OPTIONS' => { + TYPE => 'ARRAY:STRING', + VARNAME => 'wanna_build_ssh_options', + GROUP => 'wanna-build client', + DEFAULT => [], + CHECK => $validate_ssh, + HELP => 'SSH options. Note this is an array reference.' + }, + 'WANNA_BUILD_DB_NAME' => { + TYPE => 'STRING', + VARNAME => 'wanna_build_db_name', + GROUP => 'wanna-build client', + DEFAULT => undef, + HELP => 'Database name' + }, + 'WANNA_BUILD_DB_USER' => { + TYPE => 'STRING', + VARNAME => 'wanna_build_db_user', + GROUP => 'wanna-build client', + DEFAULT => $conf->get('USERNAME'), + HELP => 'Database user' + }, + 'BUILT_ARCHITECTURE' => { + TYPE => 'STRING', + VARNAME => 'wanna_build_built_architecture', + GROUP => 'wanna-build client', + DEFAULT => $arch, + HELP => 'Architecture for database' + }); + + $conf->set_allowed_keys(\%db_keys); +} + +1; diff -Nru sbuild-0.60.9/lib/Buildd/Client.pm sbuild-0.62.2/lib/Buildd/Client.pm --- sbuild-0.60.9/lib/Buildd/Client.pm 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/Client.pm 2011-04-04 23:03:13.000000000 +0000 @@ -0,0 +1,127 @@ +# +# Client.pm: client library for wanna-build +# Copyright © 2005 Ryan Murray +# Copyright © 2005-2009 Roger Leigh +# +# 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 Buildd::Client; + +use strict; +use warnings; + +use Sbuild qw($devnull); +use Sbuild::ChrootRoot; + +BEGIN { + use Exporter (); + our (@ISA, @EXPORT); + + @ISA = qw(Exporter Sbuild::Base); + + @EXPORT = qw(); +} + +sub new { + my $class = shift; + my $conf = shift; + + my $self = $class->SUPER::new($conf); + bless($self, $class); + + $self->set('SETUP', 0); + + return $self; +} + +sub setup { + my $self = shift; + + if (!$self->get('SETUP')) { + my $host = Sbuild::ChrootRoot->new($self->get('Config')); + $host->begin_session(); + $host->set('Log Stream', $self->get('Log Stream')); + $self->set('Host', $host); + $self->set('SETUP', 1); + } +} + +sub get_query { + my $self = shift; + + my @command = (@{$self->get_conf('WANNA_BUILD_SSH_CMD')}, 'wanna-build'); + if ($self->get_conf('WANNA_BUILD_DB_NAME')) { + push(@command, "--database=" . $self->get_conf('WANNA_BUILD_DB_NAME')); + } elsif ($self->get_conf('BUILT_ARCHITECTURE')) { + push(@command, "--arch=" . $self->get_conf('BUILT_ARCHITECTURE')); + } + push(@command, "--user=" . $self->get_conf('WANNA_BUILD_DB_USER')) + if $self->get_conf('WANNA_BUILD_DB_USER'); + push(@command, @_); + + return @command; +} + +sub run_query { + my $self = shift; + + my @command = $self->get_query(@_); + + $self->setup(); + + my $pipe = $self->get('Host')->run_command( + { COMMAND => [@command], + USER => $self->get_conf('USERNAME'), + PRIORITY => 0, + }); +} + +sub pipe_query { + my $self = shift; + + my @command = $self->get_query(@_); + + $self->setup(); + + my $pipe = $self->get('Host')->pipe_command( + { COMMAND => [@command], + USER => $self->get_conf('USERNAME'), + PRIORITY => 0, + }); + + return $pipe; +} + +sub pipe_query_out { + my $self = shift; + + my @command = $self->get_query(@_); + + $self->setup(); + + my $pipe = $self->get('Host')->pipe_command( + { COMMAND => [@command], + USER => $self->get_conf('USERNAME'), + PIPE => 'out', + STREAMOUT => $devnull, + PRIORITY => 0, + }); + + return $pipe; +} + +1; diff -Nru sbuild-0.60.9/lib/Buildd/Conf.pm sbuild-0.62.2/lib/Buildd/Conf.pm --- sbuild-0.60.9/lib/Buildd/Conf.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/Conf.pm 2011-04-04 17:43:53.000000000 +0000 @@ -29,7 +29,7 @@ use Buildd::UploadQueueConf qw(); use Sbuild::ConfBase; use Sbuild::Sysconfig; -use Sbuild::DB::ClientConf qw(); +use Buildd::ClientConf qw(); BEGIN { use Exporter (); @@ -42,12 +42,11 @@ our $reread_config = 0; -sub new (); sub setup ($); sub read ($); -sub new () { - my $conf = Sbuild::ConfBase->new(); +sub new { + my $conf = Sbuild::ConfBase->new(@_); Buildd::Conf::setup($conf); Buildd::Conf::read($conf); @@ -98,97 +97,269 @@ my %buildd_keys = ( 'ADMIN_MAIL' => { - DEFAULT => 'root' + TYPE => 'STRING', + VARNAME => 'admin_mail', + GROUP => 'Mail', + DEFAULT => 'root', + HELP => 'email address for admin' }, 'APT_GET' => { + TYPE => 'STRING', + VARNAME => 'apt_get', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => 'apt-get' - }, - 'AUTOCLEAN_INTERVAL' => { - DEFAULT => 86400 + DEFAULT => 'apt-get', + HELP => 'Path to apt-get binary' }, 'BUILD_LOG_KEEP' => { - DEFAULT => 2 - }, - 'BUILD_LOG_REGEX' => { - DEFAULT => undef + TYPE => 'NUMERIC', + VARNAME => 'build_log_keep', + GROUP => 'Watcher', + DEFAULT => 2, + HELP => 'Number of days until build logs are archived' }, 'DAEMON_LOG_FILE' => { - DEFAULT => "$HOME/daemon.log" + TYPE => 'STRING', + VARNAME => 'daemon_log_file', + GROUP => 'Daemon', + DEFAULT => "$HOME/daemon.log", + HELP => 'Main buildd daemon log file' }, 'DAEMON_LOG_KEEP' => { - DEFAULT => 7 + TYPE => 'NUMERIC', + VARNAME => 'daemon_log_keep', + GROUP => 'Watcher', + DEFAULT => 7, + HELP => 'Number of days until old daemon logs are archived in a .tar.gz file' }, 'DAEMON_LOG_ROTATE' => { - DEFAULT => 1 + TYPE => 'NUMERIC', + VARNAME => 'daemon_log_rotate', + GROUP => 'Watcher', + DEFAULT => 1, + HELP => 'Number how many days until daemon logs are rotated (one is kept as daemon.log.old, others are moved to old-logs and gzipped)' }, 'DAEMON_LOG_SEND' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'daemon_log_send', + GROUP => 'Watcher', + DEFAULT => 1, + HELP => 'email rotated daemon logs to the admin?' }, 'DELAY_AFTER_GIVE_BACK' => { - DEFAULT => 8 * 60 # 8 hours + TYPE => 'NUMERIC', + VARNAME => 'delay_after_give_back', + GROUP => 'Daemon', + DEFAULT => 8 * 60, # 8 hours + HELP => 'Time to avoid packages that have automatically been given back by sbuild (in minutes)' }, 'ERROR_MAIL_WINDOW' => { - DEFAULT => 8*60*60 + TYPE => 'NUMERIC', + VARNAME => 'error_mail_window', + GROUP => 'Mail', + DEFAULT => 8*60*60, + HELP => 'If more than five error mails are received within the specified time (in seconds), do not forward (to avoid possible mail loops)' }, 'IDLE_SLEEP_TIME' => { - DEFAULT => 5*60 + TYPE => 'NUMERIC', + VARNAME => 'idle_sleep_time', + GROUP => 'Daemon', + DEFAULT => 5*60, + HELP => 'Time to sleep when idle (in seconds) between wanna-build --list=needs-build calls)' }, 'LOG_QUEUED_MESSAGES' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'log_queued_messages', + GROUP => 'Mail', + DEFAULT => 0, + HELP => 'Log success messages from upload queue daemon?' }, 'MIN_FREE_SPACE' => { - DEFAULT => 50*1024 + TYPE => 'NUMERIC', + VARNAME => 'min_free_space', + GROUP => 'Daemon', + DEFAULT => 50*1024, + HELP => 'Minimum free space (in KiB) on build filesystem' }, 'NICE_LEVEL' => { - DEFAULT => 10 + TYPE => 'NUMERIC', + VARNAME => 'nice_level', + GROUP => 'Build options', + DEFAULT => 10, + HELP => 'Nice level to run sbuild. Dedicated build daemons should not be niced.' }, 'NO_DETACH' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'no_detach', + GROUP => 'Daemon', + DEFAULT => 0, + HELP => 'Disable becoming a daemon, for debugging purposes. Set to 1 to stop daemonising, otherwise set to 0 to become a daemon.' }, 'NO_WARN_PATTERN' => { - DEFAULT => '^build/(SKIP|REDO|SBUILD-GIVEN-BACK|buildd\.pid|[^/]*.ssh|chroot-[^/]*|current-[^/]*)$' + TYPE => 'STRING', + VARNAME => 'no_warn_pattern', + GROUP => 'Watcher', + DEFAULT => '^build/(SKIP|REDO|SBUILD-GIVEN-BACK|buildd\.pid|[^/]*.ssh|chroot-[^/]*|current-[^/]*)$', + HELP => 'Don\'t complain about old files if they match the regexp.' }, 'PIDFILE' => { + TYPE => 'STRING', + VARNAME => 'pidfile', + GROUP => 'Daemon', # Set once running as a system service. # DEFAULT => "${Sbuild::Sysconfig::paths{'LOCALSTATEDIR'}/run/buildd.pid" - DEFAULT => "$HOME/build/buildd.pid" + DEFAULT => "$HOME/build/buildd.pid", + HELP => 'PID file to identify running daemon.' }, 'PKG_LOG_KEEP' => { - DEFAULT => 7 - }, - 'SECONDARY_DAEMON_THRESHOLD' => { - DEFAULT => 70 + TYPE => 'NUMERIC', + VARNAME => 'pkg_log_keep', + GROUP => 'Watcher', + DEFAULT => 7, + HELP => 'Number of days until to package logs are archived' }, 'SHOULD_BUILD_MSGS' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'should_build_msgs', + GROUP => 'Daemon', + DEFAULT => 1, + HELP => 'Should buildd send "Should I build" messages?' }, 'STATISTICS_MAIL' => { - DEFAULT => 'root' + TYPE => 'STRING', + VARNAME => 'statistics_mail', + GROUP => 'Watcher', + DEFAULT => 'root', + HELP => 'email address for statistics summaries' }, 'STATISTICS_PERIOD' => { - DEFAULT => 7 + TYPE => 'NUMERIC', + VARNAME => 'statistics_period', + GROUP => 'Watcher', + DEFAULT => 7, + HELP => 'Period for statistic summaries (days)' }, 'SUDO' => { + TYPE => 'STRING', + VARNAME => 'sudo', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => 'sudo' + DEFAULT => 'sudo', + HELP => 'Path to sudo binary' }, 'WARNING_AGE' => { - DEFAULT => 7 + TYPE => 'NUMERIC', + VARNAME => 'warning_age', + GROUP => 'Watcher', + DEFAULT => 7, + HELP => 'Age (in days) after which a warning is issued for files in upload and dirs in build' }, 'CONFIG_TIME' => { - DEFAULT => {} + TYPE => 'NUMERIC', + VARNAME => 'config_time', + GROUP => '__INTERNAL', + DEFAULT => {}, + HELP => 'Time configuration was last read' }, 'DISTRIBUTIONS' => { - DEFAULT => [] + TYPE => 'ARRAY:HASH:SCALAR', + VARNAME => 'distributions', + GROUP => 'Build options', + DEFAULT => [], + IGNORE_DEFAULT => 1, # Don't dump class to config + HELP => 'List of distributions that buildd should take packages from', + EXAMPLE => +'$distributions = [ + { + # name of the suite to build (also used to query wanna-build) + dist_name => ["unstable", "testing"], + + # architecture to be built (will be passed to sbuild and can be + # used to compute wanna_build_db_name + built_architecture => undef, + + # host on which wanna-build is run + wanna_build_ssh_host => "buildd.debian.org", + + # user as who we are going to connect to the host running wanna-build + wanna_build_ssh_user => "buildd_arch", + + # SSH control socket path for ssh -S option + wanna_build_ssh_socket => "", + + # Additional SSH options used when connecting + wanna_build_ssh_options => [], + + # database used for wanna-build + wanna_build_db_name => "arch/build-db", + + # Username to use for wanna-build. + wanna_build_db_user => $Buildd::username, + + # Local queue directory where binaries are stored before uploaded + # by dupload. You need to configure this directory in + # @upload_queues to get packages uploaded from there. + dupload_local_queue_dir => "upload", + + # list of packages which shouldn\'t be picked up by buildd + no_auto_build => [], + + # list of packages which should only be taken if there absolutely + # nothing else to do (probably packages included in no_auto_build + # because they take too long) + weak_no_auto_build => [], + + # regex used to filter out unwanted packages: + #no_build_regex => "^(contrib/|non-free/)?non-US/", + + # regex used to filter packages to build: + #build_regex => "", + + # mail addr of buildd admin handling packages from this distribution + logs_mailed_to => $admin_mail, + + # schroot name (or alias) of the chrooted environment to use for + # building (will be passed to sbuild). sbuild\'s default is + # the first of $distribution-$arch-sbuild, $distribution-sbuild, + # $distribution-$arch and $distribution. + sbuild_chroot => undef, + + } +];' }, 'UPLOAD_QUEUES' => { - DEFAULT => [] - }, - ); + TYPE => 'ARRAY:HASH:SCALAR', + VARNAME => 'upload_queues', + GROUP => 'Uploader', + DEFAULT => [], + IGNORE_DEFAULT => 1, # Don't dump class to config + HELP => 'Package upload queues', + EXAMPLE => +'$upload_queues = [ + { + # Local queue directory where binaries are stored before uploaded + # by dupload. + dupload_local_queue_dir => "upload", + + # Upload site for buildd-upload to pass to dupload(1); see + # /etc/dupload.conf for possible values. + dupload_archive_name => "anonymous-ftp-master", + }, + + { + # Local queue directory where binaries are stored before uploaded + # by dupload. + dupload_local_queue_dir => "upload-security", + + # Upload site for buildd-upload to pass to dupload(1); see + # /etc/dupload.conf for possible values. + dupload_archive_name => "security", + } +];' + }); $conf->set_allowed_keys(\%buildd_keys); - Sbuild::DB::ClientConf::setup($conf); + Buildd::ClientConf::setup($conf); } sub read ($) { @@ -196,61 +367,6 @@ my $HOME = $conf->get('HOME'); - # Variables are undefined, so config will default to DEFAULT if unset. - my $admin_mail = undef; - my $apt_get = undef; - my $arch = undef; - my $autoclean_interval = undef; - my $build_log_keep = undef; - my $daemon_log_file = undef; - my $daemon_log_keep = undef; - my $daemon_log_rotate = undef; - my $daemon_log_send = undef; - my $delay_after_give_back = undef; - my $error_mail_window = undef; - my $idle_sleep_time = undef; - my $log_queued_messages = undef; - my $max_build = undef; - my $min_free_space = undef; - my $nice_level = undef; - my $no_detach = undef; - my $no_warn_pattern = undef; - my $pidfile = undef; - my $pkg_log_keep = undef; - my $secondary_daemon_threshold = undef; - my $should_build_msgs = undef; - my $ssh = undef; - my $statistics_mail = undef; - my $statistics_period = undef; - my $sudo = undef; - my $wanna_build_db_name = undef; - my $wanna_build_db_user = undef; - my $wanna_build_ssh_user = undef; - my $wanna_build_ssh_host = undef; - my $wanna_build_ssh_socket = undef; - my $wanna_build_ssh_options = undef; - my $warning_age = undef; - my @distributions; - my $defaults; - my @upload_queues; - - #legacy fields: - my @weak_no_auto_build; - my $mail_to = undef; - my %mail_to = (); - my $mail_from = undef; - my $build_regex = undef; # Should this be user settable? - my @no_auto_build; - my $no_build_regex = undef; - my $dupload_to = undef; - my $dupload_to_non_us = undef; - my $dupload_to_security = undef; - my @take_from_dists; - my $sshcmd; - my $sshsocket; - my $wanna_build_user; - my $wanna_build_dbbase; - my $global = $Sbuild::Sysconfig::paths{'BUILDD_CONF'}; my $user = "$HOME/.builddrc"; my %config_time = (); @@ -276,202 +392,205 @@ } } - # Need to reread all config files, even if one is updated. - if ($reread) { - foreach (@config_files) { - if (-r $_) { - my $e = eval `cat "$_"`; - if (!defined($e)) { - print STDERR "E: $_: Errors found in configuration file:\n$@"; - exit(1); - } - $conf->get('CONFIG_TIME')->{$_} = $config_time{$_}; - } - } - - # Set configuration if updated. - $conf->set('ADMIN_MAIL', $admin_mail); - $conf->set('APT_GET', $apt_get); - $conf->set('ARCH', $arch); - $conf->set('AUTOCLEAN_INTERVAL', $autoclean_interval); - $conf->set('BUILD_LOG_KEEP', $build_log_keep); - $conf->set('DAEMON_LOG_FILE', $daemon_log_file); - $conf->set('DAEMON_LOG_KEEP', $daemon_log_keep); - $conf->set('DAEMON_LOG_ROTATE', $daemon_log_rotate); - $conf->set('DAEMON_LOG_SEND', $daemon_log_send); - $conf->set('DELAY_AFTER_GIVE_BACK', $delay_after_give_back); - $conf->set('ERROR_MAIL_WINDOW', $error_mail_window); - $conf->set('IDLE_SLEEP_TIME', $idle_sleep_time); - $conf->set('LOG_QUEUED_MESSAGES', $log_queued_messages); - $conf->set('MIN_FREE_SPACE', $min_free_space); - $conf->set('NICE_LEVEL', $nice_level); - $conf->set('NO_DETACH', $no_detach); - $conf->set('NO_WARN_PATTERN', $no_warn_pattern); - $conf->set('PIDFILE', $pidfile); - $conf->set('PKG_LOG_KEEP', $pkg_log_keep); - $conf->set('SECONDARY_DAEMON_THRESHOLD', $secondary_daemon_threshold); - $conf->set('SHOULD_BUILD_MSGS', $should_build_msgs); - $conf->set('SSH', $ssh); - $conf->set('STATISTICS_MAIL', $statistics_mail); - $conf->set('STATISTICS_PERIOD', $statistics_period); - $conf->set('SUDO', $sudo); - $conf->set('WARNING_AGE', $warning_age); - - if ($sshcmd && $sshcmd =~ /^\s*(\S+)\s+(.+)/) { - my $rest = $2; - $conf->set('SSH', $1); - - #Try to pry the user out: - if ($rest =~ /(-l\s*(\S+))\s+/) { - $wanna_build_ssh_user = $2; - #purge this from the rest: - $rest =~ s/\Q$1//; - } elsif ($rest =~ /\s+(\S+)\@/) { - $wanna_build_ssh_user = $1; - $rest =~ s/\Q$1\E\@//; - } + # For compatibility only. Non-scalars are deprecated. + my $deprecated_init = <set('SSH', \$1); + + #Try to pry the user out: + if (\$rest =~ /(-l\\s*(\\S+))\\s+/) { + \$wanna_build_ssh_user = \$2; + #purge this from the rest: + \$rest =~ s/\\Q\$1//; + } elsif (\$rest =~ /\\s+(\\S+)\@/) { + \$wanna_build_ssh_user = \$1; + \$rest =~ s/\\Q\$1\\E\@//; + } - #Hope that the last argument is the host: - if ($rest =~ /\s+(\S+)\s*$/) { - $wanna_build_ssh_host = $1; - $rest =~ s/\Q$1//; - } + #Hope that the last argument is the host: + if (\$rest =~ /\\s+(\\S+)\\s*\$/) { + \$wanna_build_ssh_host = \$1; + \$rest =~ s/\\Q\$1//; + } - #rest should be options: - if ($rest !~ /\s*/) { - $wanna_build_ssh_options = [split $rest]; - } - } + #rest should be options: + if (\$rest !~ /\\s*/) { + \$wanna_build_ssh_options = [split \$rest]; + } +} - if ($sshsocket) { - $wanna_build_ssh_socket = $sshsocket; - } +if (\$sshsocket) { + \$wanna_build_ssh_socket = \$sshsocket; +} - if ($wanna_build_user) { - $wanna_build_db_user = $wanna_build_user; - } +if (\$wanna_build_user) { + \$wanna_build_db_user = \$wanna_build_user; +} - if ($wanna_build_dbbase) { - $wanna_build_db_name = $wanna_build_dbbase; - } +if (\$wanna_build_dbbase) { + \$wanna_build_db_name = \$wanna_build_dbbase; +} - #Convert old config, if needed: - my @distributions_info; - if (@take_from_dists) { - for my $dist (@take_from_dists) { - my %entry; +#Convert old config, if needed: +my \@distributions_info; +if (\@take_from_dists) { + for my \$dist (\@take_from_dists) { + my \%entry; - $entry{DIST_NAME} = $dist; - $entry{SSH} = $ssh; + \$entry{DIST_NAME} = \$dist; + \$entry{SSH} = \$ssh; - if ($dist =~ /security/) { - $entry{DUPLOAD_LOCAL_QUEUE_DIR} = 'upload-security'; - } - if ($build_regex) { - $entry{BUILD_REGEX} = $build_regex; - } - if ($no_build_regex) { - $entry{NO_BUILD_REGEX} = $build_regex; - } - if (@no_auto_build) { - $entry{NO_AUTO_BUILD} = \@no_auto_build; - } - if (@weak_no_auto_build) { - $entry{WEAK_NO_AUTO_BUILD} = \@weak_no_auto_build; - } + if (\$dist =~ /security/) { + \$entry{DUPLOAD_LOCAL_QUEUE_DIR} = 'upload-security'; + } + if (\$build_regex) { + \$entry{BUILD_REGEX} = \$build_regex; + } + if (\$no_build_regex) { + \$entry{NO_BUILD_REGEX} = \$build_regex; + } + if (\@no_auto_build) { + \$entry{NO_AUTO_BUILD} = \\\@no_auto_build; + } + if (\@weak_no_auto_build) { + \$entry{WEAK_NO_AUTO_BUILD} = \\\@weak_no_auto_build; + } - $entry{WANNA_BUILD_DB_NAME} = $wanna_build_db_name; - $entry{WANNA_BUILD_DB_USER} = $wanna_build_db_user; - $entry{WANNA_BUILD_SSH_HOST} = $wanna_build_ssh_host; - $entry{WANNA_BUILD_SSH_USER} = $wanna_build_ssh_user; - $entry{WANNA_BUILD_SSH_SOCKET} = $wanna_build_ssh_socket; - $entry{WANNA_BUILD_SSH_OPTIONS} = $wanna_build_ssh_options; - $entry{WANNA_BUILD_API} = 0; + \$entry{WANNA_BUILD_DB_NAME} = \$wanna_build_db_name; + \$entry{WANNA_BUILD_DB_USER} = \$wanna_build_db_user; + \$entry{WANNA_BUILD_SSH_HOST} = \$wanna_build_ssh_host; + \$entry{WANNA_BUILD_SSH_USER} = \$wanna_build_ssh_user; + \$entry{WANNA_BUILD_SSH_SOCKET} = \$wanna_build_ssh_socket; + \$entry{WANNA_BUILD_SSH_OPTIONS} = \$wanna_build_ssh_options; + \$entry{WANNA_BUILD_API} = 0; - my $dist_config = Buildd::DistConf::new_hash(\%entry); + my \$dist_config = Buildd::DistConf::new_hash(CHECK=>$conf->{'CHECK'}, + HASH=>\\\%entry); - push @distributions_info, $dist_config; - } - } else { - for my $raw_entry (@distributions) { - my %entry; - my @dist_names; - - #Find out for which distributions this entry is intended: - for my $key (keys %$raw_entry) { - if (uc($key) eq "DIST_NAME") { - if (ref($raw_entry->{$key}) eq "ARRAY") { - push @dist_names, @{$raw_entry->{$key}}; - } else { - push @dist_names, $raw_entry->{$key}; - } - } + push \@distributions_info, \$dist_config; + } +} else { + for my \$raw_entry (\@distributions) { + my \%entry; + my \@dist_names; + + #Find out for which distributions this entry is intended: + for my \$key (keys \%\$raw_entry) { + if (uc(\$key) eq "DIST_NAME") { + if (ref(\$raw_entry->{\$key}) eq "ARRAY") { + push \@dist_names, \@{\$raw_entry->{\$key}}; + } else { + push \@dist_names, \$raw_entry->{\$key}; } + } + } - for my $key (keys %$raw_entry) { - if (uc($key) ne "DIST_NAME") { - $entry{uc($key)} = $raw_entry->{$key}; - } - } + for my \$key (keys \%\$raw_entry) { + if (uc(\$key) ne "DIST_NAME") { + \$entry{uc(\$key)} = \$raw_entry->{\$key}; + } + } - for my $key (keys %$defaults) { - if (uc($key) ne "DIST_NAME" && not defined $entry{uc($key)}) { - $entry{uc($key)} = $defaults->{$key}; + for my \$key (keys \%\$defaults) { + if (uc(\$key) ne "DIST_NAME" && not defined \$entry{uc(\$key)}) { + \$entry{uc(\$key)} = \$defaults->{\$key}; } } - $entry{WANNA_BUILD_API} //= 1; + \$entry{WANNA_BUILD_API} //= 1; - #We need this to pass this to Sbuild::DB::Client: - $entry{SSH} = $ssh; + #We need this to pass this to Buildd::Client: + \$entry{SSH} = \$ssh; - #Make one entry per distribution, it's easier later on: - for my $dist (@dist_names) { - $entry{'DIST_NAME'} = $dist; - my $dist_config = Buildd::DistConf::new_hash(\%entry); - push @distributions_info, $dist_config; - } - } + #Make one entry per distribution, it's easier later on: + for my \$dist (\@dist_names) { + \$entry{'DIST_NAME'} = \$dist; + my \$dist_config = Buildd::DistConf::new_hash(\\\%entry); + push \@distributions_info, \$dist_config; + } + } +} + +\$conf->set('DISTRIBUTIONS', \\\@distributions_info); + +if (\@upload_queues) { + my \@upload_queue_configs; + for my \$raw_entry (\@upload_queues) { + my \%entry; + for my \$key (keys \%\$raw_entry) { + \$entry{uc(\$key)} = \$raw_entry->{\$key}; } - $conf->set('DISTRIBUTIONS', \@distributions_info); + my \$queue_config = Buildd::UploadQueueConf::new_hash(CHECK=>$conf->{'CHECK'}, + HASH=>\\\%entry); - if (@upload_queues) { - my @upload_queue_configs; - for my $raw_entry (@upload_queues) { - my %entry; - for my $key (keys %$raw_entry) { - $entry{uc($key)} = $raw_entry->{$key}; - } + push \@upload_queue_configs, \$queue_config; + } + \$conf->set('UPLOAD_QUEUES', \\\@upload_queue_configs); +} else { + push \@{\$conf->get('UPLOAD_QUEUES')}, + Buildd::UploadQueueConf::new_hash(CHECK=>$conf->{'CHECK'}, + HASH=> + { + DUPLOAD_LOCAL_QUEUE_DIR => 'upload', + DUPLOAD_ARCHIVE_NAME => 'anonymous-ftp-master' + } + ), + Buildd::UploadQueueConf::new_hash(CHECK=>$conf->{'CHECK'}, + HASH=> + { + DUPLOAD_LOCAL_QUEUE_DIR => 'upload-security', + DUPLOAD_ARCHIVE_NAME => 'security' + } + ); +} + +# Set here to allow user to override. +if (-t STDIN && -t STDOUT && \$conf->get('NO_DETACH')) { + \$conf->_set_default('VERBOSE', 1); +} else { + \$conf->_set_default('VERBOSE', 0); +} +END - my $queue_config = Buildd::UploadQueueConf::new_hash(\%entry); + $conf->read(\@config_files, $deprecated_init, $deprecated_setup, + $custom_setup); - push @upload_queue_configs, $queue_config; + # Update times + if ($reread) { + foreach (@config_files) { + if (-r $_) { + $conf->get('CONFIG_TIME')->{$_} = $config_time{$_}; } - $conf->set('UPLOAD_QUEUES', \@upload_queue_configs); - } else { - push @{$conf->get('UPLOAD_QUEUES')}, - Buildd::UploadQueueConf::new_hash( - { - DUPLOAD_LOCAL_QUEUE_DIR => 'upload', - DUPLOAD_ARCHIVE_NAME => 'anonymous-ftp-master' - } - ), - Buildd::UploadQueueConf::new_hash( - { - DUPLOAD_LOCAL_QUEUE_DIR => 'upload-security', - DUPLOAD_ARCHIVE_NAME => 'security' - } - ); - } - - # Set here to allow user to override. - if (-t STDIN && -t STDOUT && $conf->get('NO_DETACH')) { - $conf->set('VERBOSE', 1); } } - } 1; diff -Nru sbuild-0.60.9/lib/Buildd/Daemon.pm sbuild-0.62.2/lib/Buildd/Daemon.pm --- sbuild-0.60.9/lib/Buildd/Daemon.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/Daemon.pm 2011-04-04 23:03:13.000000000 +0000 @@ -31,7 +31,7 @@ use Sbuild qw($devnull df); use Sbuild::Sysconfig; use Sbuild::ChrootRoot; -use Sbuild::DB::Client; +use Buildd::Client; use Cwd; BEGIN { @@ -117,7 +117,6 @@ MAINLOOP: while( 1 ) { $self->check_restart(); - $self->read_config(); my ( $dist_config, $pkg_ver) = get_next_REDO($self); $self->do_build( $dist_config, $pkg_ver) if $pkg_ver; @@ -217,8 +216,9 @@ sub get_next_REDO { my $self = shift; my ( $dist_config, $pkg_ver); - foreach $dist_config (@{$self->get_conf('DISTRIBUTIONS')}) { - $pkg_ver = $self->get_from_REDO( $dist_config ); + foreach my $current_dist_config (@{$self->get_conf('DISTRIBUTIONS')}) { + $pkg_ver = $self->get_from_REDO( $current_dist_config ); + $dist_config = $current_dist_config; last if defined($pkg_ver); } return ( $dist_config, $pkg_ver); @@ -368,7 +368,13 @@ # $self->handle_prevfailed( $dist_config, grep( /^\Q$pkg\E_/, @_ ) ); # } else { # push( @output, grep( /^\Q$pkg\E_/, @_ ) ); - my $fields = { 'changelog' => 'extra-changelog', 'binNMU' => 'binNMU', 'extra-depends' => 'extra-depends', 'extra-conflicts' => 'extra-conflicts' }; + my $fields = { 'changelog' => 'extra-changelog', + 'binNMU' => 'binNMU', + 'extra-depends' => 'extra-depends', + 'extra-conflicts' => 'extra-conflicts', + 'build_dep_resolver' => 'build_dep_resolver', + 'arch_all' => 'arch_all', + }; for my $f (keys %$fields) { $ret->{$f} = $pkgd->{$fields->{$f}} if $pkgd->{$fields->{$f}}; } @@ -496,11 +502,23 @@ ."$todo->{'pv'}\n"); $self->write_stats("builds", 1); - my @sbuild_args = ( 'nice', '-n', $self->get_conf('NICE_LEVEL'), 'sbuild', + my @sbuild_args = (); + if ($self->get_conf('NICE_LEVEL') != 0) { + @sbuild_args = ( 'nice', '-n', $self->get_conf('NICE_LEVEL') ); + } + + push @sbuild_args, 'sbuild', '--apt-update', + '--no-apt-upgrade', + '--no-apt-distupgrade', '--batch', "--stats-dir=" . $self->get_conf('HOME') . "/stats", - "--dist=" . $dist_config->get('DIST_NAME') ); + "--dist=" . $dist_config->get('DIST_NAME'); + + if ($dist_config->get('SIGN_WITH')) { + push @sbuild_args, '--keyid=' . $dist_config->get('SIGN_WITH'); + } + #multi-archive-buildd keeps the mailto configuration in the builddrc, so #this needs to be passed over to sbuild. If the buildd config doesn't have #it, we hope that the address is configured in .sbuildrc and the right one: @@ -509,8 +527,12 @@ } #Some distributions (bpo, experimental) require a more complex dep resolver. #Ask sbuild to use another build-dep resolver if the config says so: - if ($dist_config->get('BUILD_DEP_RESOLVER')) { - push @sbuild_args, '--build-dep-resolver=' . $dist_config->get('BUILD_DEP_RESOLVER'); + if ($dist_config->get('BUILD_DEP_RESOLVER') || $todo->{'build_dep_resolver'}) { + push @sbuild_args, '--build-dep-resolver=' . ($dist_config->get('BUILD_DEP_RESOLVER') || $todo->{'build_dep_resolver'}); + } + # Check if we need to build the arch:all. + if (defined($todo->{'arch_all'}) && $todo->{'arch_all'}) { + push @sbuild_args, '--arch-all'; } push ( @sbuild_args, "--arch=" . $dist_config->get('BUILT_ARCHITECTURE') ) if $dist_config->get('BUILT_ARCHITECTURE'); @@ -576,6 +598,11 @@ $giveback = 0; $self->log("sbuild of $todo->{'pv'} succeeded -- marking as built in wanna-build\n"); $db->run_query('--built', '--dist=' . $dist_config->get('DIST_NAME'), $todo->{'pv'}); + + if ($dist_config->get('SIGN_WITH') && $dist_config->get('BUILT_ARCHITECTURE')) { + # XXX: Check if signature is present. + $self->move_to_upload($dist_config, $todo->{'pv'}, $todo->{'binNMU'}); + } } elsif ($status == 2) { $giveback = 0; $self->log("sbuild of $todo->{'pv'} failed with status $status (build failed) -- marking as attempted in wanna-build\n"); @@ -637,6 +664,33 @@ $self->log("Build finished.\n"); } +sub move_to_upload { + my $self = shift; + my $dist_config = shift; + my $pv = shift; + my $binNMUver = shift; + + my $arch = $dist_config->get('BUILT_ARCHITECTURE'); + my $upload_dir = $dist_config->get('DUPLOAD_LOCAL_QUEUE_DIR'); + + if ($binNMUver) { + $pv .= '+b' . $binNMUver; + } + + my $pkg_noepoch = $pv; + $pkg_noepoch =~ s/_\d*:/_/; + + my $changes_name = $pkg_noepoch . '_' . $arch . '.changes'; + + $self->log("$pv is autosigned, moving to '$upload_dir'\n"); + system sprintf('dcmd mv %s/build/%s %s/%s/', + $self->get_conf('HOME'), + $changes_name, + $self->get_conf('HOME'), + $dist_config->get('DUPLOAD_LOCAL_QUEUE_DIR')); + $self->log("$pv moved to '$upload_dir'\n"); +} + sub handle_prevfailed { my $self = shift; my $dist_config = shift; @@ -889,12 +943,6 @@ return 1; } -sub read_config { - my $self = shift; - - $self->get('Config')->read_config(); -} - sub shutdown { my $self = shift; my $signame = shift; diff -Nru sbuild-0.60.9/lib/Buildd/DistConf.pm sbuild-0.62.2/lib/Buildd/DistConf.pm --- sbuild-0.60.9/lib/Buildd/DistConf.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/DistConf.pm 2011-04-04 22:25:28.000000000 +0000 @@ -27,7 +27,7 @@ use Sbuild::ConfBase; use Sbuild::Sysconfig; -use Sbuild::DB::ClientConf qw(); +use Buildd::ClientConf qw(); BEGIN { use Exporter (); @@ -38,17 +38,17 @@ @EXPORT = qw(new_hash setup read_hash); } -sub new_hash ($); +sub new_hash (@); sub setup ($); sub read_hash ($$); -sub new_hash ($) { - my $data = shift; +sub new_hash (@) { + my %opts = @_; - my $queue_config = Sbuild::ConfBase->new(); + my $queue_config = Sbuild::ConfBase->new(%opts); Buildd::DistConf::setup($queue_config); - Buildd::DistConf::read_hash($queue_config, $data); + Buildd::DistConf::read_hash($queue_config, $opts{'HASH'}); return $queue_config; } @@ -56,8 +56,6 @@ sub setup ($) { my $conf = shift; - $conf->SUPER::init_allowed_keys(); - my $validate_directory_in_home = sub { my $conf = shift; my $entry = shift; @@ -126,11 +124,14 @@ }, 'BUILD_DEP_RESOLVER' => { DEFAULT => undef + }, + 'SIGN_WITH' => { + DEFAULT => undef },); $conf->set_allowed_keys(\%buildd_dist_keys); - Sbuild::DB::ClientConf::setup($conf); + Buildd::ClientConf::setup($conf); } sub read_hash($$) { diff -Nru sbuild-0.60.9/lib/Buildd/Mail.pm sbuild-0.62.2/lib/Buildd/Mail.pm --- sbuild-0.60.9/lib/Buildd/Mail.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/Mail.pm 2011-04-04 17:43:53.000000000 +0000 @@ -24,12 +24,12 @@ use strict; use warnings; -use Buildd qw(ll_send_mail lock_file unlock_file send_mail); +use Buildd qw(ll_send_mail lock_file unlock_file send_mail exitstatus); use Buildd::Conf qw(); use Buildd::Base; use Sbuild qw(binNMU_version $devnull); use Sbuild::ChrootRoot; -use Sbuild::DB::Client; +use Buildd::Client; use POSIX; use File::Basename; use MIME::QuotedPrint; @@ -1105,7 +1105,32 @@ } } -sub check_state ($$@) { +sub check_state ($@) { + my $self = shift; + my $mail_error = $self->get('Mail Error'); + my $retval = $self->check_state_internal(@_); + # check if we should retry the call + if ($retval == -1) { + my $interval = int(rand(120)); + $self->log("Retrying --info in $interval seconds...\n"); + # reset error to old value + $self->set('Mail Error', $mail_error); + # 0..120s of sleep ought to be enough for retrying; + # for mail bursts, this should get us out of the + # crticial mass + sleep $interval; + $retval = $self->check_state_internal(@_); + # remap the -1 retry code to failure + if ($retval == -1) { + return 0; + } else { + return $retval; + } + } + return $retval; +} + +sub check_state_internal ($$@) { my $self = shift; my $pkgv = shift; my $dist_config = shift; @@ -1121,7 +1146,9 @@ $self->set('Mail Error', $self->get('Mail Error') . "Couldn't start wanna-build --info: $!\n"); - return 0; + $self->log("Couldn't start wanna-build --info: $!\n"); + # let check_state() retry if needed + return -1; } my ($av, $as, $ab, $an); @@ -1133,6 +1160,14 @@ } close($pipe); + if ($?) { + my $t = "wanna-build --info failed with status ".exitstatus($?)."\n"; + $self->log($t); + $self->set('Mail Error', + $self->get('Mail Error') . $t); + return 0; + } + my $msg = "$pkgv($dist_name) check_state(@wanted_states): "; $av = binNMU_version($av,$an,undef) if (defined $an); if ($av ne $vers) { diff -Nru sbuild-0.60.9/lib/Buildd/Makefile.am sbuild-0.62.2/lib/Buildd/Makefile.am --- sbuild-0.60.9/lib/Buildd/Makefile.am 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/Makefile.am 2011-04-04 17:43:53.000000000 +0000 @@ -23,14 +23,16 @@ perlmodbuildddir = $(perlmoddir)/Buildd -MODULES = \ - Base.pm \ - Conf.pm \ - DistConf.pm \ - UploadQueueConf.pm \ - Daemon.pm \ - Mail.pm \ - Uploader.pm \ +MODULES = \ + Base.pm \ + Client.pm \ + ClientConf.pm \ + Conf.pm \ + DistConf.pm \ + UploadQueueConf.pm \ + Daemon.pm \ + Mail.pm \ + Uploader.pm \ Watcher.pm perlmodbuildd_DATA = \ diff -Nru sbuild-0.60.9/lib/Buildd/Makefile.in sbuild-0.62.2/lib/Buildd/Makefile.in --- sbuild-0.60.9/lib/Buildd/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -128,21 +128,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -157,6 +165,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -165,14 +174,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -220,13 +229,15 @@ perlmoddir = $(PERL_MODULE_DIR) perlmodbuildddir = $(perlmoddir)/Buildd MODULES = \ - Base.pm \ - Conf.pm \ - DistConf.pm \ - UploadQueueConf.pm \ - Daemon.pm \ - Mail.pm \ - Uploader.pm \ + Base.pm \ + Client.pm \ + ClientConf.pm \ + Conf.pm \ + DistConf.pm \ + UploadQueueConf.pm \ + Daemon.pm \ + Mail.pm \ + Uploader.pm \ Watcher.pm perlmodbuildd_DATA = \ diff -Nru sbuild-0.60.9/lib/Buildd/Uploader.pm sbuild-0.62.2/lib/Buildd/Uploader.pm --- sbuild-0.60.9/lib/Buildd/Uploader.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/Uploader.pm 2011-04-04 17:43:53.000000000 +0000 @@ -27,8 +27,6 @@ use Buildd qw(lock_file unlock_file unset_env exitstatus send_mail); use Buildd::Base; use Buildd::Conf qw(); -use Sbuild::ChrootRoot; -use Sbuild::DB::Client; BEGIN { use Exporter (); @@ -263,8 +261,8 @@ } foreach (@failed) { - my $u; - ($u = $_) =~ s/\.changes$/\.upload/; + my $u = $_; + $u =~ s/\.changes$/\.upload/; unlink( $u ); push( @log, "Removed $u due to upload errors.\n" ); $errs .= "Removed $u to reupload later.\n"; diff -Nru sbuild-0.60.9/lib/Buildd/UploadQueueConf.pm sbuild-0.62.2/lib/Buildd/UploadQueueConf.pm --- sbuild-0.60.9/lib/Buildd/UploadQueueConf.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Buildd/UploadQueueConf.pm 2011-04-04 17:43:53.000000000 +0000 @@ -37,17 +37,17 @@ @EXPORT = qw(new_hash setup read_hash); } -sub new_hash ($); +sub new_hash (@); sub setup ($); sub read_hash ($$); -sub new_hash ($) { - my $data = shift; +sub new_hash (@) { + my %opts = @_; - my $queue_config = Sbuild::ConfBase->new(); + my $queue_config = Sbuild::ConfBase->new(%opts); Buildd::UploadQueueConf::setup($queue_config); - Buildd::UploadQueueConf::read_hash($queue_config, $data); + Buildd::UploadQueueConf::read_hash($queue_config, $opts{'HASH'}); return $queue_config; } @@ -81,7 +81,7 @@ $conf->set_allowed_keys(\%dupload_queue_keys); - Sbuild::DB::ClientConf::setup($conf); + Buildd::ClientConf::setup($conf); } sub read_hash ($$) { diff -Nru sbuild-0.60.9/lib/Makefile.am sbuild-0.62.2/lib/Makefile.am --- sbuild-0.60.9/lib/Makefile.am 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Makefile.am 2011-04-04 17:43:53.000000000 +0000 @@ -21,7 +21,7 @@ include $(top_srcdir)/scripts/global.mk -SUBDIRS = Buildd Sbuild WannaBuild +SUBDIRS = Buildd Sbuild perlmod_DATA = \ Buildd.pm \ diff -Nru sbuild-0.60.9/lib/Makefile.in sbuild-0.62.2/lib/Makefile.in --- sbuild-0.60.9/lib/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/lib/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -168,21 +168,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -197,6 +205,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -205,14 +214,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -258,7 +267,7 @@ # Global options for use in all Makefiles. perlmoddir = $(PERL_MODULE_DIR) -SUBDIRS = Buildd Sbuild WannaBuild +SUBDIRS = Buildd Sbuild perlmod_DATA = \ Buildd.pm \ Sbuild.pm diff -Nru sbuild-0.60.9/lib/Sbuild/AptitudeResolver.pm sbuild-0.62.2/lib/Sbuild/AptitudeResolver.pm --- sbuild-0.60.9/lib/Sbuild/AptitudeResolver.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/AptitudeResolver.pm 2011-04-04 17:43:53.000000000 +0000 @@ -25,7 +25,6 @@ use warnings; use File::Temp qw(tempdir); -use Dpkg::Deps; use Sbuild qw(debug copy version_compare); use Sbuild::Base; use Sbuild::ResolverBase; @@ -84,6 +83,7 @@ $self->get_conf('APTITUDE'), '-y', '--without-recommends', + '-o', 'Dpkg::Options::=--force-confold', '-o', "Aptitude::CmdLine::Ignore-Trust-Violations=$ignore_trust_violations", '-o', 'Aptitude::ProblemResolver::StepScore=100', '-o', "Aptitude::ProblemResolver::SolutionCost=safety, priority, non-default-versions", diff -Nru sbuild-0.60.9/lib/Sbuild/Build.pm sbuild-0.62.2/lib/Sbuild/Build.pm --- sbuild-0.60.9/lib/Sbuild/Build.pm 2011-05-06 14:15:15.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/Build.pm 2011-04-05 09:43:57.000000000 +0000 @@ -25,6 +25,7 @@ use strict; use warnings; +use English; use POSIX; use Errno qw(:POSIX); use Fcntl; @@ -37,8 +38,10 @@ use Cwd qw(:DEFAULT abs_path); use Dpkg::Arch; use Dpkg::Control; +use MIME::Lite; +use Term::ANSIColor; -use Sbuild qw($devnull binNMU_version version_compare split_version copy isin send_build_log debug df); +use Sbuild qw($devnull binNMU_version version_compare split_version copy isin debug df send_mail); use Sbuild::Base; use Sbuild::ChrootInfoSchroot; use Sbuild::ChrootInfoSudo; @@ -48,6 +51,7 @@ use Sbuild::Sysconfig; use Sbuild::Utility qw(check_url download parse_file dsc_files); use Sbuild::Resolver qw(get_resolver); +use Sbuild::Exception; BEGIN { use Exporter (); @@ -66,6 +70,7 @@ my $self = $class->SUPER::new($conf); bless($self, $class); + $self->set('ABORT', undef); $self->set('Job', $dsc); $self->set('Arch', undef); $self->set('Chroot Dir', ''); @@ -76,7 +81,7 @@ $self->set('Pkg Status Trigger', undef); $self->set('Pkg Start Time', 0); $self->set('Pkg End Time', 0); - $self->set('Pkg Fail Stage', 0); + $self->set('Pkg Fail Stage', 'init'); $self->set('Build Start Time', 0); $self->set('Build End Time', 0); $self->set('Install Start Time', 0); @@ -130,6 +135,24 @@ return $self; } +sub request_abort { + my $self = shift; + my $reason = shift; + + $self->log_error("ABORT: $reason (requesting cleanup and shutdown)\n"); + $self->set('ABORT', $reason); +} + +sub check_abort { + my $self = shift; + + if ($self->get('ABORT')) { + Sbuild::Exception::Build->throw(error => "Aborting build: " . + $self->get('ABORT'), + failstage => "abort"); + } +} + sub set_dsc { my $self = shift; my $dsc = shift; @@ -146,9 +169,8 @@ }); if (!defined($pipe)) { - $self->log_error("Could not parse $dsc/debian/changelog: $!"); - $self->set('Invalid Source', 1); - goto set_vars; + Sbuild::Exception::Build->throw(error => "Could not parse $dsc/debian/changelog: $!", + failstage => "set-dsc"); } my $stanzas = parse_file($pipe); @@ -158,9 +180,8 @@ my $version = ${$stanza}{'Version'}; if (!defined($package) || !defined($version)) { - $self->log_error("Missing Source or Version in $dsc/debian/changelog"); - $self->set('Invalid Source', 1); - goto set_vars; + Sbuild::Exception::Build->throw(error => "Missing Source or Version in $dsc/debian/changelog", + failstage => "set-dsc"); } my $dir = getcwd(); @@ -179,7 +200,6 @@ $dsc = "$dir/" . $self->get('Package_OSVersion') . ".dsc"; } -set_vars: $self->set('DSC', $dsc); $self->set('Source Dir', dirname($dsc)); $self->set('DSC Base', basename($dsc)); @@ -261,54 +281,108 @@ return $self->get('Pkg Status'); } +# This function is the main entry point into the package build. It +# provides a top-level exception handler and does the initial setup +# including initiating logging and creating host chroot. The nested +# run_ functions it calls are separate in order to permit running +# cleanup tasks in a strict order. sub run { my $self = shift; - $self->set_status('building'); + eval { + $self->check_abort(); - $self->set('Pkg Start Time', time); - $self->set('Pkg End Time', $self->get('Pkg Start Time')); + $self->set_status('building'); - # Acquire the architecture we're building for. - $self->set('Arch', $self->get_conf('ARCH')); + $self->set('Pkg Start Time', time); + $self->set('Pkg End Time', $self->get('Pkg Start Time')); - my $dist = $self->get_conf('DISTRIBUTION'); - if (!defined($dist) || !$dist) { - $self->log("No distribution defined\n"); - goto cleanup_skip; - } + # Acquire the architecture we're building for. + $self->set('Arch', $self->get_conf('ARCH')); - if ($self->get('Invalid Source')) { - $self->log("Invalid source: " . $self->get('DSC') . "\n"); - $self->log("Skipping " . $self->get('Package') . " \n"); - $self->set_status('failed'); - goto cleanup_skip; - } + my $dist = $self->get_conf('DISTRIBUTION'); + if (!defined($dist) || !$dist) { + Sbuild::Exception::Build->throw(error => "No distribution defined", + failstage => "init"); + } - my $chroot_info; - if ($self->get_conf('CHROOT_MODE') eq 'schroot') { - $chroot_info = Sbuild::ChrootInfoSchroot->new($self->get('Config')); - } else { - $chroot_info = Sbuild::ChrootInfoSudo->new($self->get('Config')); + if ($self->get('Invalid Source')) { + Sbuild::Exception::Build->throw(error => "Invalid source " . $self->get('DSC'), + failstage => "init"); + } + + # TODO: Get package name from build object + if (!$self->open_build_log()) { + Sbuild::Exception::Build->throw(error => "Failed to open build log", + failstage => "init"); + } + + # Set a chroot to run commands in host + my $host = $self->get('Host'); + + # Host execution defaults (set streams) + my $host_defaults = $host->get('Defaults'); + $host_defaults->{'STREAMIN'} = $devnull; + $host_defaults->{'STREAMOUT'} = $self->get('Log Stream'); + $host_defaults->{'STREAMERR'} = $self->get('Log Stream'); + + $self->check_abort(); + $self->run_chroot(); + }; + + my $e; + if ($e = Exception::Class->caught('Sbuild::Exception::Build')) { + if ($e->status) { + $self->set_status($e->status); + } else { + $self->set_status("failed"); + } + $self->set('Pkg Fail Stage', $e->failstage); + $e->rethrow(); } +} + +# Pack up source if needed and then run the main chroot session. +# Close log during return/failure. +sub run_chroot { + my $self = shift; - # TODO: Get package name from build object - if (!$self->open_build_log()) { - goto cleanup_skip; + eval { + $self->check_abort(); + $self->run_pack_source(); + $self->check_abort(); + $self->run_chroot_session(); + }; + + # Log exception info and set status and fail stage prior to + # closing build log. + my $e; + if ($e = Exception::Class->caught('Sbuild::Exception::Build')) { + $self->log_error("$e\n"); + $self->log_info($e->info."\n") + if ($e->info); + if ($e->status) { + $self->set_status($e->status); + } else { + $self->set_status("failed"); + } + $self->set('Pkg Fail Stage', $e->failstage); } - # Set a chroot to run commands in host - my $host = $self->get('Host'); + $self->close_build_log(); - # Host execution defaults (set streams) - my $host_defaults = $host->get('Defaults'); - $host_defaults->{'STREAMIN'} = $devnull; - $host_defaults->{'STREAMOUT'} = $self->get('Log Stream'); - $host_defaults->{'STREAMERR'} = $self->get('Log Stream'); + if ($e) { + $e->rethrow(); + } +} +# Pack up local source tree +sub run_pack_source { + my $self=shift; + + $self->check_abort(); # Build the source package if given a Debianized source directory if ($self->get('Debian Source Dir')) { - $self->set('Pkg Fail Stage', 'pack-source'); $self->log_subsection("Build Source Package"); $self->log_subsubsection('clean'); @@ -320,15 +394,16 @@ PRIORITY => 0, }); if ($?) { - $self->log_error("Failed to clean source directory"); - - goto cleanup_log; + Sbuild::Exception::Build->throw(error => "Failed to clean source directory", + failstage => "pack-source"); } + $self->check_abort(); + $self->log_subsubsection('dpkg-source'); my @dpkg_source_command = ($self->get_conf('DPKG_SOURCE'), '-b'); - push @dpkg_source_command, @{$self->get_conf('DPKG_SOURCE_OPTIONS')} if - ($self->get_conf('DPKG_SOURCE_OPTIONS')); + push @dpkg_source_command, @{$self->get_conf('DPKG_SOURCE_OPTIONS')} + if ($self->get_conf('DPKG_SOURCE_OPTIONS')); push @dpkg_source_command, $self->get('Debian Source Dir'); $self->get('Host')->run_command( { COMMAND => \@dpkg_source_command, @@ -336,221 +411,357 @@ PRIORITY => 0, }); if ($?) { - $self->log_error("Failed to build source package"); - goto cleanup_log; + Sbuild::Exception::Build->throw(error => "Failed to clean source directory", + failstage => "pack-source"); } } +} - my $end_session = 1; - my $session = $chroot_info->create('chroot', - $self->get_conf('DISTRIBUTION'), - $self->get_conf('CHROOT'), - $self->get_conf('ARCH')); +# Create main chroot session and package resolver. Creates a lock in +# the chroot to prevent concurrent chroot usage (only important for +# non-snapshot chroots). Ends chroot session on return/failure. +sub run_chroot_session { + my $self=shift; - # Run pre build external commands - $self->run_external_commands("pre-build-commands", - $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), - $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); + eval { + $self->check_abort(); + my $chroot_info; + if ($self->get_conf('CHROOT_MODE') eq 'schroot') { + $chroot_info = Sbuild::ChrootInfoSchroot->new($self->get('Config')); + } else { + $chroot_info = Sbuild::ChrootInfoSudo->new($self->get('Config')); + } - if (!$session->begin_session()) { - $self->log("Error creating chroot session: skipping " . - $self->get('Package') . "\n"); - $self->set_status('failed'); - goto cleanup_unlocked_session; - } + my $host = $self->get('Host'); + + my $session = $chroot_info->create('chroot', + $self->get_conf('DISTRIBUTION'), + $self->get_conf('CHROOT'), + $self->get_conf('ARCH')); + + # Run pre build external commands + $self->check_abort(); + $self->run_external_commands("pre-build-commands", + $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), + $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); + $self->check_abort(); + if (!$session->begin_session()) { + Sbuild::Exception::Build->throw(error => "Error creating chroot session: skipping " . + $self->get('Package'), + failstage => "create-session"); + } + + $self->set('Session', $session); + + $self->check_abort(); + my $chroot_arch = $self->chroot_arch(); + if ($self->get('Arch') ne $chroot_arch) { + Sbuild::Exception::Build->throw(error => "Build architecture (" . $self->get('Arch') . + ") is not the same as the chroot architecture (" . + $chroot_arch . ")", + info => "Please specify the correct architecture with --arch, or use a chroot of the correct architecture", + failstage => "create-session"); + } + + $self->set('Chroot Dir', $session->get('Location')); + # TODO: Don't hack the build location in; add a means to customise + # the chroot directly. i.e. allow changing of /build location. + $self->set('Chroot Build Dir', + tempdir($self->get('Package') . '-XXXXXX', + DIR => $session->get('Location') . "/build")); + + my $filter; + $filter = $session->strip_chroot_path($self->get('Chroot Build Dir')); + $filter =~ s;^/;;; + $self->build_log_filter($filter, 'BUILDDIR'); + $filter = $session->get('Location'); + $filter =~ s;^/;;; + $self->build_log_filter($filter , 'CHROOT'); + # Need tempdir to be writable and readable by sbuild group. + $self->check_abort(); + $session->run_command( + { COMMAND => ['chown', 'sbuild:sbuild', + $session->strip_chroot_path($self->get('Chroot Build Dir'))], + USER => 'root', + DIR => '/' }); + if ($?) { + Sbuild::Exception::Build->throw(error => "Failed to set sbuild group ownership on chroot build dir", + failstage => "create-build-dir"); + } + $self->check_abort(); + $session->run_command( + { COMMAND => ['chmod', '0770', + $session->strip_chroot_path($self->get('Chroot Build Dir'))], + USER => 'root', + DIR => '/' }); + if ($?) { + Sbuild::Exception::Build->throw(error => "Failed to set sbuild group ownership on chroot build dir", + failstage => "create-build-dir"); + } + + $self->check_abort(); + # Needed so chroot commands log to build log + $session->set('Log Stream', $self->get('Log Stream')); + $host->set('Log Stream', $self->get('Log Stream')); + + # Chroot execution defaults + my $chroot_defaults = $session->get('Defaults'); + $chroot_defaults->{'DIR'} = + $session->strip_chroot_path($self->get('Chroot Build Dir')); + $chroot_defaults->{'STREAMIN'} = $devnull; + $chroot_defaults->{'STREAMOUT'} = $self->get('Log Stream'); + $chroot_defaults->{'STREAMERR'} = $self->get('Log Stream'); + $chroot_defaults->{'ENV'}->{'LC_ALL'} = 'POSIX'; + $chroot_defaults->{'ENV'}->{'SHELL'} = '/bin/sh'; + + my $resolver = get_resolver($self->get('Config'), $session, $host); + $resolver->set('Log Stream', $self->get('Log Stream')); + $resolver->set('Arch', $self->get('Arch')); + $resolver->set('Chroot Build Dir', $self->get('Chroot Build Dir')); + $self->set('Dependency Resolver', $resolver); + + # Lock chroot so it won't be tampered with during the build. + $self->check_abort(); + if (!$session->lock_chroot($self->get('Package_SVersion'), $$, $self->get_conf('USERNAME'))) { + Sbuild::Exception::Build->throw(error => "Error locking chroot session: skipping " . + $self->get('Package'), + failstage => "lock-session"); + } + + $self->check_abort(); + $self->run_chroot_session_locked(); + }; + + # End chroot session + my $session = $self->get('Session'); + my $end_session = + ($self->get_conf('PURGE_SESSION') eq 'always' || + ($self->get_conf('PURGE_SESSION') eq 'successful' && + $self->get_status() eq 'successful')) ? 1 : 0; + if ($end_session) { + $session->end_session(); + } else { + $self->log("Keeping session: " . $session->get('Session ID') . "\n"); + } + $session = undef; $self->set('Session', $session); - my $chroot_arch = $self->chroot_arch(); - if ($self->get('Arch') ne $chroot_arch) { - $self->log_error("Build architecture (" . $self->get('Arch') . - ") is not the same as the chroot architecture (" . - $chroot_arch . ")\n"); - $self->log_info("Please specify the correct architecture with --arch, or use a chroot of the correct architecture\n"); - $self->set_status('failed'); - goto cleanup_unlocked_session; + my $e; + if ($e = Exception::Class->caught('Sbuild::Exception::Build')) { + $e->rethrow(); } +} + +# Run tasks in a *locked* chroot. Update and upgrade packages. +# Unlocks chroot on return/failure. +sub run_chroot_session_locked { + my $self = shift; + + eval { + my $session = $self->get('Session'); + my $resolver = $self->get('Dependency Resolver'); + + $self->check_abort(); + $resolver->setup(); + + $self->check_abort(); + $self->run_chroot_update(); + + $self->check_abort(); + $self->run_fetch_install_packages(); + }; + + my $session = $self->get('Session'); + my $resolver = $self->get('Dependency Resolver'); + + $resolver->cleanup(); + # Unlock chroot now it's cleaned up and ready for other users. + $session->unlock_chroot(); - $self->set('Chroot Dir', $session->get('Location')); - # TODO: Don't hack the build location in; add a means to customise - # the chroot directly. i.e. allow changing of /build location. - $self->set('Chroot Build Dir', - tempdir($self->get_conf('USERNAME') . '-' . - $self->get('Package_SVersion') . '-' . - $self->get('Arch') . '-XXXXXX', - DIR => $session->get('Location') . "/build")); - - # Needed so chroot commands log to build log - $session->set('Log Stream', $self->get('Log Stream')); - $host->set('Log Stream', $self->get('Log Stream')); - - # Chroot execution defaults - my $chroot_defaults = $session->get('Defaults'); - $chroot_defaults->{'DIR'} = - $session->strip_chroot_path($self->get('Chroot Build Dir')); - $chroot_defaults->{'STREAMIN'} = $devnull; - $chroot_defaults->{'STREAMOUT'} = $self->get('Log Stream'); - $chroot_defaults->{'STREAMERR'} = $self->get('Log Stream'); - $chroot_defaults->{'ENV'}->{'LC_ALL'} = 'POSIX'; - $chroot_defaults->{'ENV'}->{'SHELL'} = '/bin/sh'; - - my $resolver = get_resolver($self->get('Config'), $session, $host); - $resolver->set('Log Stream', $self->get('Log Stream')); - $resolver->set('Arch', $self->get('Arch')); - $resolver->set('Chroot Build Dir', $self->get('Chroot Build Dir')); - $self->set('Dependency Resolver', $resolver); - - # Lock chroot so it won't be tampered with during the build. - if (!$session->lock_chroot($self->get('Package_SVersion'), $$, $self->get_conf('USERNAME'))) { - goto cleanup_unlocked_session; + my $e; + if ($e = Exception::Class->caught('Sbuild::Exception::Build')) { + $e->rethrow(); } +} - $resolver->setup(); +sub run_chroot_update { + my $self = shift; + my $resolver = $self->get('Dependency Resolver'); + + if ($self->get_conf('APT_CLEAN') || $self->get_conf('APT_UPDATE') || + $self->get_conf('APT_DISTUPGRADE') || $self->get_conf('APT_UPGRADE')) { + $self->log_subsection('Update chroot'); + } # Clean APT cache. - $self->set('Pkg Fail Stage', 'apt-get-clean'); + $self->check_abort(); if ($self->get_conf('APT_CLEAN')) { if ($resolver->clean()) { # Since apt-clean was requested specifically, fail on # error when not in buildd mode. $self->log("apt-get clean failed\n"); if ($self->get_conf('SBUILD_MODE') ne 'buildd') { - $self->set_status('failed'); - goto cleanup_session; + Sbuild::Exception::Build->throw(error => "apt-get clean failed", + failstage => "apt-get-clean"); } } } # Update APT cache. - $self->set('Pkg Fail Stage', 'apt-get-update'); + $self->check_abort(); if ($self->get_conf('APT_UPDATE')) { if ($resolver->update()) { # Since apt-update was requested specifically, fail on # error when not in buildd mode. - $self->log("apt-get update failed\n"); - $self->set_status('failed'); - goto cleanup_session; + if ($self->get_conf('SBUILD_MODE') ne 'buildd') { + Sbuild::Exception::Build->throw(error => "apt-get update failed", + failstage => "apt-get-update"); + } } } # Upgrade using APT. + $self->check_abort(); if ($self->get_conf('APT_DISTUPGRADE')) { - $self->set('Pkg Fail Stage', 'apt-get-distupgrade'); if ($self->get_conf('APT_DISTUPGRADE')) { if ($resolver->distupgrade()) { # Since apt-distupgrade was requested specifically, fail on # error when not in buildd mode. - $self->log("apt-get dist-upgrade failed\n"); if ($self->get_conf('SBUILD_MODE') ne 'buildd') { - $self->set_status('failed'); - goto cleanup_session; + Sbuild::Exception::Build->throw(error => "apt-get dist-upgrade failed", + failstage => "apt-get-dist-upgrade"); } } } } elsif ($self->get_conf('APT_UPGRADE')) { - $self->set('Pkg Fail Stage', 'apt-get-upgrade'); if ($self->get_conf('APT_UPGRADE')) { if ($resolver->upgrade()) { # Since apt-upgrade was requested specifically, fail on # error when not in buildd mode. - $self->log("apt-get upgrade failed\n"); if ($self->get_conf('SBUILD_MODE') ne 'buildd') { - $self->set_status('failed'); - goto cleanup_session; + Sbuild::Exception::Build->throw(error => "apt-get upgrade failed", + failstage => "apt-get-upgrade"); } } } } +} - $self->set('Pkg Fail Stage', 'fetch-src'); - if (!$self->fetch_source_files()) { - goto cleanup_packages; - } - - # Display message about chroot setup script option use being deprecated - if ($self->get_conf('CHROOT_SETUP_SCRIPT')) { - my $msg = "setup-hook option is deprecated. It has been superceded by "; - $msg .= "the chroot-setup-commands feature. setup-hook script will be "; - $msg .= "run via chroot-setup-commands.\n"; - $self->log_warning($msg); - } - - # Run specified chroot setup commands - $self->run_external_commands("chroot-setup-commands", - $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), - $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); - - $self->set('Install Start Time', time); - $self->set('Install End Time', $self->get('Install Start Time')); - $resolver->add_dependencies('CORE', join(", ", @{$self->get_conf('CORE_DEPENDS')}) , "", "", ""); - if (!$resolver->install_deps('core', 'CORE')) { - $self->log("Core source dependencies not satisfied; skipping\n"); - goto cleanup_packages; - } - - $resolver->add_dependencies('ESSENTIAL', $self->read_build_essential(), "", "", ""); - - my $snapshot = ""; - $snapshot = "gcc-snapshot" if ($self->get_conf('GCC_SNAPSHOT')); - $resolver->add_dependencies('GCC_SNAPSHOT', $snapshot , "", "", ""); - - # Add additional build dependencies specified on the command-line. - # TODO: Split dependencies into an array from the start to save - # lots of joining. - $resolver->add_dependencies('MANUAL', - join(", ", @{$self->get_conf('MANUAL_DEPENDS')}), - join(", ", @{$self->get_conf('MANUAL_DEPENDS_INDEP')}), - join(", ", @{$self->get_conf('MANUAL_CONFLICTS')}), - join(", ", @{$self->get_conf('MANUAL_CONFLICTS_INDEP')})); - - $resolver->add_dependencies($self->get('Package'), - $self->get('Build Depends'), - $self->get('Build Depends Indep'), - $self->get('Build Conflicts'), - $self->get('Build Conflicts Indep')); - - $self->set('Pkg Fail Stage', 'install-deps'); - if (!$resolver->install_deps($self->get('Package'), - 'ESSENTIAL', 'GCC_SNAPSHOT', 'MANUAL', - $self->get('Package'))) { - $self->log("Source-dependencies not satisfied; skipping " . - $self->get('Package') . "\n"); - goto cleanup_packages; - } - $self->set('Install End Time', time); - - $resolver->dump_build_environment(); - - $self->prepare_watches(keys %{$resolver->get('Changes')->{'installed'}}); +# Fetch sources, run setup, fetch and install core and package build +# deps, then run build. Cleans up build directory and uninstalls +# build depends on return/failure. +sub run_fetch_install_packages { + my $self = shift; + + $self->check_abort(); + eval { + my $session = $self->get('Session'); + my $resolver = $self->get('Dependency Resolver'); + + $self->check_abort(); + if (!$self->fetch_source_files()) { + Sbuild::Exception::Build->throw(error => "Failed to fetch source files", + failstage => "fetch-src"); + } + + # Display message about chroot setup script option use being deprecated + if ($self->get_conf('CHROOT_SETUP_SCRIPT')) { + my $msg = "setup-hook option is deprecated. It has been superceded by "; + $msg .= "the chroot-setup-commands feature. setup-hook script will be "; + $msg .= "run via chroot-setup-commands.\n"; + $self->log_warning($msg); + } + + # Run specified chroot setup commands + $self->check_abort(); + $self->run_external_commands("chroot-setup-commands", + $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), + $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); - if ($self->build()) { - $self->set_status('successful'); - } else { - $self->set_status('failed'); - } + $self->check_abort(); + $self->set('Install Start Time', time); + $self->set('Install End Time', $self->get('Install Start Time')); + $resolver->add_dependencies('CORE', join(", ", @{$self->get_conf('CORE_DEPENDS')}) , "", "", ""); + if (!$resolver->install_deps('core', 'CORE')) { + Sbuild::Exception::Build->throw(error => "Core build dependencies not satisfied; skipping", + failstage => "install-deps"); + } + + $resolver->add_dependencies('ESSENTIAL', $self->read_build_essential(), "", "", ""); + + my $snapshot = ""; + $snapshot = "gcc-snapshot" if ($self->get_conf('GCC_SNAPSHOT')); + $resolver->add_dependencies('GCC_SNAPSHOT', $snapshot , "", "", ""); + + # Add additional build dependencies specified on the command-line. + # TODO: Split dependencies into an array from the start to save + # lots of joining. + $resolver->add_dependencies('MANUAL', + join(", ", @{$self->get_conf('MANUAL_DEPENDS')}), + join(", ", @{$self->get_conf('MANUAL_DEPENDS_INDEP')}), + join(", ", @{$self->get_conf('MANUAL_CONFLICTS')}), + join(", ", @{$self->get_conf('MANUAL_CONFLICTS_INDEP')})); + + $resolver->add_dependencies($self->get('Package'), + $self->get('Build Depends'), + $self->get('Build Depends Indep'), + $self->get('Build Conflicts'), + $self->get('Build Conflicts Indep')); + + $self->check_abort(); + if (!$resolver->install_deps($self->get('Package'), + 'ESSENTIAL', 'GCC_SNAPSHOT', 'MANUAL', + $self->get('Package'))) { + Sbuild::Exception::Build->throw(error => "Package build dependencies not satisfied; skipping", + failstage => "install-deps"); + } + $self->set('Install End Time', time); + + $self->check_abort(); + $resolver->dump_build_environment(); + + $self->check_abort(); + $self->prepare_watches(keys %{$resolver->get('Changes')->{'installed'}}); + + $self->check_abort(); + if ($self->build()) { + $self->set_status('successful'); + } else { + $self->set('Pkg Fail Stage', "build"); + $self->set_status('failed'); + } - # Run specified chroot cleanup commands - $self->run_external_commands("chroot-cleanup-commands", - $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), - $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); - - if ($self->get('Pkg Status') eq "successful") { - $self->log_subsection("Post Build"); + # Run specified chroot cleanup commands + $self->check_abort(); + $self->run_external_commands("chroot-cleanup-commands", + $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), + $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); - # Run lintian. - $self->run_lintian(); + if ($self->get('Pkg Status') eq "successful") { + $self->log_subsection("Post Build"); - # Run piuparts. - $self->run_piuparts(); + # Run lintian. + $self->check_abort(); + $self->run_lintian(); + + # Run piuparts. + $self->check_abort(); + $self->run_piuparts(); + + # Run post build external commands + $self->check_abort(); + $self->run_external_commands("post-build-commands", + $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), + $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); - # Run post build external commands - $self->run_external_commands("post-build-commands", - $self->get_conf('LOG_EXTERNAL_COMMAND_OUTPUT'), - $self->get_conf('LOG_EXTERNAL_COMMAND_ERROR')); + } + }; - } + $self->log_subsection("Cleanup"); + my $session = $self->get('Session'); + my $resolver = $self->get('Dependency Resolver'); - cleanup_packages: my $purge_build_directory = ($self->get_conf('PURGE_BUILD_DIRECTORY') eq 'always' || ($self->get_conf('PURGE_BUILD_DIRECTORY') eq 'successful' && @@ -576,8 +787,6 @@ # Purge non-cloned session if ($is_cloned_session) { $self->log("Not cleaning session: cloned chroot in use\n"); - $end_session = 0 - if ($purge_build_directory == 0 || $purge_build_deps == 0); } else { if ($purge_build_deps) { # Removing dependencies @@ -587,27 +796,47 @@ } } - cleanup_session: - $resolver->cleanup(); - # Unlock chroot now it's cleaned up and ready for other users. - $session->unlock_chroot(); + my $e; + if ($e = Exception::Class->caught('Sbuild::Exception::Build')) { + $e->rethrow(); + } +} - cleanup_unlocked_session: - # End chroot session - if ($end_session == 1) { - $session->end_session(); - } else { - $self->log("Keeping session: " . $session->get('Session ID') . "\n"); +sub copy_to_chroot { + my $self = shift; + my $source = shift; + my $dest = shift; + + $self->check_abort(); + if (! File::Copy::copy($source, $dest)) { + $self->log_error("E: Failed to copy '$source' to '$dest': $!\n"); + exit (1); + return 0; } - $session = undef; - $self->set('Session', $session); - cleanup_log: - $self->close_build_log(); + $self->get('Session')->run_command( + { COMMAND => ['chown', 'sbuild:sbuild', + $self->get('Session')->strip_chroot_path($dest) . '/' . + basename($source)], + USER => 'root', + DIR => '/' }); + if ($?) { + $self->log_error("E: Failed to set sbuild group ownership on $dest\n"); + return 0; + } + $self->get('Session')->run_command( + { COMMAND => ['chmod', '0664', + $self->get('Session')->strip_chroot_path($dest) . '/' . + basename($source)], + USER => 'root', + DIR => '/' }); + if ($?) { + $self->log_error("E: Failed to set 0644 permissions on $dest\n"); + return 0; + } - cleanup_skip: + return 1; } - sub fetch_source_files { my $self = shift; @@ -635,6 +864,7 @@ return 0; } + $self->check_abort(); if ($self->get('DSC Base') =~ m/\.dsc$/) { # Work with a .dsc file. # $file is the name of the downloaded dsc file written in a tempfile. @@ -648,14 +878,12 @@ # Copy the local source files into the build directory. $self->log_subsubsection("Local sources"); $self->log("$dsc exists in $dir; copying to chroot\n"); - if (! File::Copy::copy("$dir/$dsc", "$build_dir")) { - $self->log_error("Could not copy $dir/$dsc to $build_dir\n"); + if (! $self->copy_to_chroot("$dir/$dsc", "$build_dir")) { return 0; } push(@fetched, "$build_dir/$dsc"); foreach (@cwd_files) { - if (! File::Copy::copy("$dir/$_", "$build_dir")) { - $self->log_error("Could not copy $dir/$_ to $build_dir\n"); + if (! $self->copy_to_chroot("$dir/$_", "$build_dir")) { return 0; } push(@fetched, "$build_dir/$_"); @@ -687,7 +915,7 @@ my $pipe = $self->get('Dependency Resolver')->pipe_apt_command( { COMMAND => [$self->get_conf('APT_CACHE'), '-q', 'showsrc', "$pkg"], - USER => $self->get_conf('USERNAME'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0, DIR => '/'}); if (!$pipe) { @@ -752,7 +980,7 @@ my $pipe2 = $self->get('Dependency Resolver')->pipe_apt_command( { COMMAND => [$self->get_conf('APT_GET'), '--only-source', '-q', '-d', 'source', "$pkg=$ver"], - USER => $self->get_conf('USERNAME'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0}) || return 0; while(<$pipe2>) { @@ -801,11 +1029,11 @@ } if ($dscarchs ne "any" && !($valid_arch) && !($dscarchs eq "all" && $self->get_conf('BUILD_ARCH_ALL')) ) { - my $msg = "$dsc: $arch not in arch list or does not match any arch "; - $msg .= "wildcards: $dscarchs -- skipping\n"; + my $msg = "$dsc: $arch not in arch list or does not match any arch wildcards: $dscarchs -- skipping\n"; $self->log($msg); - $self->set_status('skipped'); - $self->set('Pkg Fail Stage', "arch-check"); + Sbuild::Exception::Build->throw(error => "$dsc: $arch not in arch list or does not match any arch wildcards: $dscarchs -- skipping", + status => "skipped", + failstage => "arch-check"); return 0; } } @@ -851,7 +1079,7 @@ $err = $defaults->{'STREAMERR'} if ($log_error); $self->get('Session')->run_command( { COMMAND => \@{$command}, - USER => 'root', + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0, STREAMOUT => $out, STREAMERR => $err, @@ -1029,41 +1257,39 @@ return 0; } if (! -d "$build_dir/$dscdir") { - $self->set('Pkg Fail Stage', "unpack"); - # dpkg-source refuses to remove the remanants of an aborted - # dpkg-source extraction, so we will if necessary. - if (-d $tmpunpackdir) { - system ("rm -fr '$tmpunpackdir'"); - } $self->set('Sub Task', "dpkg-source"); $self->get('Session')->run_command( { COMMAND => [$self->get_conf('DPKG_SOURCE'), '-x', $dscfile, $dscdir], - USER => $self->get_conf('USERNAME'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0}); if ($?) { $self->log("FAILED [dpkg-source died]\n"); - - system ("rm -fr '$tmpunpackdir'") if -d $tmpunpackdir; - return 0; + Sbuild::Exception::Build->throw(error => "FAILED [dpkg-source died]", + failstage => "unpack"); } - $dscdir = "$build_dir/$dscdir"; - if (system( "chmod -R g-s,go+rX $dscdir" ) != 0) { + $self->get('Session')->run_command( + { COMMAND => ['chmod', '-R', 'g-s,go+rX', $dscdir], + USER => $self->get_conf('BUILD_USER'), + PRIORITY => 0}); + if ($?) { $self->log("chmod -R g-s,go+rX $dscdir failed.\n"); - return 0; + Sbuild::Exception::Build->throw(error => "chmod -R g-s,go+rX $dscdir failed", + failstage => "unpack"); } + + $dscdir = "$build_dir/$dscdir" } else { $dscdir = "$build_dir/$dscdir"; $self->log_subsubsection("Check unpacked source"); - $self->set('Pkg Fail Stage', "check-unpacked-version"); # check if the unpacked tree is really the version we need $dscdir = $self->get('Session')->strip_chroot_path($dscdir); my $pipe = $self->get('Session')->pipe_command( { COMMAND => ['dpkg-parsechangelog'], - USER => $self->get_conf('USERNAME'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0, DIR => $dscdir}); $self->set('Sub Task', "dpkg-parsechangelog"); @@ -1075,51 +1301,66 @@ close($pipe); if ($?) { $self->log("FAILED [dpkg-parsechangelog died]\n"); - return 0; + Sbuild::Exception::Build->throw(error => "FAILED [dpkg-parsechangelog died]", + failstage => "check-unpacked-version"); } if ($clog !~ /^Version:\s*(.+)\s*$/mi) { $self->log("dpkg-parsechangelog didn't print Version:\n"); - return 0; + Sbuild::Exception::Build->throw(error => "dpkg-parsechangelog didn't print Version:", + failstage => "check-unpacked-version"); } } $self->log_subsubsection("Check disc space"); - $self->set('Pkg Fail Stage', "check-space"); my $current_usage = `du -k -s "$dscdir"`; $current_usage =~ /^(\d+)/; $current_usage = $1; if ($current_usage) { my $free = df($dscdir); if ($free < 2*$current_usage && $self->get_conf('CHECK_SPACE')) { - $self->log("Disc space is propably not enough for building.\n". - "(Source needs $current_usage KB, free are $free KB.)\n"); - # TODO: Only purge in a single place. - $self->log("Purging $build_dir\n"); - $self->get('Session')->run_command( - { COMMAND => ['rm', '-rf', $build_dir], - USER => 'root', - PRIORITY => 0, - DIR => '/' }); - return 0; + Sbuild::Exception::Build->throw(error => "Disc space is probably not sufficient for building.", + info => "Source needs $current_usage KiB, while $free KiB is free.)", + failstage => "check-space"); + } else { + $self->log("Sufficient free space for build\n"); } } if ($self->get_conf('BIN_NMU') || $self->get_conf('APPEND_TO_VERSION')) { + if (!$self->get_conf('MAINTAINER_NAME')) { + Sbuild::Exception::Build->throw(error => "No maintainer specified.", + info => 'When making changelog additions for a binNMU or appending a version suffix, a maintainer must be specified for the changelog entry e.g. using $maintainer_name, $uploader_name or $key_id, (or the equivalent command-line options)', + failstage => "check-space"); + } + $self->log_subsubsection("Hack binNMU version"); - $self->set('Pkg Fail Stage', "hack-binNMU"); if (open( F, "<$dscdir/debian/changelog" )) { - my($firstline, $text); - $firstline = ""; - $firstline = while $firstline =~ /^$/; - { local($/); undef $/; $text = ; } + my $text = do { local $/; }; close( F ); - $firstline =~ /^(\S+)\s+\((\S+)\)\s+([^;]+)\s*;\s*urgency=(\S+)\s*$/; - my ($name, $version, $dists, $urgent) = ($1, $2, $3, $4); + + my $pipe = $self->get('Session')->pipe_command( + { COMMAND => ['dpkg-parsechangelog'], + USER => $self->get_conf('BUILD_USER'), + PRIORITY => 0, + DIR => $self->get('Session')->strip_chroot_path($dscdir) }); + my $clog = do { local $/; <$pipe> }; + close($pipe); + if ($?) { + $self->log("FAILED [dpkg-parsechangelog died]\n"); + return 0; + } + + my ($name) = $clog =~ /^Source:\s*(.*)$/m; + my ($version) = $clog =~ /^Version:\s*(.*)$/m; + my ($dists) = $clog =~ /^Distribution:\s*(.*)$/m; + my ($urgency) = $clog =~ /^Urgency:\s*(.*)$/m; + my ($date) = $clog =~ /^Date:\s*(.*)$/m; + my $NMUversion = $self->get('Version'); - chomp( my $date = `date -R` ); if (!open( F, ">$dscdir/debian/changelog" )) { $self->log("Can't open debian/changelog for binNMU hack: $!\n"); - return 0; + Sbuild::Exception::Build->throw(error => "Can't open debian/changelog for binNMU hack: $!", + failstage => "hack-binNMU"); } $dists = $self->get_conf('DISTRIBUTION'); @@ -1136,12 +1377,14 @@ print F "\n"; print F " -- " . $self->get_conf('MAINTAINER_NAME') . " $date\n\n"; - print F $firstline, $text; + print F $text; close( F ); - $self->log("*** Created changelog entry for bin-NMU version $NMUversion\n"); + $self->log("Created changelog entry for binNMU version $NMUversion\n"); } else { $self->log("Can't open debian/changelog -- no binNMU hack!\n"); + Sbuild::Exception::Build->throw(error => "Can't open debian/changelog -- no binNMU hack: $!!", + failstage => "hack-binNMU"); } } @@ -1169,10 +1412,21 @@ unlink "$dscdir/debian/files"; } + # Build tree not writable during build (except for the sbuild + # user performing the build). + $self->get('Session')->run_command( + { COMMAND => ['chmod', '-R', 'go-w', + $self->get('Session')->strip_chroot_path($self->get('Chroot Build Dir'))], + USER => 'root', + PRIORITY => 0}); + if ($?) { + $self->log("chmod og-w " . $self->get('Chroot Build Dir') . " failed.\n"); + return 0; + } + $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') ? $self->get_conf('FORCE_ORIG_SOURCE') ? "-sa" : "" : @@ -1207,7 +1461,7 @@ if (defined($self->get_conf('SIGNING_OPTIONS')) && $self->get_conf('SIGNING_OPTIONS')) { - if (ref($self->get_conf('SIGNING_OPTIONS') eq 'ARRAY')) { + if (ref($self->get_conf('SIGNING_OPTIONS')) eq 'ARRAY') { push (@{$buildcmd}, @{$self->get_conf('SIGNING_OPTIONS')}); } else { push (@{$buildcmd}, $self->get_conf('SIGNING_OPTIONS')); @@ -1230,7 +1484,7 @@ my $command = { COMMAND => $buildcmd, ENV => $buildenv, - USER => $self->get_conf('USERNAME'), + USER => $self->get_conf('BUILD_USER'), SETSID => 1, PRIORITY => 0, DIR => $bdir @@ -1271,6 +1525,16 @@ while(<$pipe>) { alarm($timeout); $last_time = time; + if ($self->get('ABORT')) { + my $pid = $command->{'PID'}; + $self->get('Session')->run_command( + { COMMAND => ['perl', + '-e', + "kill( \"TERM\", -$pid )"], + USER => 'root', + PRIORITY => 0, + DIR => '/' }); + } $self->log($_); } close($pipe); @@ -1294,9 +1558,13 @@ $self->log("Build finished at $date\n"); my @space_files = ("$dscdir"); + + $self->log_subsubsection("Finished"); if ($rv) { - $self->log("FAILED [dpkg-buildpackage died]\n"); + $self->log_error("Build failure (dpkg-buildpackage died)\n"); } else { + $self->log_info("Built successfully\n"); + if (-r "$dscdir/debian/files" && $self->get('Chroot Build Dir')) { my @files = $self->debian_files_list("$dscdir/debian/files"); @@ -1313,11 +1581,24 @@ } } + + # Restore write access to build tree now build is complete. + $self->get('Session')->run_command( + { COMMAND => ['chmod', '-R', 'g+w', + $self->get('Session')->strip_chroot_path($self->get('Chroot Build Dir'))], + USER => 'root', + PRIORITY => 0}); + if ($?) { + $self->log("chmod g+w " . $self->get('Chroot Build Dir') . " failed.\n"); + return 0; + } + + $self->log_subsection("Changes"); $changes = $self->get('Package_SVersion') . "_$arch.changes"; my @cfiles; if (-r "$build_dir/$changes") { my(@do_dists, @saved_dists); - $self->log("\n$changes:\n"); + $self->log_subsubsection("$changes:"); open( F, "<$build_dir/$changes" ); my $sys_build_dir = $self->get_conf('BUILD_DIR'); if (open( F2, ">$sys_build_dir/$changes.new" )) { @@ -1393,14 +1674,11 @@ system "mv", "-f", "$build_dir/$_", $self->get_conf('BUILD_DIR') and $self->log_error("Could not move $_ to .\n"); } - $self->log_subsection("Finished"); - $self->log("Built successfully\n"); } $self->check_watches(); $self->check_space(@space_files); - $self->log_sep(); return $rv == 0 ? 1 : 0; } @@ -1717,24 +1995,38 @@ my $pipe = $self->get('Session')->pipe_command( { COMMAND => ['dpkg', '--print-architecture'], - USER => $self->get_conf('USERNAME'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0, DIR => '/' }) || return undef; chomp(my $chroot_arch = <$pipe>); close($pipe); - die "Can't determine architecture of chroot: $!\n" + Sbuild::Exception::Build->throw(error => "Can't determine architecture of chroot: $!", + failstage => "chroot-arch") if ($? || !defined($chroot_arch)); return $chroot_arch; } +sub build_log_filter { + my $self = shift; + my $text = shift; + my $replacement = shift; + + if ($self->get_conf('LOG_FILTER')) { + $self->log($self->get('FILTER_PREFIX') . $text . ':' . $replacement . "\n"); + } +} + sub open_build_log { my $self = shift; my $date = strftime("%Y%m%d-%H%M", localtime($self->get('Pkg Start Time'))); + my $filter_prefix = '__SBUILD_FILTER_' . $$ . ':'; + $self->set('FILTER_PREFIX', $filter_prefix); + my $filename = $self->get_conf('LOG_DIR') . '/' . $self->get('Package_SVersion') . '-' . $self->get('Arch') . @@ -1752,10 +2044,13 @@ $SIG{'QUIT'} = 'IGNORE'; $SIG{'PIPE'} = 'IGNORE'; + $PROGRAM_NAME = 'package log for ' . $self->get('Package_SVersion') . '_' . $self->get('Arch'); + if (!$self->get_conf('NOLOG') && $self->get_conf('LOG_DIR_AVAILABLE')) { open( CPLOG, ">$filename" ) or - die "Can't open logfile $filename: $!\n"; + Sbuild::Exception::Build->throw(error => "Failed to open build log $filename: $!", + failstage => "init"); CPLOG->autoflush(1); $saved_stdout->autoflush(1); @@ -1776,21 +2071,57 @@ my $nolog = $self->get_conf('NOLOG'); my $log = $self->get_conf('LOG_DIR_AVAILABLE'); my $verbose = $self->get_conf('VERBOSE'); + my $log_colour = $self->get_conf('LOG_COLOUR'); + my @filter = (); + my ($text, $replacement); + my $filter_regex = "^$filter_prefix(.*):(.*)\$"; + my @ignore = (); while () { - if ($nolog) { + # Add a replacement pattern to filter (sent from main + # process in log stream). + if (m/$filter_regex/) { + ($text,$replacement)=($1,$2); + $replacement = "«$replacement»"; + push (@filter, [$text, $replacement]); + $_ = "I: NOTICE: Log filtering will replace '$text' with '$replacement'\n"; + } else { + # Filter out any matching patterns + foreach my $pattern (@filter) { + ($text,$replacement) = @{$pattern}; + s/$text/$replacement/g; + } + } + if (m/Deprecated key/ || m/please update your configuration/) { + my $skip = 0; + foreach my $ignore (@ignore) { + $skip = 1 if ($ignore eq $_); + } + next if $skip; + push(@ignore, $_); + } + + if ($nolog || $verbose) { + if (-t $saved_stdout && $log_colour) { + my $colour = 'reset'; + $colour = 'red' if (m/^E: /); + $colour = 'yellow' if (m/^W: /); + $colour = 'green' if (m/^I: /); + $colour = 'red' if (m/^Status:/); + $colour = 'green' if (m/^Status: successful$/); + print $saved_stdout color $colour; + } + print $saved_stdout $_; + if (-t $saved_stdout && $log_colour) { + print $saved_stdout color 'reset'; + } + # Manual flushing due to Perl 5.10 bug. Should autoflush. $saved_stdout->flush(); - } else { - if ($log) { + } + if (!$nolog && $log) { print CPLOG $_; - } - if ($verbose) { - print $saved_stdout $_; - # Manual flushing due to Perl 5.10 bug. Should autoflush. - $saved_stdout->flush(); - } } } @@ -1816,7 +2147,9 @@ $self->log("Package: " . $self->get('Package') . "\n"); $self->log("Version: " . $self->get('Version') . "\n"); $self->log("Source Version: " . $self->get('OVersion') . "\n"); + $self->log("Distribution: " . $self->get_conf('DISTRIBUTION') . "\n"); $self->log("Architecture: " . $self->get('Arch') . "\n"); + $self->log("\n"); } sub close_build_log { @@ -1854,6 +2187,15 @@ $self->log(sprintf("Build needed %02d:%02d:%02d, %dk disc space\n", $hours, $minutes, $seconds, $space)); + if ($self->get_status() eq "successful") { + if (defined($self->get_conf('KEY_ID')) && $self->get_conf('KEY_ID')) { + my $key_id = $self->get_conf('KEY_ID'); + $self->log(sprintf("Signature with key '%s' requested:\n", $key_id)); + my $changes = $self->get('Package_SVersion') . '_' . $self->get('Arch') . '.changes'; + system (sprintf('debsign -k%s %s', $key_id, $changes)); + } + } + my $subject = "Log for " . $self->get_status() . " build of " . $self->get('Package_Version'); if ($self->get('Arch')) { @@ -1865,15 +2207,123 @@ else { $subject .= " (dist=" . $self->get_conf('DISTRIBUTION') . ")"; } - send_build_log($self->get('Config'), $self->get_conf('MAILTO'), $subject, $filename) - if (defined($filename) && -f $filename && - $self->get_conf('MAILTO')); $self->set('Log File', undef); if (defined($self->get('Log Stream'))) { $self->get('Log Stream')->close(); # Close child logger process $self->set('Log Stream', undef); } + + $self->send_build_log($self->get_conf('MAILTO'), $subject, $filename) + if (defined($filename) && -f $filename && + $self->get_conf('MAILTO')); +} + +sub send_build_log { + my $self = shift; + my $to = shift; + my $subject = shift; + my $filename = shift; + + my $conf = $self->get('Config'); + + if ($conf->get('MIME_BUILD_LOG_MAILS')) { + return $self->send_mime_build_log($to, $subject, $filename); + } else { + return send_mail($conf, $to, $subject, $filename); + } +} + +sub send_mime_build_log { + my $self = shift; + my $to = shift; + my $subject = shift; + my $filename = shift; + + my $conf = $self->get('Config'); + my $tmp; # Needed for gzip, here for proper scoping. + + my $msg = MIME::Lite->new( + From => $conf->get('MAILFROM'), + To => $to, + Subject => $subject, + Type => 'multipart/mixed' + ); + + # Add the GPG key ID to the mail if present so that it's clear if the log + # still needs signing or not. + if (defined($self->get_conf('KEY_ID')) && $self->get_conf('KEY_ID')) { + $msg->add('Key-ID', $self->get_conf('KEY_ID')); + } + + if (!$conf->get('COMPRESS_BUILD_LOG_MAILS')) { + my $log_part = MIME::Lite->new( + Type => 'text/plain', + Path => $filename, + Filename => basename($filename) + ); + $log_part->attr('content-type.charset' => 'UTF-8'); + $msg->attach($log_part); + } else { + local( *F, *GZFILE ); + + if (!open( F, "<$filename" )) { + warn "Cannot open $filename for mailing: $!\n"; + return 0; + } + + $tmp = File::Temp->new(); + tie *GZFILE, 'IO::Zlib', $tmp->filename, 'wb'; + + while( ) { + print GZFILE $_; + } + untie *GZFILE; + + close F; + close GZFILE; + + $msg->attach( + Type => 'application/x-gzip', + Path => $tmp->filename, + Filename => basename($filename) . '.gz' + ); + } + + my $changes = $self->get('Package_SVersion') . '_' . $self->get('Arch') . '.changes'; + if ($self->get_status() eq 'successful' && -r $changes) { + $msg->attach( + Type => 'text/plain', + Path => $changes, + Filename => basename($changes) + ); + } + + my $stats = ''; + foreach my $stat (sort keys %{$self->get('Summary Stats')}) { + $stats .= sprintf("%s: %s\n", $stat, $self->get('Summary Stats')->{$stat}); + } + $msg->attach( + Type => 'text/plain', + Filename => basename($filename) . '.summary', + Data => $stats + ); + + local $SIG{'PIPE'} = 'IGNORE'; + + if (!open( MAIL, "|" . $conf->get('MAILPROG') . " -oem $to" )) { + warn "Could not open pipe to " . $conf->get('MAILPROG') . ": $!\n"; + close( F ); + return 0; + } + + $msg->print(\*MAIL); + + if (!close( MAIL )) { + warn $conf->get('MAILPROG') . " failed (exit status $?)\n"; + return 0; + } + return 1; } sub log_symlink { @@ -1893,7 +2343,7 @@ return if !$self->get_conf('AVG_TIME_DB'); my %db; if (!tie %db, 'GDBM_File', $self->get_conf('AVG_TIME_DB'), GDBM_WRCREAT, 0664) { - $self->log("Can't open average time db " . $self->get_conf('AVG_TIME_DB') . "\n"); + $self->log_warning("Can't open average time db " . $self->get_conf('AVG_TIME_DB') . "\n"); return; } $pkg =~ s/_.*//; @@ -1922,7 +2372,7 @@ return if !$self->get_conf('AVG_SPACE_DB') || $space == 0; my %db; if (!tie %db, 'GDBM_File', $self->get_conf('AVG_SPACE_DB'), &GDBM_WRCREAT, 0664) { - $self->log("Can't open average space db " . $self->get_conf('AVG_SPACE_DB') . "\n"); + $self->log_warning("Can't open average space db " . $self->get_conf('AVG_SPACE_DB') . "\n"); return; } $pkg =~ s/_.*//; diff -Nru sbuild-0.60.9/lib/Sbuild/ChrootPlain.pm sbuild-0.62.2/lib/Sbuild/ChrootPlain.pm --- sbuild-0.60.9/lib/Sbuild/ChrootPlain.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/ChrootPlain.pm 2011-04-04 17:43:53.000000000 +0000 @@ -127,7 +127,7 @@ if (($need_chroot || $need_su) && $user ne 'root'); push(@cmdline, '/usr/sbin/chroot', $self->get('Location')) if ($need_chroot); - push(@cmdline, $self->get_conf('SU'), '-p', "$user", '-s') + push(@cmdline, $self->get_conf('SU'), "$user", '-s') if ($need_su); push(@cmdline, '/bin/sh', '-c', "cd '$dir' && $shellcommand"); diff -Nru sbuild-0.60.9/lib/Sbuild/Chroot.pm sbuild-0.62.2/lib/Sbuild/Chroot.pm --- sbuild-0.60.9/lib/Sbuild/Chroot.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/Chroot.pm 2011-03-19 14:51:03.000000000 +0000 @@ -277,18 +277,20 @@ } # Sanitise environment - foreach my $var (keys %ENV) { - my $match = 0; - foreach my $regex (@{$self->get_conf('ENVIRONMENT_FILTER')}) { - $match = 1 if - $var =~ m/($regex)/; - } - delete $ENV{$var} if - $match == 0; - if (!$match) { - debug2("Environment filter: Deleted $var\n"); - } else { - debug2("Environment filter: Kept $var\n"); + if (defined $self->get_conf('ENVIRONMENT_FILTER')) { + foreach my $var (keys %ENV) { + my $match = 0; + foreach my $regex (@{$self->get_conf('ENVIRONMENT_FILTER')}) { + $match = 1 if + $var =~ m/($regex)/; + } + delete $ENV{$var} if + $match == 0; + if (!$match) { + debug2("Environment filter: Deleted $var\n"); + } else { + debug2("Environment filter: Kept $var\n"); + } } } diff -Nru sbuild-0.60.9/lib/Sbuild/ChrootSetup.pm sbuild-0.62.2/lib/Sbuild/ChrootSetup.pm --- sbuild-0.60.9/lib/Sbuild/ChrootSetup.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/ChrootSetup.pm 2011-04-04 17:43:53.000000000 +0000 @@ -77,20 +77,18 @@ } $session->run_command( - { COMMAND => ['chown', 'root:sbuild', '/build'], + { COMMAND => ['chown', 'sbuild:sbuild', '/build'], USER => 'root', DIR => '/' }); - return $? if $?; if ($?) { - print STDERR "E: Failed to set root:sbuild ownership on /build\n"; + print STDERR "E: Failed to set sbuild:sbuild ownership on /build\n"; return $? } $session->run_command( - { COMMAND => ['chmod', '0770', '/build'], + { COMMAND => ['chmod', '02770', '/build'], USER => 'root', DIR => '/' }); - return $? if $?; if ($?) { print STDERR "E: Failed to set 0750 permissions on /build\n"; return $? @@ -117,11 +115,11 @@ } $session->run_command( - { COMMAND => ['chown', '-R', 'root:sbuild', '/var/lib/sbuild'], + { COMMAND => ['chown', '-R', 'sbuild:sbuild', '/var/lib/sbuild'], USER => 'root', DIR => '/' }); if ($?) { - print STDERR "E: Failed to set root:sbuild ownership on /var/lib/sbuild/\n"; + print STDERR "E: Failed to set sbuild:sbuild ownership on /var/lib/sbuild/\n"; return $? } @@ -165,7 +163,7 @@ $session->run_command( { COMMAND => ['/bin/sh'], PRIORITY => 1, - USER => $conf->get('USERNAME'), + USER => $conf->get('BUILD_USER'), STREAMIN => \*STDIN, STREAMOUT => \*STDOUT, STREAMERR => \*STDERR }); @@ -246,11 +244,28 @@ print $tmpfh '%commit' . "\n"; close($tmpfh); + $host->run_command( + { COMMAND => ['chown', ':sbuild', $tmpfilename], + USER => $conf->get('USERNAME'), + DIR => '/' }); + if ($?) { + print STDERR "E: Failed to set :sbuild ownership on $tmpfilename\n"; + return $? + } + $host->run_command( + { COMMAND => ['chmod', '0660', $tmpfilename], + USER => $conf->get('USERNAME'), + DIR => '/' }); + if ($?) { + print STDERR "E: Failed to set 0660 permissions on $tmpfilename\n"; + return $? + } + my @command = ('gpg', '--no-default-keyring', '--batch', '--gen-key', $tmpfilename); $host->run_command( { COMMAND => \@command, - USER => $conf->get('USERNAME'), + USER => $conf->get('BUILD_USER'), PRIORITY => 0, DIR => '/'}); if ($?) { @@ -262,7 +277,7 @@ $conf->get('SBUILD_BUILD_DEPENDS_SECRET_KEY')); $host->run_command( { COMMAND => \@command, - USER => $conf->get('USERNAME'), + USER => $conf->get('BUILD_USER'), PRIORITY => 0, DIR => '/'}); diff -Nru sbuild-0.60.9/lib/Sbuild/ChrootSudo.pm sbuild-0.62.2/lib/Sbuild/ChrootSudo.pm --- sbuild-0.60.9/lib/Sbuild/ChrootSudo.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/ChrootSudo.pm 2011-04-04 17:43:53.000000000 +0000 @@ -117,7 +117,7 @@ } @cmdline = ($self->get_conf('SUDO'), '/usr/sbin/chroot', $self->get('Location'), - $self->get_conf('SU'), '-p', "$user", '-s', + $self->get_conf('SU'), "$user", '-s', '/bin/sh', '-c', "cd '$dir' && $shellcommand"); diff -Nru sbuild-0.60.9/lib/Sbuild/ConfBase.pm sbuild-0.62.2/lib/Sbuild/ConfBase.pm --- sbuild-0.60.9/lib/Sbuild/ConfBase.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/ConfBase.pm 2011-04-04 23:17:38.000000000 +0000 @@ -26,7 +26,6 @@ use Cwd qw(cwd); use Sbuild qw(isin); -use Sbuild::Log; BEGIN { use Exporter (); @@ -75,10 +74,28 @@ if !-d $directory; }; - my $home = $ENV{'HOME'} - or die "HOME not defined in environment!\n"; + my $set_distribution = sub { + my $conf = shift; + my $entry = shift; + my $value = shift; + my $key = $entry->{'NAME'}; + $conf->_set_value($key, $value); + + $conf->set('MAILTO', + $conf->get('MAILTO_HASH')->{$value}) + if ($value && + $conf->get('DISTRIBUTION') && + $conf->get('MAILTO_HASH')->{$value}); + }; + my @pwinfo = getpwuid($<); - my $username = $pwinfo[0] || $ENV{'LOGNAME'} || $ENV{'USER'}; + die "Can't get passwd entry for uid $<: $!" if (!@pwinfo); + my $home = $ENV{'HOME'}; + if (!$home) { + print STDERR "W: HOME not set in environment; falling back to $pwinfo[7]\n"; + $home = $pwinfo[7]; + } + my $username = $pwinfo[0]; my $fullname = $pwinfo[6]; $fullname =~ s/,.*$//; @@ -90,68 +107,125 @@ my %common_keys = ( 'PATH' => { - DEFAULT => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" + TYPE => 'STRING', + VARNAME => 'path', + GROUP => 'Build environment', + DEFAULT => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games", + HELP => 'PATH to set when running dpkg-buildpackage.' }, 'DISTRIBUTION' => { - SET => sub { - my $self = shift; + TYPE => 'STRING', + VARNAME => 'distribution', + GROUP => 'Build options', + DEFAULT => undef, + SET => $set_distribution, + HELP => 'Default distribution. By default, no distribution is defined, and the user must specify it with the -d option. However, a default may be configured here if desired. Users must take care not to upload to the wrong distribution when this option is set, for example experimental packages will be built for upload to unstable when this is not what is required.' + }, + 'OVERRIDE_DISTRIBUTION' => { + TYPE => 'BOOL', + GROUP => '__INTERNAL', + DEFAULT => 0, + GET => sub { + my $conf = shift; my $entry = shift; - my $value = shift; - my $key = $entry->{'NAME'}; - - $self->_set_value($key, $value); - my $override = ($self->get($key)) ? 1 : 0; - $self->set('OVERRIDE_DISTRIBUTION', $override); + my $dist = $conf->get('DISTRIBUTION'); - #Now, we might need to adjust the MAILTO based on the - #config data. We shouldn't do this if it was already - #explicitly set by the command line option: - if (defined($self->get('MAILTO_FORCED_BY_CLI')) && - !$self->get('MAILTO_FORCED_BY_CLI') - && defined($self->get('DISTRIBUTION')) - && $self->get('DISTRIBUTION') - && defined($self->get('MAILTO_HASH')) - && $self->get('MAILTO_HASH')->{$self->get('DISTRIBUTION')}) { - $self->set('MAILTO', - $self->get('MAILTO_HASH')->{$self->get('DISTRIBUTION')}); - } - } - }, - 'OVERRIDE_DISTRIBUTION' => { - DEFAULT => 0 + my $overridden = 0; + $overridden = 1 + if (defined($dist)); + + return $overridden; + }, + HELP => 'Default distribution has been overridden' }, 'MAILPROG' => { + TYPE => 'STRING', + VARNAME => 'mailprog', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => '/usr/sbin/sendmail' + DEFAULT => '/usr/sbin/sendmail', + HELP => 'Program to use to send mail' }, # TODO: Check if defaulted in code assuming undef 'ARCH' => { - DEFAULT => $host_arch + TYPE => 'STRING', + VARNAME => 'arch', + GROUP => 'Build options', + DEFAULT => $host_arch, + HELP => 'Build architecture.' }, 'HOST_ARCH' => { - DEFAULT => $host_arch + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => $host_arch, + HELP => 'Host architecture' }, 'HOSTNAME' => { - DEFAULT => $hostname + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => $hostname, + HELP => 'System hostname. Should not require setting.' }, 'HOME' => { - DEFAULT => $home + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => $home, + HELP => 'User\'s home directory. Should not require setting.' }, 'USERNAME' => { - DEFAULT => $username + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => $username, + HELP => 'User\'s username. Should not require setting.' }, 'FULLNAME' => { - DEFAULT => $fullname + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => $fullname, + HELP => 'User\'s full name. Should not require setting.' + }, + 'BUILD_USER' => { + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => 'sbuild', + HELP => 'Username used for building. Should not require setting.' }, 'CWD' => { - DEFAULT => cwd() + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => cwd(), + HELP => 'Current working directory at time of configuration reading.' }, 'VERBOSE' => { - DEFAULT => 0 + TYPE => 'NUMERIC', + VARNAME => 'verbose', + GROUP => 'Logging options', + DEFAULT => undef, + GET => sub { + my $conf = shift; + my $entry = shift; + + my $retval = $conf->_get($entry->{'NAME'}); + + # Note that during a build, STDOUT is redirected, so + # this test will fail. So set explicitly at start to + # ensure correctness. + if (!defined($retval)) { + $retval = 0; + $retval = 1 if (-t STDIN && -t STDOUT); + } + + return $retval; + }, + HELP => 'Verbose logging level' }, 'DEBUG' => { - DEFAULT => 0 + TYPE => 'NUMERIC', + VARNAME => 'debug', + GROUP => 'Logging options', + DEFAULT => 0, + HELP => 'Debug logging level' }, ); @@ -160,16 +234,25 @@ sub new { my $class = shift; + my %opts = @_; my $self = {}; - $self->{'config'} = {}; bless($self, $class); + $self->{'CHECK'} = 1; + $self->{'CHECK'} = $opts{'CHECK'} if exists $opts{'CHECK'}; + $self->init_allowed_keys(); return $self; } +sub get_keys { + my $self = shift; + + return keys(%{$self->{'KEYS'}}); +} + sub is_default { my $self = shift; my $key = shift; @@ -201,6 +284,60 @@ return $self->_get_property_value($key, 'DEFAULT'); } +sub _get_type { + my $self = shift; + my $key = shift; + + return $self->_get_property_value($key, 'TYPE'); +} + +sub _get_varname { + my $self = shift; + my $key = shift; + + return $self->_get_property_value($key, 'VARNAME'); +} + +sub _get_group { + my $self = shift; + my $key = shift; + + return $self->_get_property_value($key, 'GROUP'); +} + +sub _get_help { + my $self = shift; + my $key = shift; + + return $self->_get_property_value($key, 'HELP'); +} + +sub _get_example { + my $self = shift; + my $key = shift; + + return $self->_get_property_value($key, 'EXAMPLE'); +} + +sub _get_ignore_default { + my $self = shift; + my $key = shift; + + return $self->_get_property_value($key, 'IGNORE_DEFAULT'); +} + +sub _get { + my $self = shift; + my $key = shift; + + my $value = undef; + $value = $self->_get_value($key); + $value = $self->_get_default($key) + if (!defined($value)); + + return $value; +} + sub get { my $self = shift; my $key = shift; @@ -212,9 +349,7 @@ if (defined($entry->{'GET'})) { $value = $entry->{'GET'}->($self, $entry); } else { - $value = $self->_get_value($key); - $value = $self->_get_default($key) - if (!defined($value)); + $value = $self->_get($key); } } @@ -265,7 +400,7 @@ } else { $value = $self->_set_value($key, $value); } - if (defined($entry->{'CHECK'})) { + if ($self->{'CHECK'} && defined($entry->{'CHECK'})) { $entry->{'CHECK'}->($self, $entry); } $entry->{'NAME'} = $key; @@ -294,7 +429,7 @@ my $entry = $self->{'KEYS'}->{$key}; if (defined($entry)) { - if (defined($entry->{'CHECK'})) { + if ($self->{'CHECK'} && defined($entry->{'CHECK'})) { $entry->{'CHECK'}->($self, $entry); } } @@ -310,4 +445,70 @@ warn "I: The replacement is $newtype option '$newopt'" } +sub read ($$$$) { + my $conf = shift; + my $paths = shift; + my $deprecated_init = shift; + my $deprecated_setup = shift; + my $custom_setup = shift; + + foreach my $path (@{$paths}) { + $path = "'$path'"; + } + my $pathstring = join(", ", @{$paths}); + + my $HOME = $conf->get('HOME'); + + # Variables are undefined, so config will default to DEFAULT if unset. + + # Create script to source configuration. + my $script = "use strict;\nuse warnings;\n"; + my @keys = $conf->get_keys(); + foreach my $key (@keys) { + next if $conf->_get_group($key) =~ m/^__/; + + my $varname = $conf->_get_varname($key); + $script .= "my \$$varname = undef;\n"; + } + + # For compatibility only. Non-scalars are deprecated. + $script .= $deprecated_init + if ($deprecated_init); + + $script .= <set('PATH', \$path); +END + +# Non-scalar values, for backward compatibility. + $script .= $deprecated_setup + if ($deprecated_setup); + + foreach my $key (@keys) { + next if $conf->_get_group($key) =~ m/^__/; + + my $varname = $conf->_get_varname($key); + $script .= "\$conf->set('$key', \$$varname);\n"; + } + + $script .= $custom_setup + if ($custom_setup); + + + $script .= "return 1;\n"; + + eval $script or die "Error reading configuration: $@"; +} + 1; diff -Nru sbuild-0.60.9/lib/Sbuild/Conf.pm sbuild-0.62.2/lib/Sbuild/Conf.pm --- sbuild-0.60.9/lib/Sbuild/Conf.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/Conf.pm 2011-04-05 09:42:55.000000000 +0000 @@ -30,7 +30,6 @@ use Sbuild::ConfBase; use Sbuild::Sysconfig; use Sbuild::Log; -use Sbuild::DB::ClientConf qw(); BEGIN { use Exporter (); @@ -41,12 +40,11 @@ @EXPORT = qw(new setup read); } -sub new (); sub setup ($); sub read ($); -sub new () { - my $conf = Sbuild::ConfBase->new(); +sub new { + my $conf = Sbuild::ConfBase->new(@_); Sbuild::Conf::setup($conf); Sbuild::Conf::read($conf); @@ -109,19 +107,55 @@ } }; + my $set_signing_option = sub { + my $conf = shift; + my $entry = shift; + my $value = shift; + my $key = $entry->{'NAME'}; + $conf->_set_value($key, $value); + + $conf->set('MAINTAINER_NAME', $conf->get('UPLOADER_NAME')) + if (!$conf->get('MAINTAINER_NAME') && + $conf->get('UPLOADER_NAME')); + $conf->set('MAINTAINER_NAME', $conf->get('KEY_ID')) + if (!$conf->get('MAINTAINER_NAME') && + $conf->get('KEY_ID')); + + my @signing_options = (); + push @signing_options, "-m".$conf->get('MAINTAINER_NAME') + if defined $conf->get('MAINTAINER_NAME'); + push @signing_options, "-e".$conf->get('UPLOADER_NAME') + if defined $conf->get('UPLOADER_NAME'); + $conf->set('SIGNING_OPTIONS', \@signing_options); + }; + our $HOME = $conf->get('HOME'); my %sbuild_keys = ( 'CHROOT' => { - DEFAULT => undef + TYPE => 'STRING', + VARNAME => 'chroot', + GROUP => 'Chroot options', + DEFAULT => undef, + HELP => 'Default chroot (defaults to distribution[-arch][-sbuild])' }, 'BUILD_ARCH_ALL' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'build_arch_all', + GROUP => 'Build options', + DEFAULT => 0, + HELP => 'Build architecture: all packages by default' }, 'NOLOG' => { - DEFAULT => 0 + TYPE => 'BOOL', + GROUP => '__INTERNAL', + DEFAULT => 0, + HELP => 'Disable use of log file' }, 'SUDO' => { + TYPE => 'STRING', + VARNAME => 'sudo', + GROUP => 'Programs', CHECK => sub { my $conf = shift; my $entry = shift; @@ -152,13 +186,20 @@ } } }, - DEFAULT => 'sudo' + DEFAULT => 'sudo', + HELP => 'Path to sudo binary' }, 'SU' => { + TYPE => 'STRING', + VARNAME => 'su', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => 'su' + DEFAULT => 'su', + HELP => 'Path to su binary' }, 'SCHROOT' => { + TYPE => 'STRING', + GROUP => '__INTERNAL', CHECK => sub { my $conf = shift; my $entry = shift; @@ -169,23 +210,43 @@ $validate_program->($conf, $entry); } }, - DEFAULT => 'schroot' + DEFAULT => "$Sbuild::Sysconfig::paths{'SBUILD_LIBEXEC_DIR'}/sbuild-schroot", + HELP => 'Path to schroot binary' }, 'SCHROOT_OPTIONS' => { - DEFAULT => ['-q'] + TYPE => 'ARRAY:STRING', + VARNAME => 'schroot_options', + GROUP => 'Programs', + DEFAULT => ['-q'], + HELP => 'Additional command-line options for schroot' }, 'FAKEROOT' => { - DEFAULT => 'fakeroot' + TYPE => 'STRING', + VARNAME => 'fakeroot', + GROUP => 'Programs', + DEFAULT => 'fakeroot', + HELP => 'Path to fakeroot binary' }, 'APT_GET' => { + TYPE => 'STRING', + VARNAME => 'apt_get', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => 'apt-get' + DEFAULT => 'apt-get', + HELP => 'Path to apt-get binary' }, 'APT_CACHE' => { + TYPE => 'STRING', + VARNAME => 'apt_cache', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => 'apt-cache' + DEFAULT => 'apt-cache', + HELP => 'Path to apt-cache binary' }, 'APTITUDE' => { + TYPE => 'STRING', + VARNAME => 'aptitude', + GROUP => 'Programs', CHECK => sub { my $conf = shift; my $entry = shift; @@ -196,51 +257,127 @@ $validate_program->($conf, $entry); } }, - DEFAULT => 'aptitude' + DEFAULT => 'aptitude', + HELP => 'Path to aptitude binary' }, 'DPKG_BUILDPACKAGE_USER_OPTIONS' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + GROUP => '__INTERNAL', + DEFAULT => [], + HELP => 'Additional command-line options for dpkg-buildpackage. Not settable in config.' }, 'DPKG_SOURCE' => { + TYPE => 'STRING', + VARNAME => 'dpkg_source', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => 'dpkg-source' + DEFAULT => 'dpkg-source', + HELP => 'Path to dpkg-source binary' }, 'DPKG_SOURCE_OPTIONS' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + VARNAME => 'dpkg_source_opts', + GROUP => 'Programs', + DEFAULT => [], + HELP => 'Additional command-line options for dpkg-source' }, 'DCMD' => { + TYPE => 'STRING', + VARNAME => 'dcmd', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => 'dcmd' + DEFAULT => 'dcmd', + HELP => 'Path to dcmd binary' }, 'MD5SUM' => { + TYPE => 'STRING', + VARNAME => 'md5sum', + GROUP => 'Programs', CHECK => $validate_program, - DEFAULT => 'md5sum' + DEFAULT => 'md5sum', + HELP => 'Path to md5sum binary' }, 'AVG_TIME_DB' => { - DEFAULT => "$Sbuild::Sysconfig::paths{'SBUILD_LOCALSTATE_DIR'}/avg-build-times" + TYPE => 'STRING', + VARNAME => 'avg_time_db', + GROUP => 'Statistics', + DEFAULT => "$Sbuild::Sysconfig::paths{'SBUILD_LOCALSTATE_DIR'}/avg-build-times", + HELP => 'Name of a database for logging package build times (optional, no database is written if empty)' }, 'AVG_SPACE_DB' => { - DEFAULT => "$Sbuild::Sysconfig::paths{'SBUILD_LOCALSTATE_DIR'}/avg-build-space" + TYPE => 'STRING', + VARNAME => 'avg_space_db', + GROUP => 'Statistics', + DEFAULT => "$Sbuild::Sysconfig::paths{'SBUILD_LOCALSTATE_DIR'}/avg-build-space", + HELP => 'Name of a database for logging package space requirement (optional, no database is written if empty)' }, 'STATS_DIR' => { - DEFAULT => "$HOME/stats" + TYPE => 'STRING', + VARNAME => 'stats_dir', + GROUP => 'Statistics', + DEFAULT => "$HOME/stats", + HELP => 'Directory for writing build statistics to' }, 'PACKAGE_CHECKLIST' => { - DEFAULT => "$Sbuild::Sysconfig::paths{'SBUILD_LOCALSTATE_DIR'}/package-checklist" + TYPE => 'STRING', + VARNAME => 'package_checklist', + GROUP => 'Chroot options', + DEFAULT => "$Sbuild::Sysconfig::paths{'SBUILD_LOCALSTATE_DIR'}/package-checklist", + HELP => 'Where to store list currently installed packages inside chroot' }, 'BUILD_ENV_CMND' => { - DEFAULT => "" + TYPE => 'STRING', + VARNAME => 'build_env_cmnd', + GROUP => 'Build options', + DEFAULT => "", + HELP => 'This command is run with the dpkg-buildpackage command line passed to it (in the chroot, if doing a chrooted build). It is used by the sparc buildd (which is sparc64) to call the wrapper script that sets the environment to sparc (32-bit). It could be used for other build environment setup scripts. Note that this is superceded by schroot\'s \'command-prefix\' option' }, 'PGP_OPTIONS' => { - DEFAULT => ['-us', '-uc'] + TYPE => 'ARRAY:STRING', + VARNAME => 'pgp_options', + GROUP => 'Build options', + DEFAULT => ['-us', '-uc'], + HELP => 'Additional signing options for dpkg-buildpackage' }, 'LOG_DIR' => { + TYPE => 'STRING', + VARNAME => 'log_dir', + GROUP => 'Logging options', CHECK => sub { my $conf = shift; my $entry = shift; my $key = $entry->{'NAME'}; my $directory = $conf->get($key); + # Trigger creation + $conf->get('LOG_DIR_AVAILABLE'); + }, + DEFAULT => "$HOME/logs", + HELP => 'Directory for storing build logs' + }, + 'LOG_COLOUR' => { + TYPE => 'BOOL', + VARNAME => 'log_colour', + GROUP => 'Logging options', + DEFAULT => 1, + HELP => 'Add colour highlighting to interactive log messages (informational, warning and error messages). Log files will not be coloured.' + }, + 'LOG_FILTER' => { + TYPE => 'BOOL', + VARNAME => 'log_filter', + GROUP => 'Logging options', + DEFAULT => 1, + HELP => 'Filter variable strings from log messages such as the chroot name and build directory' + }, + 'LOG_DIR_AVAILABLE' => { + TYPE => 'BOOL', + GROUP => '__INTERNAL', + GET => sub { + my $conf = shift; + my $entry = shift; + + my $directory = $conf->get('LOG_DIR'); + my $log_dir_available = 1; if ($directory && ! -d $directory && !mkdir $directory) { @@ -248,12 +385,13 @@ $log_dir_available = 0; } - $conf->set('LOG_DIR_AVAILABLE', $log_dir_available); - }, - DEFAULT => "$HOME/logs" + return $log_dir_available; + } }, - 'LOG_DIR_AVAILABLE' => {}, 'MAILTO' => { + TYPE => 'STRING', + VARNAME => 'mailto', + GROUP => 'Logging options', CHECK => sub { my $conf = shift; my $entry = shift; @@ -263,21 +401,66 @@ if !$conf->get('MAILTO') && $conf->get('SBUILD_MODE') eq "buildd"; }, - DEFAULT => "" + GET => sub { + my $conf = shift; + my $entry = shift; + + my $retval = $conf->_get($entry->{'NAME'}); + + # Now, we might need to adjust the MAILTO based on the + # config data. We shouldn't do this if it was already + # explicitly set by the command line option: + if (defined($conf->get('MAILTO_FORCED_BY_CLI')) && + !$conf->get('MAILTO_FORCED_BY_CLI') + && defined($conf->get('DISTRIBUTION')) + && $conf->get('DISTRIBUTION') + && defined($conf->get('MAILTO_HASH')) + && $conf->get('MAILTO_HASH')->{$conf->get('DISTRIBUTION')}) { + $retval = $conf->get('MAILTO_HASH')->{$conf->get('DISTRIBUTION')}; + } + + return $retval; + }, + DEFAULT => "", + HELP => 'email address to mail build logs to' }, 'MAILTO_FORCED_BY_CLI' => { + TYPE => 'BOOL', + GROUP => '__INTERNAL', DEFAULT => 0 }, 'MAILTO_HASH' => { - DEFAULT => {} + TYPE => 'HASH:STRING', + VARNAME => 'mailto_hash', + GROUP => 'Logging options', + DEFAULT => {}, + HELP => 'Like MAILTO, but per-distribution. This is a hashref mapping distribution name to MAILTO. Note that for backward compatibility, this is also settable using the hash %mailto (deprecated), rather than a hash reference.' }, 'MAILFROM' => { - DEFAULT => "Source Builder " + TYPE => 'STRING', + VARNAME => 'mailfrom', + GROUP => 'Logging options', + DEFAULT => "Source Builder ", + HELP => 'email address set in the From line of build logs' }, 'COMPRESS_BUILD_LOG_MAILS' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'compress_build_log_mails', + GROUP => 'Logging options', + DEFAULT => 1, + HELP => 'Should build log mails be compressed?' + }, + 'MIME_BUILD_LOG_MAILS' => { + TYPE => 'BOOL', + VARNAME => 'mime_build_log_mails', + GROUP => 'Logging options', + DEFAULT => 1, + HELP => 'Should build log mails be MIME encoded?' }, 'PURGE_BUILD_DEPS' => { + TYPE => 'STRING', + VARNAME => 'purge_build_deps', + GROUP => 'Chroot options', CHECK => sub { my $conf = shift; my $entry = shift; @@ -288,9 +471,13 @@ if !isin($conf->get('PURGE_BUILD_DEPS'), qw(always successful never)); }, - DEFAULT => 'always' + DEFAULT => 'always', + HELP => 'When to purge the build dependencies after a build; possible values are "never", "successful", and "always"' }, 'PURGE_BUILD_DIRECTORY' => { + TYPE => 'STRING', + VARNAME => 'purge_build_directory', + GROUP => 'Chroot options', CHECK => sub { my $conf = shift; my $entry = shift; @@ -301,9 +488,30 @@ if !isin($conf->get('PURGE_BUILD_DIRECTORY'), qw(always successful never)); }, - DEFAULT => 'always' + DEFAULT => 'always', + HELP => 'When to purge the build directory after a build; possible values are "never", "successful", and "always"' + }, + 'PURGE_SESSION' => { + TYPE => 'STRING', + VARNAME => 'purge_session', + GROUP => 'Chroot options', + CHECK => sub { + my $conf = shift; + my $entry = shift; + my $key = $entry->{'NAME'}; + + die "Bad purge mode \'" . + $conf->get('PURGE_SESSION') . "\'" + if !isin($conf->get('PURGE_SESSION'), + qw(always successful never)); + }, + DEFAULT => 'always', + HELP => 'Purge the schroot session following a build. This is useful in conjunction with the --purge and --purge-deps options when using snapshot chroots, since by default the snapshot will be deleted. Possible values are "always" (default), "never", and "successful"' }, 'TOOLCHAIN_REGEX' => { + TYPE => 'ARRAY:STRING', + VARNAME => 'toolchain_regex', + GROUP => 'Build options', DEFAULT => ['binutils$', 'dpkg-dev$', 'gcc-[\d.]+$', @@ -315,18 +523,34 @@ 'gnumach-dev$', 'hurd-dev$', 'kfreebsd-kernel-headers$' - ] + ], + HELP => 'Regular expressions identifying toolchain packages. Note that for backward compatible, this is also settable using the array @toolchain_regex (deprecated), rather than an array reference.' }, 'STALLED_PKG_TIMEOUT' => { - DEFAULT => 150 # minutes + TYPE => 'NUMERIC', + VARNAME => 'stalled_pkg_timeout', + GROUP => 'Build timeouts', + DEFAULT => 150, # minutes + HELP => 'Time (in minutes) of inactivity after which a build is terminated. Activity is measured by output to the log file.' }, 'MAX_LOCK_TRYS' => { - DEFAULT => 120 + TYPE => 'NUMERIC', + VARNAME => 'max_lock_trys', + GROUP => 'Build timeouts', + DEFAULT => 120, + HELP => 'Number of times to try waiting for a lock.' }, 'LOCK_INTERVAL' => { - DEFAULT => 5 + TYPE => 'NUMERIC', + VARNAME => 'lock_interval', + GROUP => 'Build timeouts', + DEFAULT => 5, + HELP => 'Lock wait interval (seconds). Maximum wait time is (max_lock_trys × lock_interval).' }, 'CHROOT_MODE' => { + TYPE => 'STRING', + VARNAME => 'chroot_mode', + GROUP => 'Chroot options', CHECK => sub { my $conf = shift; my $entry = shift; @@ -336,81 +560,191 @@ if !isin($conf->get('CHROOT_MODE'), qw(schroot sudo)); }, - DEFAULT => 'schroot' + DEFAULT => 'schroot', + HELP => 'Mechanism to use for chroot virtualisation. Possible value are "schroot" (default) and "sudo".' }, 'CHROOT_SPLIT' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'chroot_split', + GROUP => 'Chroot options', + DEFAULT => 0, + HELP => 'Run in split mode? In split mode, apt-get and dpkg are run on the host system, rather than inside the chroot.' }, 'APT_POLICY' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'apt_policy', + GROUP => 'Dependency resolution', + DEFAULT => 1, + HELP => 'APT policy. 1 to enable additional checking of package versions available in the APT cache, or 0 to disable. 0 is the traditional sbuild behaviour; 1 is needed to build from additional repositories such as sarge-backports or experimental, and has a small performance cost. Note that this is only used by the internal resolver.' }, 'CHECK_SPACE' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'check_space', + GROUP => 'Build options', + DEFAULT => 1, + HELP => 'Check free disk space prior to starting a build. sbuild requires the free space to be at least twice the size of the unpacked sources to allow a build to proceed. Can be disabled to allow building if space is very limited, but the threshold to abort a build has been exceeded despite there being sufficient space for the build to complete.' }, 'CHECK_WATCHES' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'check_watches', + GROUP => 'Watch options', + DEFAULT => 1, + HELP => 'Check watched packages to discover missing build dependencies. This can be disabled to increase the speed of builds.' }, 'IGNORE_WATCHES_NO_BUILD_DEPS' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + VARNAME => 'ignore_watches_no_build_deps', + GROUP => 'Watch options', + DEFAULT => [], + HELP => 'Ignore watches on the following packages if the package doesn\'t have its own build dependencies in the .dsc. Note that for backward compatibility, this is also settable using the array @ignore_watches_no_build_deps (deprecated), rather than an array reference.' }, 'WATCHES' => { - DEFAULT => {} + TYPE => 'HASH:ARRAY:STRING', + VARNAME => 'watches', + GROUP => 'Watch options', + DEFAULT => {}, + HELP => 'Binaries for which the access time is controlled if they are not listed as source dependencies (note: /usr/bin is added if executable name does not start with \'/\'). Most buildds run with clean chroots at the moment, so the default list is now empty. This hash is a mapping between a package name and the binaries in the package stored as an array reference. Note that for backward compatibility, this is also settable using the hash %watches (deprecated), rather than using a hash reference.' }, 'BUILD_DIR' => { + TYPE => 'STRING', + VARNAME => 'build_dir', + GROUP => 'Core options', DEFAULT => cwd(), - CHECK => $validate_directory + IGNORE_DEFAULT => 1, # Don't dump class to config + EXAMPLE => '$build_dir = \'/home/pete/build\';', + CHECK => $validate_directory, + HELP => 'This option is deprecated. Directory for chroot symlinks and sbuild logs. Defaults to the current directory if unspecified. It is used as the location of chroot symlinks (obsolete) and for current build log symlinks and some build logs. There is no default; if unset, it defaults to the current working directory. $HOME/build is another common configuration.' }, 'SBUILD_MODE' => { - DEFAULT => 'user' + TYPE => 'STRING', + VARNAME => 'sbuild_mode', + GROUP => 'Core options', + DEFAULT => 'user', + HELP => 'sbuild behaviour; possible values are "user" (exit status reports build failures) and "buildd" (exit status does not report build failures) for use in a buildd setup. "buildd" also currently implies enabling of "legacy features" such as chroot symlinks in the build directory and the creation of current symlinks in the build directory.' }, 'CHROOT_SETUP_SCRIPT' => { - DEFAULT => undef + TYPE => 'STRING', + VARNAME => 'chroot_setup_script', + GROUP => 'Chroot options', + DEFAULT => undef, + HELP => 'Script to run to perform custom setup tasks in the chroot.' }, 'FORCE_ORIG_SOURCE' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'force_orig_source', + GROUP => 'Build options', + DEFAULT => 0, + HELP => 'By default, the -s option only includes the .orig.tar.gz when needed (i.e. when the Debian revision is 0 or 1). By setting this option to 1, the .orig.tar.gz will always be included when -s is used. This is equivalent to --force-orig-source.' }, 'INDIVIDUAL_STALLED_PKG_TIMEOUT' => { - DEFAULT => {} + TYPE => 'HASH:NUMERIC', + VARNAME => 'individual_stalled_pkg_timeout', + GROUP => 'Build timeouts', + DEFAULT => {}, + HELP => 'Some packages may exceed the general timeout (e.g. redirecting output to a file) and need a different timeout. This has is a mapping between source package name and timeout. Note that for backward compatibility, this is also settable using the hash %individual_stalled_pkg_timeout (deprecated) , rather than a hash reference.', + EXAMPLE => +'%individual_stalled_pkg_timeout = (smalleiffel => 300, + jade => 300, + atlas => 300, + glibc => 1000, + \'gcc-3.3\' => 300, + kwave => 600);' }, 'ENVIRONMENT_FILTER' => { + TYPE => 'ARRAY:STRING', + VARNAME => 'environment_filter', + GROUP => 'Core options', DEFAULT => ['^PATH$', '^DEB(IAN|SIGN)?_[A-Z_]+$', - '^(C(PP|XX)?|LD|F)FLAGS(_APPEND)?$'] + '^(C(PP|XX)?|LD|F)FLAGS(_APPEND)?$', + '^USER(NAME)?$', + '^LOGNAME$', + '^TERM$', + '^SHELL$'], + HELP => 'Only environment variables matching one of the regular expressions in this arrayref will be passed to dpkg-buildpackage and other programs run by sbuild.' }, 'LD_LIBRARY_PATH' => { - DEFAULT => undef + TYPE => 'STRING', + VARNAME => 'ld_library_path', + GROUP => 'Build environment', + DEFAULT => undef, + HELP => 'Library search path to use inside the chroot.' }, 'MAINTAINER_NAME' => { - DEFAULT => undef + TYPE => 'STRING', + VARNAME => 'maintainer_name', + GROUP => 'Maintainer options', + DEFAULT => undef, + SET => $set_signing_option, + HELP => 'Name to use as override in .changes files for the Maintainer field. The Maintainer field will not be overridden unless set here.' }, 'UPLOADER_NAME' => { - DEFAULT => undef + VARNAME => 'uploader_name', + TYPE => 'STRING', + GROUP => 'Maintainer options', + DEFAULT => undef, + SET => $set_signing_option, + HELP => 'Name to use as override in .changes file for the Changed-By: field.' }, 'KEY_ID' => { - DEFAULT => undef + TYPE => 'STRING', + VARNAME => 'key_id', + GROUP => 'Maintainer options', + DEFAULT => undef, + HELP => 'Key ID to use in .changes for the current upload. It overrides both $maintainer_name and $uploader_name.' }, 'SIGNING_OPTIONS' => { - DEFAULT => "" + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => "", + HELP => 'PGP-related identity options to pass to dpkg-buildpackage. Usually neither .dsc nor .changes files are not signed automatically.' }, 'APT_CLEAN' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'apt_clean', + GROUP => 'Chroot options', + DEFAULT => 0, + HELP => 'APT clean. 1 to enable running "apt-get clean" at the start of each build, or 0 to disable.' }, 'APT_UPDATE' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'apt_update', + GROUP => 'Chroot options', + DEFAULT => 1, + HELP => 'APT update. 1 to enable running "apt-get update" at the start of each build, or 0 to disable.' }, 'APT_UPDATE_ARCHIVE_ONLY' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'apt_update_archive_only', + GROUP => 'Chroot options', + DEFAULT => 1, + HELP => 'Update local temporary APT archive directly (1, the default) or set to 0 to disable and do a full apt update (not recommended in case the mirror content has changed since the build started).' }, 'APT_UPGRADE' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'apt_upgrade', + GROUP => 'Chroot options', + DEFAULT => 0, + HELP => 'APT upgrade. 1 to enable running "apt-get upgrade" at the start of each build, or 0 to disable.' }, 'APT_DISTUPGRADE' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'apt_distupgrade', + GROUP => 'Chroot options', + DEFAULT => 1, + HELP => 'APT distupgrade. 1 to enable running "apt-get dist-upgrade" at the start of each build, or 0 to disable.' }, 'APT_ALLOW_UNAUTHENTICATED' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'apt_allow_unauthenticated', + GROUP => 'Chroot options', + DEFAULT => 0, + HELP => 'Force APT to accept unauthenticated packages. By default, unauthenticated packages are not allowed. This is to keep the build environment secure, using apt-secure(8). By setting this to 1, APT::Get::AllowUnauthenticated is set to "true" when running apt-get. This is disabled by default: only enable it if you know what you are doing.' }, 'CHECK_DEPENDS_ALGORITHM' => { + TYPE => 'STRING', + VARNAME => 'check_depends_algorithm', + GROUP => 'Dependency resolution', CHECK => sub { my $conf = shift; my $entry = shift; @@ -422,68 +756,121 @@ if !isin($conf->get($key), qw(first-only alternatives)); }, - DEFAULT => 'first-only' - }, - 'AUTO_GIVEBACK' => { - DEFAULT => 0 + DEFAULT => 'first-only', + HELP => 'Algorithm for build dependency checks: possible values are "first_only" (used by Debian buildds) or "alternatives". Default: "first_only". Note that this is only used by the internal resolver.' }, 'BATCH_MODE' => { - DEFAULT => 0 + TYPE => 'BOOL', + GROUP => '__INTERNAL', + DEFAULT => 0, + HELP => 'Enable batch mode?' }, 'CORE_DEPENDS' => { - DEFAULT => ['build-essential', 'fakeroot'] + TYPE => 'ARRAY:STRING', + VARNAME => 'core_depends', + GROUP => 'Core options', + DEFAULT => ['build-essential', 'fakeroot'], + HELP => 'Packages which must be installed in the chroot for all builds.' }, 'MANUAL_DEPENDS' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + GROUP => '__INTERNAL', + DEFAULT => [], + HELP => 'Additional per-build dependencies. Do not set by hand.' }, 'MANUAL_CONFLICTS' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + GROUP => '__INTERNAL', + DEFAULT => [], + HELP => 'Additional per-build dependencies. Do not set by hand.' }, 'MANUAL_DEPENDS_INDEP' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + GROUP => '__INTERNAL', + DEFAULT => [], + HELP => 'Additional per-build dependencies. Do not set by hand.' }, 'MANUAL_CONFLICTS_INDEP' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + GROUP => '__INTERNAL', + DEFAULT => [], + HELP => 'Additional per-build dependencies. Do not set by hand.' }, 'BUILD_SOURCE' => { + TYPE => 'BOOL', + VARNAME => 'build_source', + GROUP => 'Build options', DEFAULT => 0, CHECK => $validate_append_version, + HELP => 'By default, do not build a source package (binary only build). Set to 1 to force creation of a source package, but note that this is inappropriate for binary NMUs, where the option will always be disabled.' }, 'ARCHIVE' => { - DEFAULT => undef + TYPE => 'STRING', + VARNAME => 'archive', + GROUP => 'Core options', + DEFAULT => undef, + HELP => 'Archive being built. Only set in build log. This might be useful for derivative distributions.' }, 'BIN_NMU' => { + TYPE => 'STRING', + GROUP => '__INTERNAL', DEFAULT => undef, - CHECK => $validate_append_version + CHECK => $validate_append_version, + HELP => 'Binary NMU changelog entry. Do not set by hand.' }, 'BIN_NMU_VERSION' => { - DEFAULT => undef + TYPE => 'STRING', + GROUP => '__INTERNAL', + DEFAULT => undef, + HELP => 'Binary NMU version number. Do not set by hand.' }, 'APPEND_TO_VERSION' => { + TYPE => 'STRING', + VARNAME => 'append_to_version', + GROUP => 'Build options', DEFAULT => undef, CHECK => $validate_append_version, + HELP => 'Suffix to append to version number. May be useful for derivative distributions.' }, 'GCC_SNAPSHOT' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'gcc_snapshot', + GROUP => 'Build options', + DEFAULT => 0, + HELP => 'Build using current GCC snapshot?' }, 'JOB_FILE' => { - DEFAULT => 'build-progress' + TYPE => 'STRING', + VARNAME => 'job_file', + GROUP => 'Core options', + DEFAULT => 'build-progress', + HELP => 'Job status file (only used in batch mode)' }, 'BUILD_DEP_RESOLVER' => { - DEFAULT => 'internal', + TYPE => 'STRING', + VARNAME => 'build_dep_resolver', + GROUP => 'Dependency resolution', + DEFAULT => 'apt', CHECK => sub { my $conf = shift; my $entry = shift; my $key = $entry->{'NAME'}; + warn "W: Build dependency resolver 'internal' is deprecated; please switch to 'apt'\n" + if $conf->get($key) eq 'internal'; + die '$key: Invalid build-dependency resolver \'' . $conf->get($key) . "'\nValid algorthms are 'internal', 'apt' and 'aptitude'\n" if !isin($conf->get($key), qw(internal apt aptitude)); }, + HELP => 'Build dependency resolver. The \'apt\' resolver is currently the default, and recommended for most users. This resolver uses apt-get to resolve dependencies. Alternative resolvers are \'apt\' and \'aptitude\', which use a built-in resolver module and aptitude to resolve build dependencies, respectively. The internal resolver is not capable of resolving complex alternative and virtual package dependencies, but is otherwise equivalent to apt. The aptitude resolver is similar to apt, but is useful in more complex situations, such as where multiple distributions are required, for example when building from experimental, where packages are needed from both unstable and experimental, but defaulting to unstable.' }, 'LINTIAN' => { + TYPE => 'STRING', + VARNAME => 'lintian', + GROUP => 'Build validation', CHECK => sub { my $conf = shift; my $entry = shift; @@ -494,19 +881,31 @@ $validate_program->($conf, $entry); } }, - DEFAULT => 'lintian' + DEFAULT => 'lintian', + HELP => 'Path to lintian binary' }, 'RUN_LINTIAN' => { + TYPE => 'BOOL', + VARNAME => 'run_lintian', + GROUP => 'Build validation', CHECK => sub { my $conf = shift; $conf->check('LINTIAN'); }, - DEFAULT => 0 + DEFAULT => 0, + HELP => 'Run lintian?' }, 'LINTIAN_OPTIONS' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + VARNAME => 'lintian_opts', + GROUP => 'Build validation', + DEFAULT => [], + HELP => 'Options to pass to lintian. Each option is a separate arrayref element. For example, [\'-i\', \'-v\'] to add -i and -v.' }, 'PIUPARTS' => { + TYPE => 'STRING', + VARNAME => 'piuparts', + GROUP => 'Build validation', CHECK => sub { my $conf = shift; my $entry = shift; @@ -517,264 +916,189 @@ $validate_program->($conf, $entry); } }, - DEFAULT => 'piuparts' + DEFAULT => 'piuparts', + HELP => 'Path to piuparts binary' }, 'RUN_PIUPARTS' => { + TYPE => 'BOOL', + VARNAME => 'run_piuparts', + GROUP => 'Build validation', CHECK => sub { my $conf = shift; $conf->check('PIUPARTS'); }, - DEFAULT => 0 + DEFAULT => 0, + HELP => 'Run piuparts' }, 'PIUPARTS_OPTIONS' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + VARNAME => 'piuparts_opts', + GROUP => 'Build validation', + DEFAULT => [], + HELP => 'Options to pass to piuparts. Each option is a separate arrayref element. For example, [\'-b\', \'\'] to add -b and .' }, 'PIUPARTS_ROOT_ARGS' => { - DEFAULT => [] + TYPE => 'ARRAY:STRING', + VARNAME => 'piuparts_root_args', + GROUP => 'Build validation', + DEFAULT => [], + HELP => 'Preceding arguments to launch piuparts as root. If no arguments are specified, piuparts will be launched via sudo.' }, 'EXTERNAL_COMMANDS' => { + TYPE => 'HASH:ARRAY:ARRAY:STRING', + VARNAME => 'external_commands', + GROUP => 'Chroot options', DEFAULT => { "pre-build-commands" => [], "chroot-setup-commands" => [], "chroot-cleanup-commands" => [], "post-build-commands" => [], }, + HELP => 'External commands to run at various stages of a build. Commands are held in a hash of arrays of arrays data structure.', + EXAMPLE => +'$external_commands = { + "pre-build-commands" => [ + [\'foo\', \'arg1\', \'arg2\'], + [\'bar\', \'arg1\', \'arg2\', \'arg3\'], + ], + "chroot-setup-commands" => [ + [\'foo\', \'arg1\', \'arg2\'], + [\'bar\', \'arg1\', \'arg2\', \'arg3\'], + ], + "chroot-cleanup-commands" => [ + [\'foo\', \'arg1\', \'arg2\'], + [\'bar\', \'arg1\', \'arg2\', \'arg3\'], + ], + "post-build-commands" => [ + [\'foo\', \'arg1\', \'arg2\'], + [\'bar\', \'arg1\', \'arg2\', \'arg3\'], + ], +};' }, 'LOG_EXTERNAL_COMMAND_OUTPUT' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'log_external_command_output', + GROUP => 'Chroot options', + DEFAULT => 1, + HELP => 'Log standard output of commands run by sbuild?' }, 'LOG_EXTERNAL_COMMAND_ERROR' => { - DEFAULT => 1 + TYPE => 'BOOL', + VARNAME => 'log_external_command_error', + GROUP => 'Chroot options', + DEFAULT => 1, + HELP => 'Log standard error of commands run by sbuild?' }, 'RESOLVE_VIRTUAL' => { - DEFAULT => 0 + TYPE => 'BOOL', + VARNAME => 'resolve_virtual', + GROUP => 'Dependency resolution', + DEFAULT => 0, + HELP => 'Attempt to resolve virtual dependencies? This option is only used by the internal resolver.' + }, + 'RESOLVE_ALTERNATIVES' => { + TYPE => 'BOOL', + VARNAME => 'resolve_alternatives', + GROUP => 'Dependency resolution', + DEFAULT => undef, + GET => sub { + my $conf = shift; + my $entry = shift; + + my $retval = $conf->_get($entry->{'NAME'}); + + if (!defined($retval)) { + $retval = 0; + $retval = 1 + if ($conf->get('BUILD_DEP_RESOLVER') eq 'aptitude'); + } + + return $retval; + }, + HELP => 'Should the dependency resolver use alternatives in Build-Depends and Build-Depends-Indep? By default, only the first alternative will be used; all other alternatives will be removed. Note that this does not include architecture-specific alternatives, which are reduced to the build architecture prior to alternatives removal. This should be left disabled when building for unstable; it may be useful when building backports.' }, 'SBUILD_BUILD_DEPENDS_SECRET_KEY' => { - DEFAULT => '/var/lib/sbuild/apt-keys/sbuild-key.sec' + TYPE => 'STRING', + VARNAME => 'sbuild_build_depends_secret_key', + GROUP => 'Dependency resolution', + DEFAULT => '/var/lib/sbuild/apt-keys/sbuild-key.sec', + HELP => 'GPG secret key for temporary local apt archive.' }, 'SBUILD_BUILD_DEPENDS_PUBLIC_KEY' => { - DEFAULT => '/var/lib/sbuild/apt-keys/sbuild-key.pub' + TYPE => 'STRING', + VARNAME => 'sbuild_build_depends_public_key', + GROUP => 'Dependency resolution', + DEFAULT => '/var/lib/sbuild/apt-keys/sbuild-key.pub', + HELP => 'GPG public key for temporary local apt archive.' }, ); $conf->set_allowed_keys(\%sbuild_keys); - Sbuild::DB::ClientConf::setup($conf); } sub read ($) { my $conf = shift; # Set here to allow user to override. - if (-t STDIN && -t STDOUT && $conf->get('VERBOSE') == 0) { - $conf->set('VERBOSE', 1); + if (-t STDIN && -t STDOUT) { + $conf->_set_default('VERBOSE', 1); + } else { + $conf->_set_default('VERBOSE', 0); } my $HOME = $conf->get('HOME'); - # Variables are undefined, so config will default to DEFAULT if unset. - my $mailprog = undef; - my $dpkg = undef; - my $sudo = undef; - my $su = undef; - my $schroot = undef; - my $schroot_options = undef; - my $fakeroot = undef; - my $apt_get = undef; - my $apt_cache = undef; - my $aptitude = undef; - my $dpkg_source = undef; - my $dpkg_source_opts = undef; - my $dcmd = undef; - my $md5sum = undef; - my $avg_time_db = undef; - my $avg_space_db = undef; - my $stats_dir = undef; - my $package_checklist = undef; - my $build_env_cmnd = undef; - my $pgp_options = undef; - my $log_dir = undef; - my $mailto = undef; - my %mailto; - undef %mailto; - my $mailfrom = undef; - my $compress_build_log_mails = undef; - my $purge_build_deps = undef; - my $purge_build_directory = undef; - my @toolchain_regex; - undef @toolchain_regex; - my $stalled_pkg_timeout = undef; - my $max_lock_trys = undef; - my $lock_interval = undef; - my $apt_policy = undef; - my $check_space = undef; - my $check_watches = undef; - my @ignore_watches_no_build_deps; - undef @ignore_watches_no_build_deps; - my %watches; - undef %watches; - my $chroot_mode = undef; - my $chroot_split = undef; - my $sbuild_mode = undef; - my $debug = undef; - my $build_source = undef; - my $force_orig_source = undef; - my $chroot_setup_script = undef; - my %individual_stalled_pkg_timeout; - undef %individual_stalled_pkg_timeout; - my $path = undef; - my $environment_filter = undef; - my $ld_library_path = undef; - my $maintainer_name = undef; - my $uploader_name = undef; - my $key_id = undef; - my $apt_clean = undef; - my $apt_update = undef; - my $apt_update_archive_only = undef; - my $apt_upgrade = undef; - my $apt_distupgrade = undef; - my $apt_allow_unauthenticated = undef; - my $check_depends_algorithm = undef; - my $distribution = undef; - my $archive = undef; - my $chroot = undef; - my $build_arch_all = undef; - my $arch = undef; - my $job_file = undef; - my $build_dir = undef; - my $build_dep_resolver = undef; - 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; - my $resolve_virtual = undef; - my $core_depends = undef; - - foreach ($Sbuild::Sysconfig::paths{'SBUILD_CONF'}, "$HOME/.sbuildrc") { - if (-r $_) { - my $e = eval `cat "$_"`; - if (!defined($e)) { - print STDERR "E: $_: Errors found in configuration file:\n$@"; - exit(1); - } - } - } + my $files = ["$Sbuild::Sysconfig::paths{'SBUILD_CONF'}", + "$HOME/.sbuildrc"]; - # Needed before any program validation. - $conf->set('PATH', $path); - # Set before APT_GET or APTITUDE to allow correct validation. - $conf->set('BUILD_DEP_RESOLVER', $build_dep_resolver); - $conf->set('RESOLVE_VIRTUAL', $resolve_virtual); - $conf->set('CORE_DEPENDS', $core_depends); - $conf->set('ARCH', $arch); - $conf->set('DISTRIBUTION', $distribution); - $conf->set('DEBUG', $debug); - $conf->set('MAILPROG', $mailprog); - $conf->set('ARCHIVE', $archive); - $conf->set('CHROOT', $chroot); - $conf->set('BUILD_ARCH_ALL', $build_arch_all); - $conf->set('SUDO', $sudo); - $conf->set('SU', $su); - $conf->set('SCHROOT', $schroot); - $conf->set('SCHROOT_OPTIONS', $schroot_options); - $conf->set('FAKEROOT', $fakeroot); - $conf->set('APT_GET', $apt_get); - $conf->set('APT_CACHE', $apt_cache); - $conf->set('APTITUDE', $aptitude); - $conf->set('DPKG_SOURCE', $dpkg_source); - $conf->set('DPKG_SOURCE_OPTIONS', $dpkg_source_opts); - $conf->set('DCMD', $dcmd); - $conf->set('MD5SUM', $md5sum); - $conf->set('AVG_TIME_DB', $avg_time_db); - $conf->set('AVG_SPACE_DB', $avg_space_db); - $conf->set('STATS_DIR', $stats_dir); - $conf->set('PACKAGE_CHECKLIST', $package_checklist); - $conf->set('BUILD_ENV_CMND', $build_env_cmnd); - $conf->set('PGP_OPTIONS', $pgp_options); - $conf->set('LOG_DIR', $log_dir); - $conf->set('MAILTO', $mailto); - $conf->set('MAILTO_HASH', \%mailto) - if (%mailto); - $conf->set('MAILFROM', $mailfrom); - $conf->set('COMPRESS_BUILD_LOG_MAILS', $compress_build_log_mails); - $conf->set('PURGE_BUILD_DEPS', $purge_build_deps); - $conf->set('PURGE_BUILD_DIRECTORY', $purge_build_directory); - $conf->set('TOOLCHAIN_REGEX', \@toolchain_regex) - if (@toolchain_regex); - $conf->set('STALLED_PKG_TIMEOUT', $stalled_pkg_timeout); - $conf->set('MAX_LOCK_TRYS', $max_lock_trys); - $conf->set('LOCK_INTERVAL', $lock_interval); - $conf->set('APT_POLICY', $apt_policy); - $conf->set('CHECK_WATCHES', $check_watches); - $conf->set('CHECK_SPACE', $check_space); - $conf->set('IGNORE_WATCHES_NO_BUILD_DEPS', - \@ignore_watches_no_build_deps) - if (@ignore_watches_no_build_deps); - $conf->set('WATCHES', \%watches) - if (%watches); - $conf->set('CHROOT_MODE', $chroot_mode); - $conf->set('CHROOT_SPLIT', $chroot_split); - $conf->set('SBUILD_MODE', $sbuild_mode); - $conf->set('FORCE_ORIG_SOURCE', $force_orig_source); - $conf->set('BUILD_SOURCE', $build_source); - $conf->set('CHROOT_SETUP_SCRIPT', $chroot_setup_script); - $conf->set('INDIVIDUAL_STALLED_PKG_TIMEOUT', - \%individual_stalled_pkg_timeout) - if (%individual_stalled_pkg_timeout); - $conf->set('ENVIRONMENT_FILTER', $environment_filter); - $conf->set('LD_LIBRARY_PATH', $ld_library_path); - $conf->set('MAINTAINER_NAME', $maintainer_name); - $conf->set('UPLOADER_NAME', $uploader_name); - $conf->set('KEY_ID', $key_id); - $conf->set('APT_CLEAN', $apt_clean); - $conf->set('APT_UPDATE', $apt_update); - $conf->set('APT_UPDATE_ARCHIVE_ONLY', $apt_update_archive_only); - $conf->set('APT_UPGRADE', $apt_upgrade); - $conf->set('APT_DISTUPGRADE', $apt_distupgrade); - $conf->set('APT_ALLOW_UNAUTHENTICATED', $apt_allow_unauthenticated); - $conf->set('CHECK_DEPENDS_ALGORITHM', $check_depends_algorithm); - $conf->set('JOB_FILE', $job_file); - - $conf->set('MAILTO', - $conf->get('MAILTO_HASH')->{$conf->get('DISTRIBUTION')}) - if defined($conf->get('DISTRIBUTION')) && - $conf->get('DISTRIBUTION') && - $conf->get('MAILTO_HASH')->{$conf->get('DISTRIBUTION')}; - - $conf->set('SIGNING_OPTIONS', - "-m".$conf->get('MAINTAINER_NAME')."") - if defined $conf->get('MAINTAINER_NAME'); - $conf->set('SIGNING_OPTIONS', - "-e".$conf->get('UPLOADER_NAME')."") - if defined $conf->get('UPLOADER_NAME'); - $conf->set('SIGNING_OPTIONS', - "-k".$conf->get('KEY_ID')."") - if defined $conf->get('KEY_ID'); - $conf->set('MAINTAINER_NAME', $conf->get('UPLOADER_NAME')) if defined $conf->get('UPLOADER_NAME'); - $conf->set('MAINTAINER_NAME', $conf->get('KEY_ID')) if defined $conf->get('KEY_ID'); - $conf->set('BUILD_DIR', $build_dir); - - if (!defined($conf->get('MAINTAINER_NAME')) && - $conf->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"; - } - $conf->set('RUN_LINTIAN', $run_lintian); - $conf->set('LINTIAN', $lintian); - $conf->set('LINTIAN_OPTIONS', $lintian_opts); - $conf->set('RUN_PIUPARTS', $run_piuparts); - $conf->set('PIUPARTS', $piuparts); - $conf->set('PIUPARTS_OPTIONS', $piuparts_opts); - $conf->set('PIUPARTS_ROOT_ARGS', $piuparts_root_args); - $conf->set('EXTERNAL_COMMANDS', $external_commands); - push(@{${$conf->get('EXTERNAL_COMMANDS')}{"chroot-setup-commands"}}, - $chroot_setup_script) if ($chroot_setup_script); - $conf->set('LOG_EXTERNAL_COMMAND_OUTPUT', $log_external_command_output); - $conf->set('LOG_EXTERNAL_COMMAND_ERROR', $log_external_command_error); + # For compatibility only. Non-scalars are deprecated. + my $deprecated_init = <set('MAILTO_HASH', \\\%mailto); +} +if (\@toolchain_regex) { + warn 'W: \@toolchain_regex is deprecated; please use the array reference \$toolchain_regexp[]\n'; + \$conf->set('TOOLCHAIN_REGEX', \\\@toolchain_regex); +} +if (\@ignore_watches_no_build_deps) { + warn 'W: \@ignore_watches_no_build_deps is deprecated; please use the array reference \$ignore_watches_no_build_deps[]\n'; + \$conf->set('IGNORE_WATCHES_NO_BUILD_DEPS', + \\\@ignore_watches_no_build_deps); +} +if (\%watches) { + warn 'W: \%watches is deprecated; please use the hash reference \$watches{}\n'; + \$conf->set('WATCHES', \\\%watches); +} +if (\%individual_stalled_pkg_timeout) { + warn 'W: \%individual_stalled_pkg_timeout is deprecated; please use the hash reference \$individual_stalled_pkg_timeout{}\n'; + \$conf->set('INDIVIDUAL_STALLED_PKG_TIMEOUT', + \\\%individual_stalled_pkg_timeout); +} +END + + my $custom_setup = <get('EXTERNAL_COMMANDS')}{"chroot-setup-commands"}}, +\$chroot_setup_script) if (\$chroot_setup_script); +END + + + $conf->read($files, $deprecated_init, $deprecated_setup, + $custom_setup); } 1; diff -Nru sbuild-0.60.9/lib/Sbuild/DB/Base.pm sbuild-0.62.2/lib/Sbuild/DB/Base.pm --- sbuild-0.60.9/lib/Sbuild/DB/Base.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/DB/Base.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,154 +0,0 @@ -# -# Base.pm: Base class for database abstraction -# Copyright © 1998 Roman Hodek -# Copyright © 2005 Ryan Murray -# Copyright © 2005-2008 Roger Leigh -# -# 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::DB::Base; - -use strict; -use warnings; - -use Sbuild qw(debug isin); -use Sbuild::Base; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter Sbuild::Base); - - @EXPORT = qw(); -} - -sub dump { - my $self = shift; - my $file = shift; - - my $db = $self->get('DB'); - - my($name,$pkg,$key); - - print "Writing ASCII database to $file..." if $self->get_conf('VERBOSE') >= 1; - CORE::open( F, ">$file" ) or - die "Can't open database $file: $!\n"; - - foreach $name ($self->list_packages()) { - my $pkg = $self->get_package($name); - foreach $key (keys %{$pkg}) { - my $val = $pkg->{$key}; - $val =~ s/\n*$//; - $val =~ s/^/ /mg; - $val =~ s/^ $/ ./mg; - print F "$key: $val\n"; - } - print F "\n"; - } - - foreach my $user ($self->list_users()) { - my $ui = $self->get_user($user); - print F "User: $user\n" - if (!defined($ui->{'User'})); - foreach $key (keys %{$ui}) { - my $val = $ui->{$key}; - $val =~ s/\n*$//; - $val =~ s/^/ /mg; - $val =~ s/^ $/ ./mg; - print F "$key: $val\n"; - } - print F "\n"; - } - - CORE::close(F); - print "done\n" if $self->get_conf('VERBOSE') >= 1; -} - -sub restore { - my $self = shift; - my $file = shift; - - my $db = $self->get('DB'); - - print "Reading ASCII database from $file..." if $self->get_conf('VERBOSE') >= 1; - CORE::open( F, "<$file" ) or - die "Can't open database $file: $!\n"; - - local($/) = ""; # read in paragraph mode - while( ) { - my( %thispkg, $name ); - s/[\s\n]+$//; - s/\n[ \t]+/\376\377/g; # fix continuation lines - s/\376\377\s*\376\377/\376\377/og; - - while( /^(\S+):[ \t]*(.*)[ \t]*$/mg ) { - my ($key, $val) = ($1, $2); - $val =~ s/\376\377/\n/g; - $thispkg{$key} = $val; - } - $self->check_entry( \%thispkg ); - # add to db - if (exists($thispkg{'Package'})) { - $self->set_package(\%thispkg); - } elsif(exists($thispkg{'User'})) { - $self->set_user(\%thispkg); - } - } - CORE::close( F ); - print "done\n" if $self->get_conf('VERBOSE') >= 1; -} - -sub check_entry { - my $self = shift; - my $pkg = shift; - my $field; - - # TODO: Why should manual editing disable sanity checking? - return if $self->get_conf('DB_OPERATION') eq "manual-edit"; # no checks then - - # check for required fields - if (!exists $pkg->{'Package'} && !exists $pkg->{'User'}) { - print STDERR "Bad entry: ", - join( "\n", map { "$_: $pkg->{$_}" } keys %$pkg ), "\n"; - die "Database entry lacks Package or User: field\n"; - } - - if (exists $pkg->{'Package'}) { - if (!exists $pkg->{'Version'}) { - die "Database entry for package $pkg->{'Package'} lacks Version: field\n"; - } - # if no State: field, generate one (for old db compat) - if (!exists($pkg->{'State'})) { - $pkg->{'State'} = - exists $pkg->{'Failed'} ? 'Failed' : 'Building'; - } - # check state field - die "Bad state $pkg->{'State'} of package $pkg->{Package}\n" - if !isin($pkg->{'State'}, - qw(Needs-Build Building Built Build-Attempted - Uploaded Installed Dep-Wait Failed - Failed-Removed Not-For-Us) ); - } - if (exists $pkg->{'User'}) { - if (!exists $pkg->{'Last-Seen'}) { - die "Database entry for user $pkg->{'User'} lacks Last-Seen: field\n"; - } - } -} - -1; diff -Nru sbuild-0.60.9/lib/Sbuild/DB/ClientConf.pm sbuild-0.62.2/lib/Sbuild/DB/ClientConf.pm --- sbuild-0.60.9/lib/Sbuild/DB/ClientConf.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/DB/ClientConf.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -# -# ClientConf.pm: configuration library for wanna-build clients -# Copyright © 1998 Roman Hodek -# Copyright © 2005 Ryan Murray -# Copyright © 2006-2009 Roger Leigh -# -# 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::DB::ClientConf; - -use strict; -use warnings; - -use Sbuild::Sysconfig; -use File::Spec; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter); - - @EXPORT = qw(setup); -} - -sub setup ($) { - my $conf = shift; - - my $validate_program = sub { - my $conf = shift; - my $entry = shift; - my $key = $entry->{'NAME'}; - my $program = $conf->get($key); - - die "$key binary is not defined" - if !defined($program) || !$program; - - # Emulate execvp behaviour by searching the binary in the PATH. - my @paths = split(/:/, $ENV{'PATH'}); - # Also consider the empty path for absolute locations. - push (@paths, ''); - my $found = 0; - foreach my $path (@paths) { - $found = 1 if (-x File::Spec->catfile($path, $program)); - } - - die "$key binary '$program' does not exist or is not executable" - if !$found; - }; - - my $validate_ssh = sub { - my $conf = shift; - my $entry = shift; - -# TODO: Provide self, config and entry contexts, which functions to -# get at needed data. Provide generic configuration functions. -# - $validate_program->($conf, $conf->{'KEYS'}->{'SSH'}); - - my $ssh = $conf->get('SSH'); - my $sshuser = $conf->get('WANNA_BUILD_SSH_USER'); - my $sshhost = $conf->get('WANNA_BUILD_SSH_HOST'); - my @sshoptions = @{$conf->get('WANNA_BUILD_SSH_OPTIONS')}; - my $sshsocket = $conf->get('WANNA_BUILD_SSH_SOCKET'); - - my @command = (); - - if ($sshhost) { - push (@command, $ssh); - push (@command, '-l', $sshuser) if $sshuser; - push (@command, '-S', $sshsocket) if $sshsocket; - push (@command, @sshoptions) if @sshoptions; - push (@command, $sshhost); - } - - $conf->set('WANNA_BUILD_SSH_CMD', \@command); - }; - - our $HOME = $conf->get('HOME'); - my $arch = $conf->get('ARCH'); - - my %db_keys = ( - 'SSH' => { - DEFAULT => 'ssh', - CHECK => $validate_ssh, - }, - 'WANNA_BUILD_SSH_CMD' => { - DEFAULT => '' - }, - 'WANNA_BUILD_SSH_USER' => { - DEFAULT => '', - CHECK => $validate_ssh, - }, - 'WANNA_BUILD_SSH_HOST' => { - DEFAULT => '', - CHECK => $validate_ssh, - }, - 'WANNA_BUILD_SSH_SOCKET' => { - DEFAULT => '', - CHECK => $validate_ssh, - }, - 'WANNA_BUILD_SSH_OPTIONS' => { - DEFAULT => [], - CHECK => $validate_ssh, - }, - 'WANNA_BUILD_DB_NAME' => { - DEFAULT => undef, - }, - 'WANNA_BUILD_DB_USER' => { - DEFAULT => $conf->get('USERNAME') - }, - 'BUILT_ARCHITECTURE' => { - DEFAULT => $arch, - },); - - $conf->set_allowed_keys(\%db_keys); -} - -1; diff -Nru sbuild-0.60.9/lib/Sbuild/DB/Client.pm sbuild-0.62.2/lib/Sbuild/DB/Client.pm --- sbuild-0.60.9/lib/Sbuild/DB/Client.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/DB/Client.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -# -# Client.pm: client library for wanna-build -# Copyright © 2005 Ryan Murray -# Copyright © 2005-2009 Roger Leigh -# -# 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::DB::Client; - -use strict; -use warnings; - -use Sbuild qw($devnull); -use Sbuild::ChrootRoot; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter Sbuild::Base); - - @EXPORT = qw(); -} - -sub new { - my $class = shift; - my $conf = shift; - - my $self = $class->SUPER::new($conf); - bless($self, $class); - - $self->set('SETUP', 0); - - return $self; -} - -sub setup { - my $self = shift; - - if (!$self->get('SETUP')) { - my $host = Sbuild::ChrootRoot->new($self->get('Config')); - $host->begin_session(); - $host->set('Log Stream', $self->get('Log Stream')); - $self->set('Host', $host); - $self->set('SETUP', 1); - } -} - -sub get_query { - my $self = shift; - - my @command = (@{$self->get_conf('WANNA_BUILD_SSH_CMD')}, 'wanna-build'); - if ($self->get_conf('WANNA_BUILD_DB_NAME')) { - push(@command, "--database=" . $self->get_conf('WANNA_BUILD_DB_NAME')); - } elsif ($self->get_conf('BUILT_ARCHITECTURE')) { - push(@command, "--arch=" . $self->get_conf('BUILT_ARCHITECTURE')); - } - push(@command, "--user=" . $self->get_conf('WANNA_BUILD_DB_USER')) - if $self->get_conf('WANNA_BUILD_DB_USER'); - push(@command, @_); - - return @command; -} - -sub run_query { - my $self = shift; - - my @command = $self->get_query(@_); - - $self->setup(); - - my $pipe = $self->get('Host')->run_command( - { COMMAND => [@command], - USER => $self->get_conf('USERNAME'), - PRIORITY => 0, - }); -} - -sub pipe_query { - my $self = shift; - - my @command = $self->get_query(@_); - - $self->setup(); - - my $pipe = $self->get('Host')->pipe_command( - { COMMAND => [@command], - USER => $self->get_conf('USERNAME'), - PRIORITY => 0, - }); - - return $pipe; -} - -sub pipe_query_out { - my $self = shift; - - my @command = $self->get_query(@_); - - $self->setup(); - - my $pipe = $self->get('Host')->pipe_command( - { COMMAND => [@command], - USER => $self->get_conf('USERNAME'), - PIPE => 'out', - STREAMOUT => $devnull, - PRIORITY => 0, - }); - - return $pipe; -} - -1; diff -Nru sbuild-0.60.9/lib/Sbuild/DB/Info.pm sbuild-0.62.2/lib/Sbuild/DB/Info.pm --- sbuild-0.60.9/lib/Sbuild/DB/Info.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/DB/Info.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -# -# DBInfo.pm: Database abstraction -# Copyright © 1998 Roman Hodek -# Copyright © 2005 Ryan Murray -# Copyright © 2005-2008 Roger Leigh -# -# 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::DB::Info; - -use Sbuild qw(debug isin); - -use strict; -use warnings; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter); - - @EXPORT = qw(category); -} - -sub category ($); - -my %short_category = ( - 'u' => 'uploaded-fixed-pkg', - 'f' => 'fix-expected', - 'r' => 'reminder-sent', - 'n' => 'nmu-offered', - 'e' => 'easy', - 'm' => 'medium', - 'h' => 'hard', - 'c' => 'compiler-error', - '' => 'none' -); - -sub category ($) { - my $category = shift; - - if (!isin($category, values %short_category)) { - $category = $short_category{$category} - } - - return $category; -} diff -Nru sbuild-0.60.9/lib/Sbuild/DB/Makefile.am sbuild-0.62.2/lib/Sbuild/DB/Makefile.am --- sbuild-0.60.9/lib/Sbuild/DB/Makefile.am 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/DB/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -# sbuild Makefile template -# -# -# Copyright © 2004-2007 Roger Leigh -# -# sbuild 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 3 of the License, or -# (at your option) any later version. -# -# sbuild 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 -# . -# -##################################################################### - -include $(top_srcdir)/scripts/global.mk - -perlmodsbuilddbdir = $(perlmoddir)/Sbuild/DB - -MODULES = \ - Client.pm \ - ClientConf.pm \ - Base.pm \ - Info.pm \ - MLDBM.pm \ - Postgres.pm - -perlmodsbuilddb_DATA = \ - $(MODULES) - -EXTRA_DIST = \ - $(MODULES) diff -Nru sbuild-0.60.9/lib/Sbuild/DB/Makefile.in sbuild-0.62.2/lib/Sbuild/DB/Makefile.in --- sbuild-0.60.9/lib/Sbuild/DB/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/DB/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,441 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# sbuild Makefile template -# -# -# Copyright © 2004-2007 Roger Leigh -# -# sbuild 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 3 of the License, or -# (at your option) any later version. -# -# sbuild 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 -# . -# -##################################################################### - -# sbuild Makefile template -# -# -# Copyright © 2004-2007 Roger Leigh -# -# sbuild 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 3 of the License, or -# (at your option) any later version. -# -# sbuild 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 -# . -# -##################################################################### - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/scripts/global.mk -subdir = lib/Sbuild/DB -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(perlmodsbuilddbdir)" -DATA = $(perlmodsbuilddb_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BUILDD_CONF = @BUILDD_CONF@ -BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL_MODULE_DIR = @PERL_MODULE_DIR@ -PLATFORM = @PLATFORM@ -RELEASE_DATE = @RELEASE_DATE@ -SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ -SBUILD_COMPAT = @SBUILD_COMPAT@ -SBUILD_CONF = @SBUILD_CONF@ -SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ -SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ -SCHROOT_CONF = @SCHROOT_CONF@ -SCHROOT_SYSCONF_DIR = @SCHROOT_SYSCONF_DIR@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -am__leading_dot = @am__leading_dot@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# Global options for use in all Makefiles. -perlmoddir = $(PERL_MODULE_DIR) -perlmodsbuilddbdir = $(perlmoddir)/Sbuild/DB -MODULES = \ - Client.pm \ - ClientConf.pm \ - Base.pm \ - Info.pm \ - MLDBM.pm \ - Postgres.pm - -perlmodsbuilddb_DATA = \ - $(MODULES) - -EXTRA_DIST = \ - $(MODULES) - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Sbuild/DB/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu lib/Sbuild/DB/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-perlmodsbuilddbDATA: $(perlmodsbuilddb_DATA) - @$(NORMAL_INSTALL) - test -z "$(perlmodsbuilddbdir)" || $(MKDIR_P) "$(DESTDIR)$(perlmodsbuilddbdir)" - @list='$(perlmodsbuilddb_DATA)'; test -n "$(perlmodsbuilddbdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(perlmodsbuilddbdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(perlmodsbuilddbdir)" || exit $$?; \ - done - -uninstall-perlmodsbuilddbDATA: - @$(NORMAL_UNINSTALL) - @list='$(perlmodsbuilddb_DATA)'; test -n "$(perlmodsbuilddbdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(perlmodsbuilddbdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(perlmodsbuilddbdir)" && rm -f $$files -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(perlmodsbuilddbdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-perlmodsbuilddbDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-perlmodsbuilddbDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-perlmodsbuilddbDATA \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am uninstall uninstall-am \ - uninstall-perlmodsbuilddbDATA - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru sbuild-0.60.9/lib/Sbuild/DB/MLDBM.pm sbuild-0.62.2/lib/Sbuild/DB/MLDBM.pm --- sbuild-0.60.9/lib/Sbuild/DB/MLDBM.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/DB/MLDBM.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,307 +0,0 @@ -# -# MLDBM.pm: MLDBM Database abstraction -# Copyright © 1998 Roman Hodek -# Copyright © 2005 Ryan Murray -# Copyright © 2005-2008 Roger Leigh -# -# 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::DB::MLDBM; - -use strict; -use warnings; - -use POSIX; -use GDBM_File; -use MLDBM qw(GDBM_File Storable); - -use Sbuild qw(debug isin); -use Sbuild::DB::Base; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter Sbuild::DB::Base); - - @EXPORT = qw(); -} - -sub new { - my $class = shift; - my $conf = shift; - - my $self = $class->SUPER::new($conf); - bless($self, $class); - - - return $self; -} - -sub open { - my $self = shift; - my $file = shift; - - my %db; - - tie %db, 'MLDBM', $file, GDBM_WRCREAT, 0664 - or die "FATAL: Cannot open database\n"; - - $self->set('FILE', $file); - $self->set('DB', \%db); - $self->set('KEEP_LOCK', 0); -} - -sub close { - my $self = shift; - - my $db = $self->get('DB'); - untie %{$db} or die "FATAL: Cannot untie old database\n"; - $db = undef; - - $self->set('KEEP_LOCK', 0); - $self->set('DB', undef); - - $self->unlock(); # After db is undefined - $self->set('FILE', undef); -} - -# TODO: Use fcntl locks? -sub lock { - my $self = shift; - - my $file = $self->get('FILE'); - - my $try = 0; - my $lockfile = "${file}.lock"; - local( *F ); - - print "Locking $file database\n" if $self->get_conf('VERBOSE') >= 2; - repeat: - if (!sysopen( F, $lockfile, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644 )){ - if ($! == EEXIST) { - # lock file exists, wait - goto repeat if !CORE::open( F, "<$lockfile" ); - my $line = ; - CORE::close(F); - if ($line !~ /^(\d+)\s+([\w\d.-]+)$/) { - warn "Bad lock file contents -- still trying\n"; - } - else { - my($pid, $usr) = ($1, $2); - if (kill( 0, $pid ) == 0 && $! == ESRCH) { - # process doesn't exist anymore, remove stale lock - print "Removing stale lock file (pid $pid, user $usr)\n"; - unlink( $lockfile ); - goto repeat; - } - warn "Database locked by $usr -- please wait\n" if $try == 0; - } - if (++$try > 200) { - # avoid the END routine removes the lock - $self->set('KEEP_LOCK', 1); - die "Lock still present after 200 * 5 seconds.\n"; - } - sleep 5; - goto repeat; - } - die "Can't create lock file $lockfile: $!\n"; - } - F->print("$$ " . $self->get_conf('USERNAME') . "\n"); - F->close(); -} - -sub unlock ($) { - my $self = shift; - - my $file = $self->get('FILE'); - my $lockfile = "${file}.lock"; - - if (!$self->get('KEEP_LOCK')) { - print "Unlocking $file database\n" if $self->get_conf('VERBOSE') >= 2; - unlink $lockfile; - } -} - -sub clear { - my $self = shift; - - my $db = $self->get('DB'); - - %{$db} = (); -} - -sub list_packages { - my $self = shift; - - my $db = $self->get('DB'); - - my @packages; - - foreach my $name (sort keys %{$db}) { - next if $name =~ /^_/; - push(@packages, $name); - } - - return @packages; -} - -sub get_package { - my $self = shift; - my $pkg = shift; - - my $pkgobj = undef; - - if ($pkg !~ /^_/) { - my $db = $self->get('DB'); - $pkgobj = $db->{$pkg}; - } - - return $pkgobj; -} - -sub set_package { - my $self = shift; - my $pkg = shift; - - if ($pkg !~ /^_/) { - my $db = $self->get('DB'); - - my $name = $pkg->{'Package'}; - $db->{$name} = $pkg; - } else { - $pkg = undef; - } - - return $pkg; -} - -sub del_package { - my $self = shift; - my $pkg = shift; - - my $name = $pkg; - $name = $pkg->{'Package'} if (ref($pkg) eq 'HASH'); - - my $success = 0; - - if ($pkg !~ /^_/) { - my $db = $self->get('DB'); - - delete $db->{$name}; - - $success = 1; - } - - return $success; -} - -sub list_users { - my $self = shift; - - my $db = $self->get('DB'); - my $usertable = $db->{'_userinfo'}; - - my @users = (); - - if (defined($usertable)) { - foreach my $name (sort keys %{$usertable}) { - push(@users, $name); - } - } - - return @users; -} - -sub get_user { - my $self = shift; - my $user = shift; - - my $db = $self->get('DB'); - my $usertable = $db->{'_userinfo'}; - - my $userobj = undef; - - if (defined($usertable)) { - $userobj = $usertable->{$user}; - $userobj->{'User'} = $user if !defined($userobj->{'User'}); - } - - return $userobj; -} - -sub set_user { - my $self = shift; - my $user = shift; - - my $db = $self->get('DB'); - my $usertable = $db->{'_userinfo'}; - $usertable = {} if !defined($usertable); - - my $name = $user->{'User'}; - $usertable->{$name} = $user; - - $db->{'_userinfo'} = $usertable; - - return $user; -} - -sub del_user { - my $self = shift; - my $user = shift; - - my $name = $user; - $name = $user->{'User'} if (ref($user) eq 'HASH'); - - my $db = $self->get('DB'); - my $usertable = $db->{'_userinfo'}; - $usertable = {} if !defined($usertable); - - my $success = 0; - - if (exists($usertable->{$name})) { - delete $usertable->{$name}; - $db->{'_userinfo'} = $usertable; - $success = 1; - } - - return $success -} - -sub clean { - my $self = shift; - - my $db = $self->get('DB'); - my $file = $self->get('FILE'); - - my %new_db; - tie %new_db, 'MLDBM', "$file.new", GDBM_WRCREAT, 0664 - or die "FATAL: Cannot create new database\n"; - %new_db = %{$db}; - - $self->close(); - $db = undef; - - system ("cp ${file}.new ${file}") == 0 - or die "FATAL: Cannot overwrite old database"; - unlink "${file}.new"; - - $self->set('FILE', $file); - $self->set('DB', \%new_db); -} - -1; diff -Nru sbuild-0.60.9/lib/Sbuild/DB/Postgres.pm sbuild-0.62.2/lib/Sbuild/DB/Postgres.pm --- sbuild-0.60.9/lib/Sbuild/DB/Postgres.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/DB/Postgres.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,215 +0,0 @@ -# -# Postgres.pm: PostgreSQL database abstraction -# Copyright © 1998 Roman Hodek -# Copyright © 2005 Ryan Murray -# Copyright © 2005-2008 Roger Leigh -# -# 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::DB::Postgres; - -use strict; -use warnings; - -use Sbuild qw(debug isin); -use Sbuild::DB::Base; -use DBI; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter Sbuild::DB::Base); - - @EXPORT = qw(); -} - -sub new { - my $class = shift; - my $conf = shift; - - my $self = $class->SUPER::new($conf); - bless($self, $class); - - return $self; -} - -sub open { - my $self = shift; - my $dist = shift; - - my $dbname = $self->get_conf('DB_BASE_NAME'); - my $db = DBI->connect('DBI:Pg:$dbname=') - or die "Couldn't connect to database '$dbname': " . DBI->errstr; - - $self->set('DIST', $dist); - $self->set('DB', $db); -} - -sub close { - my $self = shift; - - my $db = $self->get('DB'); - $db->disconnect(); - - $self->set('DB', undef); - - $self->set('FILE', undef); -} - -sub lock { -# No-op for Postgres -} - -sub unlock ($) { -# No-op for Postgres -} - -sub clear { - my $self = shift; - - my $db = $self->get('DB'); - - # DELETE * FROM... -} - -sub list_packages { - my $self = shift; - - my $db = $self->get('DB'); - - my @packages; - - # SELECT * FROM ... WHERE arch= and dist= - - return @packages; -} - -sub get_package { - my $self = shift; - my $pkg = shift; - - my $pkgobj = undef; - - if ($pkg !~ /^_/) { - # SELECT * FROM ... WHERE arch= and dist= - } - - return $pkgobj; -} - -sub set_package { - my $self = shift; - my $pkg = shift; - - if ($pkg !~ /^_/) { - my $db = $self->get('DB'); - - my $name = $pkg->{'Package'}; - - - # INSERT INTO or UPDATE ... - } else { - $pkg = undef; - } - - return $pkg; -} - -sub del_package { - my $self = shift; - my $pkg = shift; - - my $name = $pkg; - $name = $pkg->{'Package'} if (ref($pkg) eq 'HASH'); - - my $success = 0; - - if ($pkg !~ /^_/) { - my $db = $self->get('DB'); - - # DELETE FROM ... - - $success = 1; - } - - return $success; -} - -sub list_users { - my $self = shift; - - my $db = $self->get('DB'); - - my @users = (); - - # SELECT * FROM builders - - return @users; -} - -sub get_user { - my $self = shift; - my $user = shift; - - my $db = $self->get('DB'); - - my $userobj = undef; - - # SELECT * FROM builders - - return $userobj; -} - -sub set_user { - my $self = shift; - my $user = shift; - - my $db = $self->get('DB'); - - my $name = $user->{'User'}; - # INSERT INTO builders... - - return $user; -} - -sub del_user { - my $self = shift; - my $user = shift; - - my $name = $user; - $name = $user->{'User'} if (ref($user) eq 'HASH'); - - my $db = $self->get('DB'); - - my $success = 0; - - # DELETE FROM builders... - - return $success -} - -sub clean { - my $self = shift; - - my $db = $self->get('DB'); - - # VACUUM - -} - -1; diff -Nru sbuild-0.60.9/lib/Sbuild/Exception.pm sbuild-0.62.2/lib/Sbuild/Exception.pm --- sbuild-0.60.9/lib/Sbuild/Exception.pm 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/Exception.pm 2011-04-04 23:03:13.000000000 +0000 @@ -0,0 +1,34 @@ +# +# Exception.pm: exceptions for sbuild +# Copyright © 2011 Roger Leigh +# +# 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::Exception; + +use strict; +use warnings; + +use Exception::Class ( + 'Sbuild::Exception::Base', + + 'Sbuild::Exception::Build' => { isa => 'Sbuild::Exception::Base', + fields => [ 'info', 'status', 'failstage' ] } + + ); + +1; diff -Nru sbuild-0.60.9/lib/Sbuild/InternalResolver.pm sbuild-0.62.2/lib/Sbuild/InternalResolver.pm --- sbuild-0.60.9/lib/Sbuild/InternalResolver.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/InternalResolver.pm 2011-04-04 17:43:53.000000000 +0000 @@ -505,7 +505,7 @@ my $pipe = $self->pipe_apt_command( { COMMAND => [$self->get_conf('APT_CACHE'), '-q', '--names-only', 'search', "^$pkg\$"], - USER => $self->get_conf('USERNAME'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0, DIR => '/'}); if (!$pipe) { @@ -541,7 +541,7 @@ $self->pipe_apt_command( { COMMAND => [$self->get_conf('APT_CACHE'), 'policy', @interest], ENV => {'LC_ALL' => 'C'}, - USER => $self->get_conf('USERNAME'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0, DIR => '/' }) || die 'Can\'t start ' . $self->get_conf('APT_CACHE') . ": $!\n"; diff -Nru sbuild-0.60.9/lib/Sbuild/LogBase.pm sbuild-0.62.2/lib/Sbuild/LogBase.pm --- sbuild-0.60.9/lib/Sbuild/LogBase.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/LogBase.pm 2011-04-04 17:43:53.000000000 +0000 @@ -71,7 +71,7 @@ $SIG{'INT'} = 'IGNORE'; $SIG{'QUIT'} = 'IGNORE'; $SIG{'TERM'} = 'IGNORE'; - $PROGRAM_NAME = 'Sbuild::LogBase for ' . $PROGRAM_NAME; + $PROGRAM_NAME = 'main log for ' . $PROGRAM_NAME; while () { $logfunc->($log_file, $_) if (!$conf->get('NOLOG') && defined($log_file)); diff -Nru sbuild-0.60.9/lib/Sbuild/Makefile.am sbuild-0.62.2/lib/Sbuild/Makefile.am --- sbuild-0.60.9/lib/Sbuild/Makefile.am 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/Makefile.am 2011-04-04 17:43:53.000000000 +0000 @@ -21,8 +21,6 @@ include $(top_srcdir)/scripts/global.mk -SUBDIRS = DB - perlmodsbuilddir = $(perlmoddir)/Sbuild MODULES = \ @@ -37,6 +35,7 @@ ChrootInfo.pm \ ChrootInfoSchroot.pm \ ChrootInfoSudo.pm \ + Exception.pm \ ResolverBase.pm \ AptitudeResolver.pm \ AptResolver.pm \ diff -Nru sbuild-0.60.9/lib/Sbuild/Makefile.in sbuild-0.62.2/lib/Sbuild/Makefile.in --- sbuild-0.60.9/lib/Sbuild/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -95,13 +95,6 @@ am__v_at_0 = @ SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -125,40 +118,7 @@ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(perlmodsbuilddir)" DATA = $(perlmodsbuild_DATA) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -168,21 +128,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -197,6 +165,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -205,14 +174,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -258,7 +227,6 @@ # Global options for use in all Makefiles. perlmoddir = $(PERL_MODULE_DIR) -SUBDIRS = DB perlmodsbuilddir = $(perlmoddir)/Sbuild MODULES = \ Base.pm \ @@ -272,6 +240,7 @@ ChrootInfo.pm \ ChrootInfoSchroot.pm \ ChrootInfoSudo.pm \ + Exception.pm \ ResolverBase.pm \ AptitudeResolver.pm \ AptResolver.pm \ @@ -292,7 +261,7 @@ EXTRA_DIST = \ $(MODULES) -all: all-recursive +all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $(am__configure_deps) @@ -347,141 +316,12 @@ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(perlmodsbuilddir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(perlmodsbuilddir)" && rm -f $$files - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique tags: TAGS +TAGS: -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" +CTAGS: -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -513,51 +353,22 @@ || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done check-am: all-am -check: check-recursive +check: check-am all-am: Makefile $(DATA) -installdirs: installdirs-recursive -installdirs-am: +installdirs: for dir in "$(DESTDIR)$(perlmodsbuilddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ @@ -574,87 +385,84 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive +clean: clean-am clean-am: clean-generic mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags +distclean-am: clean-am distclean-generic -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am html-am: -info: info-recursive +info: info-am info-am: install-data-am: install-perlmodsbuildDATA -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am install-dvi-am: install-exec-am: -install-html: install-html-recursive +install-html: install-html-am install-html-am: -install-info: install-info-recursive +install-info: install-info-am install-info-am: install-man: -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am install-pdf-am: -install-ps: install-ps-recursive +install-ps: install-ps-am install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: uninstall-am: uninstall-perlmodsbuildDATA -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic ctags \ - ctags-recursive distclean distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-perlmodsbuildDATA \ install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ + installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + pdf-am ps ps-am uninstall uninstall-am \ uninstall-perlmodsbuildDATA diff -Nru sbuild-0.60.9/lib/Sbuild/Options.pm sbuild-0.62.2/lib/Sbuild/Options.pm --- sbuild-0.60.9/lib/Sbuild/Options.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/Options.pm 2011-04-04 23:02:12.000000000 +0000 @@ -81,16 +81,28 @@ $self->set_conf('CHROOT', $_[1]); }, "apt-clean" => sub { - $self->set_conf('APT_CLEAN', $_[1]); + $self->set_conf('APT_CLEAN', 1); }, "apt-update" => sub { - $self->set_conf('APT_UPDATE', $_[1]); + $self->set_conf('APT_UPDATE', 1); }, "apt-upgrade" => sub { - $self->set_conf('APT_UPGRADE', $_[1]); + $self->set_conf('APT_UPGRADE', 1); }, "apt-distupgrade" => sub { - $self->set_conf('APT_DISTUPGRADE', $_[1]); + $self->set_conf('APT_DISTUPGRADE', 1); + }, + "no-apt-clean" => sub { + $self->set_conf('APT_CLEAN', 0); + }, + "no-apt-update" => sub { + $self->set_conf('APT_UPDATE', 0); + }, + "no-apt-upgrade" => sub { + $self->set_conf('APT_UPGRADE', 0); + }, + "no-apt-distupgrade" => sub { + $self->set_conf('APT_DISTUPGRADE', 0); }, "d|dist=s" => sub { $self->set_conf('DISTRIBUTION', $_[1]); @@ -147,6 +159,9 @@ "purge-deps=s" => sub { $self->set_conf('PURGE_BUILD_DEPS', $_[1]); }, + "purge-session=s" => sub { + $self->set_conf('PURGE_SESSION', $_[1]); + }, "s|source" => sub { $self->set_conf('BUILD_SOURCE', 1); }, diff -Nru sbuild-0.60.9/lib/Sbuild/ResolverBase.pm sbuild-0.62.2/lib/Sbuild/ResolverBase.pm --- sbuild-0.60.9/lib/Sbuild/ResolverBase.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/ResolverBase.pm 2011-04-04 17:43:53.000000000 +0000 @@ -26,7 +26,6 @@ use POSIX; use Fcntl; use File::Temp qw(tempdir tempfile); -use File::Path qw(remove_tree); use File::Copy; use Dpkg::Deps; @@ -353,6 +352,7 @@ my $arch = $self->get('Arch'); my ($sysname, $nodename, $release, $version, $machine) = POSIX::uname(); + $self->log_subsection("Build environment"); $self->log("Kernel: $sysname $release $arch ($machine)\n"); $self->log("Toolchain package versions:"); @@ -514,6 +514,22 @@ tempdir('resolver' . '-XXXXXX', DIR => $self->get('Chroot Build Dir'))); } + $session->run_command( + { COMMAND => ['chown', 'sbuild:sbuild', $session->strip_chroot_path($self->get('Dummy package path'))], + USER => 'root', + DIR => '/' }); + if ($?) { + $self->log_error("E: Failed to set sbuild:sbuild ownership on dummy package dir\n"); + return 0; + } + $session->run_command( + { COMMAND => ['chmod', '0770', $session->strip_chroot_path($self->get('Dummy package path'))], + USER => 'root', + DIR => '/' }); + if ($?) { + $self->log_error("E: Failed to set 0770 permissions on dummy package dir\n"); + return 0; + } my $dummy_dir = $self->get('Dummy package path'); my $dummy_gpghome = $dummy_dir . '/gpg'; my $dummy_archive_dir = $dummy_dir . '/apt_archive'; @@ -535,7 +551,16 @@ $self->cleanup_apt_archive(); return 0; } - if (!(-d $dummy_archive_dir || mkdir $dummy_archive_dir, 0755)) { + $session->run_command( + { COMMAND => ['chown', 'sbuild:sbuild', + $session->strip_chroot_path($dummy_gpghome)], + USER => 'root', + DIR => '/' }); + if ($?) { + $self->log_error("E: Failed to set sbuild:sbuild ownership on $dummy_gpghome\n"); + return 0; + } + if (!(-d $dummy_archive_dir || mkdir $dummy_archive_dir, 0775)) { $self->log_warning('Could not create build-depends dummy archive dir ' . $dummy_archive_dir . ': ' . $!); $self->cleanup_apt_archive(); return 0; @@ -603,6 +628,19 @@ host_arch => $self->get('Arch')); } + $self->log("Merged Build-Depends: $positive\n") if $positive; + $self->log("Merged Build-Conflicts: $negative\n") if $negative; + + # Filter out all but the first alternative. + if (!$self->get_conf('RESOLVE_ALTERNATIVES')) { + my $positive_filtered = Dpkg::Deps::AND->new(); + foreach my $item ($positive->get_deps()) { + my ($first) = $item->get_deps(); + $positive_filtered->add($first) if defined $first; + } + $positive = $positive_filtered; + } + if ($positive ne "") { print DUMMY_CONTROL 'Depends: ' . $positive . "\n"; } @@ -610,8 +648,8 @@ print DUMMY_CONTROL 'Conflicts: ' . $negative . "\n"; } - debug("DUMMY Depends: $positive \n"); - debug("DUMMY Conflicts: $negative \n"); + $self->log("Filtered Build-Depends: $positive\n") if $positive; + $self->log("Filtered Build-Conflicts: $negative\n") if $negative; print DUMMY_CONTROL <<"EOF"; Maintainer: Debian buildd-tools Developers @@ -621,10 +659,25 @@ EOF close (DUMMY_CONTROL); + foreach my $path ($dummy_pkg_dir . '/DEBIAN/control', + $dummy_pkg_dir . '/DEBIAN', + $dummy_pkg_dir, + $dummy_archive_dir) { + $session->run_command( + { COMMAND => ['chown', 'sbuild:sbuild', + $session->strip_chroot_path($path)], + USER => 'root', + DIR => '/' }); + if ($?) { + $self->log_error("E: Failed to set sbuild:sbuild ownership on $path\n"); + return 0; + } + } + #Now build the package: $session->run_command( { COMMAND => ['dpkg-deb', '--build', $session->strip_chroot_path($dummy_pkg_dir), $session->strip_chroot_path($dummy_deb)], - USER => $self->get_conf('USER'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0}); if ($?) { $self->log("Dummy package creation failed\n"); @@ -692,7 +745,7 @@ $session->strip_chroot_path($dummy_release_file)); $session->run_command( { COMMAND => \@gpg_command, - USER => $self->get_conf('USER'), + USER => $self->get_conf('BUILD_USER'), PRIORITY => 0}); if ($?) { $self->log("Failed to sign dummy archive Release file.\n"); @@ -708,6 +761,15 @@ close($tmpfh); # List file needs to be moved with root. $session->run_command( + { COMMAND => ['chmod', '0644', $session->strip_chroot_path($tmpfilename)], + USER => 'root', + PRIORITY => 0}); + if ($?) { + $self->log("Failed to create apt list file for dummy archive.\n"); + $self->cleanup_apt_archive(); + return 0; + } + $session->run_command( { COMMAND => ['mv', $session->strip_chroot_path($tmpfilename), $session->strip_chroot_path($dummy_archive_list_file)], USER => 'root', @@ -736,10 +798,16 @@ # Remove the apt archive. sub cleanup_apt_archive { my $self = shift; + my $session = $self->get('Session'); + if (defined $self->get('Dummy package path')) { - remove_tree($self->get('Dummy package path')); + $session->run_command( + { COMMAND => ['rm', '-fr', $session->strip_chroot_path($self->get('Dummy package path'))], + USER => $self->get_conf('BUILD_USER'), + DIR => '/' }); } + $session->run_command( { COMMAND => ['rm', '-f', $session->strip_chroot_path($self->get('Dummy archive list file'))], USER => 'root', @@ -812,7 +880,7 @@ # Run apt-ftparchive to generate Packages and Sources files. $host->run_command( { COMMAND => ['apt-ftparchive', '-q=2', 'generate', $tmpfilename], - USER => $self->get_conf('USER'), + USER => $self->get_conf('USERNAME'), PRIORITY => 0, DIR => '/'}); if ($?) { @@ -824,7 +892,7 @@ # Get output for Release file my $pipe = $host->pipe_command( { COMMAND => ['apt-ftparchive', '-q=2', '-c', $tmpfilename, 'release', $dummy_archive_dir], - USER => $self->get_conf('USER'), + USER => $self->get_conf('USERNAME'), PRIORITY => 0, DIR => '/'}); if (!defined($pipe)) { diff -Nru sbuild-0.60.9/lib/Sbuild/Sysconfig.pm.in sbuild-0.62.2/lib/Sbuild/Sysconfig.pm.in --- sbuild-0.60.9/lib/Sbuild/Sysconfig.pm.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild/Sysconfig.pm.in 2011-04-04 17:43:53.000000000 +0000 @@ -73,14 +73,12 @@ 'BUILDD_CONF' => "@BUILDD_CONF@", 'BUILDD_SYSCONF_DIR' => "@BUILDD_SYSCONF_DIR@", 'SBUILD_CONF' => "@SBUILD_CONF@", + 'SBUILD_DATA_DIR' => "@SBUILD_DATA_DIR@", 'SBUILD_LIBEXEC_DIR' => "@SBUILD_LIBEXEC_DIR@", 'SBUILD_LOCALSTATE_DIR' => "$localstatedir/lib/sbuild", 'SBUILD_SYSCONF_DIR' => "@SBUILD_SYSCONF_DIR@", 'SCHROOT_CONF' => "@SCHROOT_CONF@", - 'SCHROOT_SYSCONF_DIR' => "@SCHROOT_SYSCONF_DIR@", - 'WANNA_BUILD_CONF' => "@WANNA_BUILD_CONF@", - 'WANNA_BUILD_LOCALSTATE_DIR' => "$localstatedir/lib/wanna-build", - 'WANNA_BUILD_LIBEXEC_DIR' => "@WANNA_BUILD_LIBEXEC_DIR@" + 'SCHROOT_SYSCONF_DIR' => "@SCHROOT_SYSCONF_DIR@" ); 1; diff -Nru sbuild-0.60.9/lib/Sbuild.pm sbuild-0.62.2/lib/Sbuild.pm --- sbuild-0.60.9/lib/Sbuild.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/Sbuild.pm 2011-04-04 17:43:53.000000000 +0000 @@ -42,8 +42,7 @@ version_eq version_compare split_version binNMU_version parse_date isin copy dump_file check_packages help_text version_text usage_error - send_mail send_build_log debug debug2 df - check_group_membership); + send_mail debug debug2 df check_group_membership); } @@ -436,72 +435,6 @@ exit 1; } -sub send_build_log ($$$$) { - my $conf = shift; - my $to = shift; - my $subject = shift; - my $file = shift; - - # If no build log compression is desired, just pass this mail to the - # ordinary mailing function that also handles the other notifications. - if (!$conf->get('COMPRESS_BUILD_LOG_MAILS')) { - return send_mail($conf, $to, $subject, $file); - } - - # This writes the compressed build log to yet another temporary file, - # generates base64 from it and pipes it into the mailer with - # Content-Type: application/x-gzip and Content-Transfer-Encoding: - # base64. - local( *F, *GZFILE ); - - if (!open( F, "<$file" )) { - warn "Cannot open $file for mailing: $!\n"; - return 0; - } - - my $tmp = File::Temp->new(); - tie *GZFILE, 'IO::Zlib', $tmp->filename, 'wb'; - - while( ) { - print GZFILE $_; - } - untie *GZFILE; - - my $filename = $tmp->filename; - if (!open( F, "<$filename" )) { - warn "Cannot open $filename for mailing: $!\n"; - return 0; - } - - local $SIG{'PIPE'} = 'IGNORE'; - - if (!open( MAIL, "|" . $conf->get('MAILPROG') . " -oem $to" )) { - warn "Could not open pipe to " . $conf->get('MAILPROG') . ": $!\n"; - close( F ); - return 0; - } - - print MAIL "From: " . $conf->get('MAILFROM') . "\n"; - print MAIL "To: $to\n"; - print MAIL "Subject: $subject\n"; - print MAIL "Content-Type: application/x-gzip\n"; - print MAIL "Content-Transfer-Encoding: base64\n"; - print MAIL "\n"; - - my $buf; - while (read(F, $buf, 60*57)) { - print MAIL encode_base64($buf); - } - - close( F ); - if (!close( MAIL )) { - warn $conf->get('MAILPROG') . " failed (exit status $?)\n"; - return 0; - } - return 1; -} - - sub send_mail ($$$$) { my $conf = shift; my $to = shift; diff -Nru sbuild-0.60.9/lib/WannaBuild/Conf.pm sbuild-0.62.2/lib/WannaBuild/Conf.pm --- sbuild-0.60.9/lib/WannaBuild/Conf.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/WannaBuild/Conf.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,294 +0,0 @@ -# -# Conf.pm: configuration library for wanna-build -# Copyright © 2005 Ryan Murray -# Copyright © 2006-2008 Roger Leigh -# -# 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 WannaBuild::Conf; - -use strict; -use warnings; - -use Cwd qw(cwd); -use Sbuild qw(isin); -use Sbuild::ConfBase; -use Sbuild::Log; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter); - - @EXPORT = qw(new setup read); -} - -sub new (); -sub setup ($); -sub read ($); - -sub new () { - my $conf = Sbuild::ConfBase->new(); - WannaBuild::Conf::setup($conf); - WannaBuild::Conf::read($conf); - - return $conf; -} - -sub setup ($) { - my $conf = shift; - - my $validate_directory = sub { - my $conf = shift; - my $entry = shift; - my $key = $entry->{'NAME'}; - my $directory = $conf->get($key); - - die "$key directory is not defined" - if !defined($directory); - - die "$key directory $directory does not exist" - if !-d $directory; - }; - - my %db_keys = ( - 'DB_TYPE' => { - DEFAULT => 'mldbm' - }, - 'DB_BASE_DIR' => { - CHECK => $validate_directory, - DEFAULT => $Sbuild::Sysconfig::paths{'WANNA_BUILD_LOCALSTATE_DIR'} - }, - 'DB_BASE_NAME' => { - CHECK => sub { - my $conf = shift; - my $entry = shift; - my $key = $entry->{'NAME'}; - - die "Database base name is not defined" - if !defined($conf->get($key)); - }, - DEFAULT => 'build-db' - }, - 'DB_TRANSACTION_LOG' => { - CHECK => sub { - my $conf = shift; - my $entry = shift; - my $key = $entry->{'NAME'}; - - die "Database transaction log is not defined" - if !defined($conf->get($key)); - }, - DEFAULT => 'transactions.log' - }, - 'DB_DISTRIBUTIONS' => { - CHECK => sub { - my $conf = shift; - my $entry = shift; - my $key = $entry->{'NAME'}; - - die "No distributions are defined" - if !defined($conf->get($key)); - }, - DEFAULT => { - 'experimental' => { priority => 4 }, - 'unstable' => { priority => 3 }, - 'testing' => { priority => 2 }, - 'testing-security' => { noadw => 1, - hidden => 1, - priority => 2 }, - 'stable' => { priority => 1 }, - 'stable-security' => { noadw => 1, - hidden => 1, - priority => 1 }, - 'oldstable' => { priority => 0 }, - 'oldstable-security' => { noadw => 1, - hidden => 1, - priority => 0 }, - } - }, - 'DB_SECTIONS' => { - DEFAULT => [ - 'main', - 'contrib', - 'non-free' - ] - }, - 'DB_PACKAGES_SOURCE' => { - DEFAULT => 'ftp://ftp.debian.org/debian' - }, - 'DB_QUINN_SOURCE' => { - DEFAULT => 'http://buildd.debian.org/quinn-diff/output' - }, - 'DB_ADMIN_USERS' => { - DEFAULT => [ - 'buildd' - ] - }, - 'DB_MAINTAINER_EMAIL' => { - DEFAULT => 'buildd' - }, - 'DB_NOTFORUS_MAINTAINER_EMAIL' => { - DEFAULT => 'buildd' - }, - 'DB_LOG_MAIL' => { - DEFAULT => undef - }, - 'DB_STAT_MAIL' => { - DEFAULT => undef - }, - 'DB_MAIL_DOMAIN' => { - DEFAULT => undef - }, - 'DB_WEB_STATS' => { - DEFAULT => undef - }, - # Not settable in config file: - 'DB_BIN_NMU_VERSION' => { - DEFAULT => undef - }, - 'DB_BUILD_PRIORITY' => { - DEFAULT => 0 - }, - 'DB_CATEGORY' => { - DEFAULT => undef - }, - 'DB_CREATE' => { - DEFAULT => 0 - }, - 'DB_EXPORT_FILE' => { - DEFAULT => undef - }, - 'DB_FAIL_REASON' => { - DEFAULT => undef - }, - 'DB_IMPORT_FILE' => { - DEFAULT => undef - }, - 'DB_INFO_ALL_DISTS' => { - DEFAULT => 0 - }, - 'DB_LIST_MIN_AGE' => { - DEFAULT => 0 - }, - 'DB_LIST_ORDER' => { - DEFAULT => 'PScpsn' - }, - 'DB_LIST_STATE' => { - DEFAULT => undef - }, - # TODO: Don't allow setting if already set. - 'DB_OPERATION' => { - DEFAULT => undef, - SET => sub { - my $conf = shift; - my $entry = shift; - my $value = shift; - my $key = $entry->{'NAME'}; - - if (!$conf->_get_value($key)) { - $conf->_set_value($key, $value); - } else { - die "Only one operation may be specified"; - } - } - }, - 'DB_OVERRIDE' => { - DEFAULT => 0 - }, - 'DB_USER' => { - DEFAULT => $conf->get('USERNAME') - } - ); - - $conf->set_allowed_keys(\%db_keys); -} - -sub read ($) { - my $conf = shift; - - # Set here to allow user to override. - if (-t STDIN && -t STDOUT && $conf->get('VERBOSE') == 0) { - $conf->set('VERBOSE', 1); - } - - our $HOME = $conf->get('HOME'); - - # Variables are undefined, so config will default to DEFAULT if unset. - - # New sbuild.conf format - our $db_type = undef; - our $db_base_dir = undef; - our $db_base_name = undef; - our $db_transaction_log = undef; - our %db_distributions; - undef %db_distributions; - our @db_distributions; - undef @db_distributions; - our %db_distribution_order; - undef %db_distribution_order; - our @db_sections; - undef @db_sections; - our $db_packages_source = undef; - our $db_quinn_source = undef; - our @db_admin_users; - undef @db_admin_users; - our $db_maintainer_email = undef; - our $db_notforus_maintainer_email = undef; - our $db_log_mail = undef; - our $db_stat_mail = undef; - our $db_mail_domain = undef; - our $db_web_stats = undef; - - # read conf files - foreach ($Sbuild::Sysconfig::paths{'WANNA_BUILD_CONF'}, - "$HOME/.wanna-buildrc") { - if (-r $_) { - my $e = eval `cat "$_"`; - if (!defined($e)) { - print STDERR "E: $_: Errors found in configuration file:\n$@"; - exit(1); - } - } - } - - $conf->set('DB_TYPE', $db_type); - $conf->set('DB_BASE_DIR', $db_base_dir); - $conf->set('DB_BASE_NAME', $db_base_name); - $conf->set('DB_TRANSACTION_LOG', $db_transaction_log); -# $conf->set('DB_DISTRIBUTIONS', \@db_distributions); -# TODO: Warn if using old value. Obsolete old options. - $conf->set('DB_DISTRIBUTIONS', \%db_distribution_order) - if (%db_distribution_order); - $conf->set('DB_DISTRIBUTIONS', \%db_distributions) - if (%db_distributions); - $conf->set('DB_SECTIONS', \@db_sections) - if (@db_sections); - $conf->set('DB_PACKAGES_SOURCE', $db_packages_source); - $conf->set('DB_QUINN_SOURCE', $db_quinn_source); - $conf->set('DB_ADMIN_USERS', \@db_admin_users) - if (@db_admin_users); - $conf->set('DB_MAINTAINER_EMAIL', $db_maintainer_email); - $conf->set('DB_NOTFORUS_MAINTAINER_EMAIL', $db_notforus_maintainer_email); - $conf->set('DB_LOG_MAIL', $db_log_mail); - $conf->set('DB_STAT_MAIL', $db_stat_mail); - $conf->set('DB_MAIL_DOMAIN', $db_mail_domain); - $conf->set('DB_WEB_STATS', $db_web_stats); -} - -1; diff -Nru sbuild-0.60.9/lib/WannaBuild/Database.pm sbuild-0.62.2/lib/WannaBuild/Database.pm --- sbuild-0.60.9/lib/WannaBuild/Database.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/WannaBuild/Database.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,2294 +0,0 @@ -# Copyright © 1998 Roman Hodek -# Copyright © 2005-2008 Ryan Murray -# Copyright © 2008 Roger Leigh . -# -####################################################################### - -package Wannabuild::Database; - -use strict; -use warnings; - -use POSIX; -use Dpkg::Arch; -use Sbuild qw(isin usage_error version_less version_lesseq version_eq version_compare); -use WannaBuild::Conf qw(); -use Sbuild::Sysconfig; -use Sbuild::DB::Info; -use Sbuild::DB::MLDBM; -use Sbuild::DB::Postgres; -use WannaBuild::Options; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter Sbuild::Base); - - @EXPORT = qw(); -} - -sub new { - my $class = shift; - my $conf = shift; - - my $self = $class->SUPER::new($conf); - bless($self, $class); - - $self->set('Current Database', undef); - $self->set('Databases', {}); - - $self->set('Mail Logs', ''); - - my @curr_time = gmtime(); - my $ctime = time(); - - $self->set('Current Date', strftime("%Y %b %d %H:%M:%S", @curr_time)); - $self->set('Short Date', strftime("%m/%d/%y", @curr_time)); - $self->set('Current Time', $ctime); - - # Note: specific contents are only incremented, never initially set. - # This might be a bug. - $self->set('New Version', {}); - - $self->set('Merge Src Version', {}); - $self->set('Merge Bin Src', {}); - - $self->set('Priority Values', { - required => -5, - important => -4, - standard => -3, - optional => -2, - extra => -1, - unknown => -1}); - - my $sectval = { - libs => -200, - 'debian-installer' => -199, - base => -198, - devel => -197, - kernel => -196, - shells => -195, - perl => -194, - python => -193, - graphics => -192, - admin => -191, - utils => -190, - x11 => -189, - editors => -188, - net => -187, - httpd => -186, - mail => -185, - news => -184, - tex => -183, - text => -182, - web => -181, - vcs => -180, - doc => -179, - localizations => -178, - interpreters => -177, - ruby => -176, - java => -175, - ocaml => -174, - lisp => -173, - haskell => -172, - 'cli-mono' => -171, - gnome => -170, - kde => -169, - xfce => -168, - gnustep => -167, - database => -166, - video => -165, - debug => -164, - games => -163, - misc => -162, - fonts => -161, - otherosfs => -160, - oldlibs => -159, - libdevel => -158, - sound => -157, - math => -156, - 'gnu-r' => -155, - science => -154, - comm => -153, - electronics => -152, - hamradio => -151, - embedded => -150, - php => -149, - zope => -148, - }; - foreach my $i (keys %{$sectval}) { - $sectval->{"contrib/$i"} = $sectval->{$i}+40; - $sectval->{"non-free/$i"} = $sectval->{$i}+80; - } - $sectval->{'unknown'} = -165; - $self->set('Section Values', $sectval); - - $self->set('Category Values', { - "none" => -20, - "uploaded-fixed-pkg" => -19, - "fix-expected" => -18, - "reminder-sent" => -17, - "nmu-offered" => -16, - "easy" => -15, - "medium" => -14, - "hard" => -13, - "compiler-error" => -12}); - - return $self; -} - -sub run { - my $self = shift; - - $self->set_conf('DB_OPERATION', $self->get_conf('DB_CATEGORY') ? "set-failed" : "set-building") - if !$self->get_conf('DB_OPERATION'); # default operation - $self->set_conf('DB_LIST_ORDER', $self->get_conf('DB_LIST_STATE') eq "failed" ? 'fPcpasn' : 'PScpasn') - if (!$self->get_conf('DB_LIST_ORDER') && - (defined($self->get_conf('DB_LIST_STATE')) && $self->get_conf('DB_LIST_STATE'))); - $self->set_conf('DISTRIBUTION', 'unstable') - if !defined($self->get_conf('DISTRIBUTION')); - - die "Bad distribution '" . $self->get_conf('DISTRIBUTION') . "'\n" - if !isin($self->get_conf('DISTRIBUTION'), keys %{$self->get_conf('DB_DISTRIBUTIONS')}); - - if ($self->get_conf('VERBOSE')) { - print "wanna-build (Debian sbuild) $Sbuild::Sysconfig::version ($Sbuild::Sysconfig::release_date) on " . $self->get_conf('HOSTNAME') . "\n"; - print "Using database " . $self->get_conf('DB_BASE_NAME') . '/' . $self->get_conf('DISTRIBUTION') . "\n" - } - - if (!@ARGV && !isin($self->get_conf('DB_OPERATION'), - qw(list merge-quinn merge-partial-quinn import - export merge-packages manual-edit - maintlock-create merge-sources - maintlock-remove clean-db))) { - usage_error("wanna-build", "No packages given."); - } - - if (!$self->get_conf('DB_FAIL_REASON')) { - if ($self->get_conf('DB_OPERATION') eq "set-failed" && !$self->get_conf('DB_CATEGORY')) { - print "Enter reason for failing (end with '.' alone on ". - "its line):\n"; - my $log = ""; - my $line; - while(!eof(STDIN)) { - $line = ; - last if $line eq ".\n"; - $log .= $line; - } - chomp($log); - $self->set_conf('DB_FAIL_REASON', $log); - } elsif ($self->get_conf('DB_OPERATION') eq "set-dep-wait") { - print "Enter dependencies (one line):\n"; - my $line; - while( !$line && !eof(STDIN) ) { - chomp( $line = ); - } - die "No dependencies given\n" if !$line; - $self->set_conf('DB_FAIL_REASON'. $line); - } elsif ($self->get_conf('DB_OPERATION') eq "set-binary-nmu" and $self->get_conf('DB_BIN_NMU_VERSION') > 0) { - print "Enter changelog entry (one line):\n"; - my $line; - while( !$line && !eof(STDIN) ) { - chomp( $line = ); - } - die "No changelog entry given\n" if !$line; - $self->set_conf('DB_FAIL_REASON', $line); - } - } - if ($self->get_conf('DB_OPERATION') eq "maintlock-create") { - $self->create_maintlock(); - exit 0; - } - if ($self->get_conf('DB_OPERATION') eq "maintlock-remove") { - $self->remove_maintlock(); - exit 0; - } - $self->waitfor_maintlock() if $self->get_conf('DB_OPERATION') !~ /^(?:merge-|clean-db$)/; - - if (!-f $self->db_filename( $self->get_conf('DISTRIBUTION') ) && !$self->get_conf('DB_CREATE')) { - die "Database for " . $self->get_conf('DISTRIBUTION') . " doesn't exist\n"; - } - - # TODO: Use 'Databases' only. - $self->set('Current Database', - $self->open_db($self->get_conf('DISTRIBUTION'))); - - $self->process(); - - if ($self->get('Mail Logs') && - defined($self->get_conf('DB_LOG_MAIL')) && $self->get_conf('DB_LOG_MAIL')) { - $self->send_mail($self->get_conf('DB_LOG_MAIL'), - "wanna-build " . $self->get_conf('DISTRIBUTION') . - " state changes " . $self->get('Current Date'), - "State changes at " . $self->get('Current Date') . - " for distribution ". - $self->get_conf('DISTRIBUTION') . ":\n\n". - $self->get('Mail Logs') . "\n"); - } - - return 0; -} - -sub process { - my $self = shift; - - SWITCH: foreach ($self->get_conf('DB_OPERATION')) { - /^set-(.+)/ && do { - $self->add_packages( $1, @ARGV ); - last SWITCH; - }; - /^list/ && do { - $self->list_packages($self->get_conf('DB_LIST_STATE')); - last SWITCH; - }; - /^info/ && do { - $self->info_packages( @ARGV ); - last SWITCH; - }; - /^forget-user/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - $self->forget_users( @ARGV ); - last SWITCH; - }; - /^forget/ && do { - $self->forget_packages( @ARGV ); - last SWITCH; - }; - /^merge-partial-quinn/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - $self->parse_quinn_diff(1); - last SWITCH; - }; - /^merge-quinn/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - $self->parse_quinn_diff(0); - last SWITCH; - }; - /^merge-packages/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - $self->parse_packages(); - last SWITCH; - }; - /^merge-sources/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - $self->parse_sources(0); - last SWITCH; - }; - /^pretend-avail/ && do { - $self->pretend_avail( @ARGV ); - last SWITCH; - }; - /^merge-all/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - my @ARGS = @ARGV; - @ARGV = ( $ARGS[0] ); - my $pkgs = $self->parse_packages(); - @ARGV = ( $ARGS[1] ); - $self->parse_quinn_diff(0); - @ARGV = ( $ARGS[2] ); - my $build_deps = $self->parse_sources(1); - $self->auto_dep_wait( $build_deps, $pkgs ); - $self->get('Current Database')->clean(); - last SWITCH; - }; - /^import/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - $self->get('Current Database')->clear(); # clear all current contents - $self->get('Current Database')->restore($self->get_conf('DB_IMPORT_FILE')); - last SWITCH; - }; - /^export/ && do { - $self->get('Current Database')->dump($self->get_conf('DB_EXPORT_FILE')); - last SWITCH; - }; - /^manual-edit/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - my $tmpfile_pattern = "/tmp/wanna-build-" . $self->get_conf('DISTRIBUTION') . ".$$-"; - my ($tmpfile, $i); - for( $i = 0;; ++$i ) { - $tmpfile = $tmpfile_pattern . $i; - last if ! -e $tmpfile; - } - $self->get('Current Database')->dump($tmpfile); - my $editor = $ENV{'VISUAL'} || - "/usr/bin/sensible-editor"; - system "$editor $tmpfile"; - $self->get('Current Database')->clear(); # clear all current contents - $self->get('Current Database')->restore($tmpfile); - unlink( $tmpfile ); - last SWITCH; - }; - /^clean-db/ && do { - die "This operation is restricted to admin users\n" - if (defined @{$self->get_conf('DB_ADMIN_USERS')} and - !isin( $self->get_conf('USERNAME'), @{$self->get_conf('DB_ADMIN_USERS')})); - $self->get('Current Database')->clean(); - last SWITCH; - }; - - die "Unexpected operation mode " . $self->get_conf('DB_OPERATION') . "\n"; - } - if (not -t and $self->get_conf('DB_USER') =~ /-/) { - my $ui = $self->get('Current Database')->get_user($self->get_conf('DB_USER')); - $ui = {} if (!defined($ui)); - - $ui->{'Last-Seen'} = $self->get('Current Date'); - $ui->{'User'} = $self->get_conf('DB_USER'); - - $self->get('Current Database')->set_user($ui); - } - -} - -sub add_packages { - my $self = shift; - my $newstate = shift; - - my( $package, $name, $version, $ok, $reason ); - - foreach $package (@_) { - $package =~ s,^.*/,,; # strip path - $package =~ s/\.(dsc|diff\.gz|tar\.gz|deb)$//; # strip extension - $package =~ s/_[a-zA-Z\d-]+\.changes$//; # strip extension - if ($package =~ /^([\w\d.+-]+)_([\w\d:.+~-]+)/) { - ($name,$version) = ($1,$2); - } - else { - warn "$package: can't extract package name and version ". - "(bad format)\n"; - next; - } - - if ($self->get_conf('DB_OPERATION') eq "set-building") { - $self->add_one_building( $name, $version ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-built") { - $self->add_one_built( $name, $version ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-attempted") { - $self->add_one_attempted( $name, $version ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-uploaded") { - $self->add_one_uploaded( $name, $version ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-failed") { - $self->add_one_failed( $name, $version ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-not-for-us") { - $self->add_one_notforus( $name, $version ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-needs-build") { - $self->add_one_needsbuild( $name, $version ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-dep-wait") { - $self->add_one_depwait( $name, $version ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-build-priority") { - $self->set_one_buildpri( $name, $version, 'BuildPri' ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-permanent-build-priority") { - $self->set_one_buildpri( $name, $version, 'PermBuildPri' ); - } - elsif ($self->get_conf('DB_OPERATION') eq "set-binary-nmu") { - $self->set_one_binnmu( $name, $version ); - } - } -} - -sub add_one_building { - my $self = shift; - my $name = shift; - my $version = shift; - - my( $ok, $reason ); - - $ok = 1; - my $pkg = $self->get('Current Database')->get_package($name); - if (defined($pkg)) { - if ($pkg->{'State'} eq "Not-For-Us") { - $ok = 0; - $reason = "not suitable for this architecture"; - } - elsif ($pkg->{'State'} =~ /^Dep-Wait/) { - $ok = 0; - $reason = "not all source dependencies available yet"; - } - elsif ($pkg->{'State'} eq "Uploaded" && - (version_lesseq($version, $pkg->{'Version'}))) { - $ok = 0; - $reason = "already uploaded by $pkg->{'Builder'}"; - $reason .= " (in newer version $pkg->{'Version'})" - if !version_eq($pkg, $version); - } - elsif ($pkg->{'State'} eq "Installed" && - version_less($version,$pkg->{'Version'})) { - if ($self->get_conf('DB_OVERRIDE')) { - print "$name: Warning: newer version $pkg->{'Version'} ". - "already installed, but overridden.\n"; - } - else { - $ok = 0; - $reason = "newer version $pkg->{'Version'} already in ". - "archive; doesn't need rebuilding"; - print "$name: Note: If the following is due to an epoch ", - " change, use --override\n"; - } - } - elsif ($pkg->{'State'} eq "Installed" && - $self->pkg_version_eq($pkg,$version)) { - $ok = 0; - $reason = "is up-to-date in the archive; doesn't need rebuilding"; - } - elsif ($pkg->{'State'} eq "Needs-Build" && - version_less($version,$pkg->{'Version'})) { - if ($self->get_conf('DB_OVERRIDE')) { - print "$name: Warning: newer version $pkg->{'Version'} ". - "needs building, but overridden."; - } - else { - $ok = 0; - $reason = "newer version $pkg->{'Version'} needs building, ". - "not $version"; - } - } - elsif (isin($pkg->{'State'},qw(Building Built Build-Attempted))) { - if (version_less($pkg->{'Version'},$version)) { - print "$name: Warning: Older version $pkg->{'Version'} ", - "is being built by $pkg->{'Builder'}\n"; - if ($pkg->{'Builder'} ne $self->get_conf('DB_USER')) { - $self->send_mail( - $pkg->{'Builder'}, - "package takeover in newer version", - "You are building package '$name' in ". - "version $version\n". - "(as far as I'm informed).\n". - $self->get_conf('DB_USER') . " now has taken the newer ". - "version $version for building.". - "You can abort the build if you like.\n"); - } - } - else { - if ($self->get_conf('DB_OVERRIDE')) { - print "User $pkg->{'Builder'} had already ", - "taken the following package,\n", - "but overriding this as you request:\n"; - $self->send_mail( - $pkg->{'Builder'}, "package takeover", - "The package '$name' (version $version) that ". - "was locked by you\n". - "has been taken over by " . $self->get_conf('DB_USER') . "\n"); - } - elsif ($pkg->{'Builder'} eq $self->get_conf('DB_USER')) { - print "$name: Note: already taken by you.\n"; - print "$name: ok\n" if $self->get_conf('VERBOSE'); - return; - } - else { - $ok = 0; - $reason = "already taken by $pkg->{'Builder'}"; - $reason .= " (in newer version $pkg->{'Version'})" - if !version_eq($pkg->{'Version'}, $version); - } - } - } - elsif ($pkg->{'State'} =~ /^Failed/ && - $self->pkg_version_eq($pkg, $version)) { - if ($self->get_conf('DB_OVERRIDE')) { - print "The following package previously failed ", - "(by $pkg->{'Builder'})\n", - "but overriding this as you request:\n"; - $self->send_mail( - $pkg->{'Builder'}, "failed package takeover", - "The package '$name' (version $version) that ". - "is locked by you\n". - "and has failed previously has been taken over ". - "by " . $self->get_conf('DB_USER') . "\n") - if $pkg->{'Builder'} ne $self->get_conf('DB_USER'); - } - else { - $ok = 0; - $reason = "build of $version failed previously:\n "; - $reason .= join( "\n ", split( "\n", $pkg->{'Failed'} )); - $reason .= "\nalso the package doesn't need builing" - if $pkg->{'State'} eq 'Failed-Removed'; - } - } - } - if ($ok) { - my $ok = 'ok'; - if ($pkg->{'Binary-NMU-Version'}) { - print "$name: Warning: needs binary NMU $pkg->{'Binary-NMU-Version'}\n" . - "$pkg->{'Binary-NMU-Changelog'}\n"; - $ok = 'aok'; - } else { - print "$name: Warning: Previous version failed!\n" - if $pkg->{'Previous-State'} =~ /^Failed/ || - $pkg->{'State'} =~ /^Failed/; - } - $self->change_state( $pkg, 'Building' ); - $pkg->{'Package'} = $name; - $pkg->{'Version'} = $version; - $pkg->{'Builder'} = $self->get_conf('DB_USER'); - $self->log_ta( $pkg, "--take" ); - $self->get('Current Database')->set_package($pkg); - print "$name: $ok\n" if $self->get_conf('VERBOSE'); - } - else { - print "$name: NOT OK!\n $reason\n"; - } -} - -sub add_one_attempted { - my $self = shift; - my $name = shift; - my $version = shift; - - my $pkg = $self->get('Current Database')->get_package($name); - - if (!defined($pkg)) { - print "$name: not registered yet.\n"; - return; - } - - if ($pkg->{'State'} ne "Building" ) { - print "$name: not taken for building (state is $pkg->{'State'}). ", - "Skipping.\n"; - return; - } - if ($pkg->{'Builder'} ne $self->get_conf('USERNAME')) { - print "$name: not taken by you, but by $pkg->{'Builder'}. Skipping.\n"; - return; - } - elsif ( !$self->pkg_version_eq($pkg, $version) ) { - print "$name: version mismatch ". - "$(pkg->{'Version'} ". - "by $pkg->{'Builder'})\n"; - return; - } - - $self->change_state( $pkg, 'Build-Attempted' ); - $self->log_ta( $pkg, "--attempted" ); - $self->get('Current Database')->set_package($pkg); - print "$name: registered as uploaded\n" if $self->get_conf('VERBOSE'); -} - -sub add_one_built { - my $self = shift; - my $name = shift; - my $version = shift; - - my $pkg = $self->get('Current Database')->get_package($name); - - if (!defined($pkg)) { - print "$name: not registered yet.\n"; - return; - } - - if ($pkg->{'State'} ne "Building" ) { - print "$name: not taken for building (state is $pkg->{'State'}). ", - "Skipping.\n"; - return; - } - if ($pkg->{'Builder'} ne $self->get_conf('USERNAME')) { - print "$name: not taken by you, but by $pkg->{'Builder'}. Skipping.\n"; - return; - } - elsif ( !$self->pkg_version_eq($pkg, $version) ) { - print "$name: version mismatch ". - "$(pkg->{'Version'} ". - "by $pkg->{'Builder'})\n"; - return; - } - $self->change_state( $pkg, 'Built' ); - $self->log_ta( $pkg, "--built" ); - $self->get('Current Database')->set_package($pkg); - print "$name: registered as built\n" if $self->get_conf('VERBOSE'); -} - -sub add_one_uploaded { - my $self = shift; - my $name = shift; - my $version = shift; - - my $pkg = $self->get('Current Database')->get_package($name); - - if (!defined($pkg)) { - print "$name: not registered yet.\n"; - return; - } - - if ($pkg->{'State'} eq "Uploaded" && - $self->pkg_version_eq($pkg,$version)) { - print "$name: already uploaded\n"; - return; - } - if (!isin( $pkg->{'State'}, qw(Building Built Build-Attempted))) { - print "$name: not taken for building (state is $pkg->{'State'}). ", - "Skipping.\n"; - return; - } - if ($pkg->{'Builder'} ne $self->get_conf('DB_USER')) { - print "$name: not taken by you, but by $pkg->{'Builder'}. Skipping.\n"; - return; - } - # strip epoch -- buildd-uploader used to go based on the filename. - # (to remove at some point) - my $pkgver; - ($pkgver = $pkg->{'Version'}) =~ s/^\d+://; - $version =~ s/^\d+://; # for command line use - if ($pkg->{'Binary-NMU-Version'} ) { - my $nmuver = binNMU_version($pkgver, $pkg->{'Binary-NMU-Version'}); - if (!version_eq( $nmuver, $version )) { - print "$name: version mismatch ($nmuver registered). ", - "Skipping.\n"; - return; - } - } elsif (!version_eq($pkgver, $version)) { - print "$name: version mismatch ($pkg->{'Version'} registered). ", - "Skipping.\n"; - return; - } - - $self->change_state( $pkg, 'Uploaded' ); - $self->log_ta( $pkg, "--uploaded" ); - $self->get('Current Database')->set_package($pkg); - print "$name: registered as uploaded\n" if $self->get_conf('VERBOSE'); -} - -sub add_one_failed { - my $self = shift; - my $name = shift; - my $version = shift; - - my ($state, $cat); - my $pkg = $self->get('Current Database')->get_package($name); - - if (!defined($pkg)) { - print "$name: not registered yet.\n"; - return; - } - $state = $pkg->{'State'}; - - if ($state eq "Not-For-Us") { - print "$name: not suitable for this architecture anyway. Skipping.\n"; - return; - } - elsif ($state eq "Failed-Removed") { - print "$name: failed previously and doesn't need building. Skipping.\n"; - return; - } - elsif ($state eq "Installed") { - print "$name: Is already installed in archive. Skipping.\n"; - return; - } - elsif ($pkg->{'Builder'} && - (($self->get_conf('DB_USER') ne $pkg->{'Builder'}) && - !($pkg->{'Builder'} =~ /^(\w+)-\w+/ && $1 eq $self->get_conf('DB_USER')))) { - print "$name: not taken by you, but by ". - "$pkg->{'Builder'}. Skipping.\n"; - return; - } - elsif ( !$self->pkg_version_eq($pkg, $version) ) { - print "$name: version mismatch ". - "$(pkg->{'Version'} ". - "by $pkg->{'Builder'})\n"; - return; - } - - $cat = $self->get_conf('DB_CATEGORY'); - if (!$cat && $self->get_conf('DB_FAIL_REASON') =~ /^\[([^\]]+)\]/) { - $cat = $1; - $cat = category($cat); - $cat = "" if !defined($cat); - my $fail_reason = $self->get_conf('DB_FAIL_REASON'); - $fail_reason =~ s/^\[[^\]]+\][ \t]*\n*//; - $self->set_conf('DB_FAIL_REASON', $fail_reason); - } - - if ($state eq "Needs-Build") { - print "$name: Warning: not registered for building previously, ". - "but processing anyway.\n"; - } - elsif ($state eq "Uploaded") { - print "$name: Warning: marked as uploaded previously, ". - "but processing anyway.\n"; - } - elsif ($state eq "Dep-Wait") { - print "$name: Warning: marked as waiting for dependencies, ". - "but processing anyway.\n"; - } - elsif ($state eq "Failed") { - print "$name: already registered as failed; will append new message\n" - if $self->get_conf('DB_FAIL_REASON'); - print "$name: already registered as failed; changing category\n" - if $cat; - } - - if (($cat eq "reminder-sent" || $cat eq "nmu-offered") && - exists $pkg->{'Failed-Category'} && - $pkg->{'Failed-Category'} ne $cat) { - (my $action = $cat) =~ s/-/ /; - $self->set_conf('DB_FAIL_REASON', - $self->get_conf('DB_FAIL_REASON') . "\n" . - $self->get('Short Date') . ": $action"); - } - - $self->change_state( $pkg, 'Failed' ); - $pkg->{'Builder'} = $self->get_conf('DB_USER'); - $pkg->{'Failed'} .= "\n" if $pkg->{'Failed'}; - $pkg->{'Failed'} .= $self->get_conf('DB_FAIL_REASON'); - $pkg->{'Failed-Category'} = $cat if $cat; - if (defined $pkg->{'PermBuildPri'}) { - $pkg->{'BuildPri'} = $pkg->{'PermBuildPri'}; - } else { - delete $pkg->{'BuildPri'}; - } - $self->log_ta( $pkg, "--failed" ); - $self->get('Current Database')->set_package($pkg); - print "$name: registered as failed\n" if $self->get_conf('VERBOSE'); -} - -sub add_one_notforus { - my $self = shift; - my $name = shift; - my $version = shift; - - my $pkg = $self->get('Current Database')->get_package($name); - - if ($pkg->{'State'} eq 'Not-For-Us') { - # reset Not-For-Us state in case it's called twice; this is - # the only way to get a package out of this state... - # There is no really good state in which such packages should - # be put :-( So use Failed for now. - $self->change_state( $pkg, 'Failed' ); - $pkg->{'Package'} = $name; - $pkg->{'Failed'} = "Was Not-For-Us previously"; - delete $pkg->{'Builder'}; - delete $pkg->{'Depends'}; - $self->log_ta( $pkg, "--no-build(rev)" ); - print "$name: now not unsuitable anymore\n"; - - $self->send_mail( - $self->get_conf('DB_NOTFORUS_MAINTAINER_EMAIL'), - "$name moved out of Not-For-Us state", - "The package '$name' has been moved out of the Not-For-Us ". - "state by " . $self->get_conf('DB_USER') . ".\n". - "It should probably also be removed from ". - "Packages-arch-specific or\n". - "the action was wrong.\n") - if $self->get_conf('DB_NOTFORUS_MAINTAINER_EMAIL'); - } - else { - $self->change_state( $pkg, 'Not-For-Us' ); - $pkg->{'Package'} = $name; - delete $pkg->{'Builder'}; - delete $pkg->{'Depends'}; - delete $pkg->{'BuildPri'}; - delete $pkg->{'Binary-NMU-Version'}; - delete $pkg->{'Binary-NMU-Changelog'}; - $self->log_ta( $pkg, "--no-build" ); - print "$name: registered as unsuitable\n" if $self->get_conf('VERBOSE'); - - $self->send_mail( - $self->get_conf('DB_NOTFORUS_MAINTAINER_EMAIL'), - "$name set to Not-For-Us", - "The package '$name' has been set to state Not-For-Us ". - "by " . $self->get_conf('DB_USER') . ".\n". - "It should probably also be added to ". - "Packages-arch-specific or\n". - "the Not-For-Us state is wrong.\n") - if $self->get_conf('DB_NOTFORUS_MAINTAINER_EMAIL'); - } - $self->get('Current Database')->set_package($pkg); -} - -sub add_one_needsbuild { - my $self = shift; - my $name = shift; - my $version = shift; - - my $state; - my $pkg = $self->get('Current Database')->get_package($name); - - if (!defined($pkg)) { - print "$name: not registered; can't give back.\n"; - return; - } - $state = $pkg->{'State'}; - - if ($state eq "Dep-Wait") { - if ($self->get_conf('DB_OVERRIDE')) { - print "$name: Forcing source dependency list to be cleared\n"; - } - else { - print "$name: waiting for source dependencies. Skipping\n", - " (use --override to clear dependency list and ", - "give back anyway)\n"; - return; - } - } - elsif (!isin( $state, qw(Building Built Build-Attempted))) { - print "$name: not taken for building (state is $state)."; - if ($self->get_conf('DB_OVERRIDE')) { - print "\n$name: Forcing give-back\n"; - } - else { - print " Skipping.\n"; - return; - } - } - if (defined ($pkg->{'Builder'}) && $self->get_conf('DB_USER') ne $pkg->{'Builder'} && - !($pkg->{'Builder'} =~ /^(\w+)-\w+/ && $1 eq $self->get_conf('DB_USER'))) { - print "$name: not taken by you, but by ". - "$pkg->{'Builder'}. Skipping.\n"; - return; - } - if (!$self->pkg_version_eq($pkg, $version)) { - print "$name: version mismatch ($pkg->{'Version'} registered). ", - "Skipping.\n"; - return; - } - $self->change_state( $pkg, 'Needs-Build' ); - delete $pkg->{'Builder'}; - delete $pkg->{'Depends'}; - $self->log_ta( $pkg, "--give-back" ); - $self->get('Current Database')->set_package($pkg); - print "$name: given back\n" if $self->get_conf('VERBOSE'); -} - -sub set_one_binnmu { - my $self = shift; - my $name = shift; - my $version = shift; - - my $pkg = $self->get('Current Database')->get_package($name); - my $state; - - if (!defined($pkg)) { - print "$name: not registered; can't register for binNMU.\n"; - return; - } - my $db_ver = $pkg->{'Version'}; - - if (!version_eq($db_ver, $version)) { - print "$name: version mismatch ($db_ver registered). ", - "Skipping.\n"; - return; - } - $state = $pkg->{'State'}; - - if (defined $pkg->{'Binary-NMU-Version'}) { - if ($self->get_conf('DB_BIN_NMU_VERSION') == 0) { - $self->change_state( $pkg, 'Installed' ); - delete $pkg->{'Builder'}; - delete $pkg->{'Depends'}; - delete $pkg->{'Binary-NMU-Version'}; - delete $pkg->{'Binary-NMU-Changelog'}; - } elsif ($self->get_conf('DB_BIN_NMU_VERSION') <= $pkg->{'Binary-NMU-Version'}) { - print "$name: already building binNMU $pkg->{'Binary-NMU-Version'}\n"; - return; - } else { - $pkg->{'Binary-NMU-Version'} = $self->get_conf('DB_BIN_NMU_VERSION'); - $pkg->{'Binary-NMU-Changelog'} = $self->get_conf('DB_FAIL_REASON'); - $pkg->{'Notes'} = 'out-of-date'; - $pkg->{'BuildPri'} = $pkg->{'PermBuildPri'} - if (defined $pkg->{'PermBuildPri'}); - } - $self->log_ta( $pkg, "--binNMU" ); - $self->get('Current Database')->set_package($pkg); - return; - } elsif ($self->get_conf('DB_BIN_NMU_VERSION')) { - print "${name}_$version: no scheduled binNMU to cancel.\n"; - return; - } - - if ($state ne 'Installed') { - print "${name}_$version: not installed; can't register for binNMU.\n"; - return; - } - - my $fullver = binNMU_version($version,$self->get_conf('DB_BIN_NMU_VERSION')); - if (version_lesseq($fullver, $pkg->{'Installed-Version'})) { - print "$name: binNMU $fullver is not newer than current version $pkg->{'Installed-Version'}\n"; - return; - } - - $self->change_state( $pkg, 'Needs-Build' ); - delete $pkg->{'Builder'}; - delete $pkg->{'Depends'}; - $pkg->{'Binary-NMU-Version'} = $self->get_conf('DB_BIN_NMU_VERSION'); - $pkg->{'Binary-NMU-Changelog'} = $self->get_conf('DB_FAIL_REASON'); - $pkg->{'Notes'} = 'out-of-date'; - $self->log_ta( $pkg, "--binNMU" ); - $self->get('Current Database')->set_package($pkg); - print "${name}: registered for binNMU $fullver\n" if $self->get_conf('VERBOSE'); -} - -sub set_one_buildpri { - my $self = shift; - my $name = shift; - my $version = shift; - my $key = shift; - my $pkg = $self->get('Current Database')->get_package($name); - my $state; - - if (!defined($pkg)) { - print "$name: not registered; can't set priority.\n"; - return; - } - $state = $pkg->{'State'}; - - if ($state eq "Not-For-Us") { - print "$name: not suitable for this architecture. Skipping.\n"; - return; - } elsif ($state eq "Failed-Removed") { - print "$name: failed previously and doesn't need building. Skipping.\n"; - return; - } - if (!$self->pkg_version_eq($pkg, $version)) { - print "$name: version mismatch ($pkg->{'Version'} registered). ", - "Skipping.\n"; - return; - } - if ( $self->get_conf('DB_BUILD_PRIORITY') == 0 ) { - delete $pkg->{'BuildPri'} - if $key eq 'PermBuildPri' and defined $pkg->{'BuildPri'} - and $pkg->{'BuildPri'} == $pkg->{$key}; - delete $pkg->{$key}; - } else { - $pkg->{'BuildPri'} = $self->get_conf('DB_BUILD_PRIORITY') - if $key eq 'PermBuildPri'; - $pkg->{$key} = $self->get_conf('DB_BUILD_PRIORITY'); - } - $self->get('Current Database')->set_package($pkg); - print "$name: set to build priority " . - $self->get_conf('DB_BUILD_PRIORITY') . "\n" if $self->get_conf('VERBOSE'); -} - -sub add_one_depwait { - my $self = shift; - my $name = shift; - my $version = shift; - my $state; - my $pkg = $self->get('Current Database')->get_package($name); - - if (!defined($pkg)) { - print "$name: not registered yet.\n"; - return; - } - $state = $pkg->{'State'}; - - if ($state eq "Dep-Wait") { - print "$name: merging with previously registered dependencies\n"; - } - - if (isin( $state, qw(Needs-Build Failed))) { - print "$name: Warning: not registered for building previously, ". - "but processing anyway.\n"; - } - elsif ($state eq "Not-For-Us") { - print "$name: not suitable for this architecture anyway. Skipping.\n"; - return; - } - elsif ($state eq "Failed-Removed") { - print "$name: failed previously and doesn't need building. Skipping.\n"; - return; - } - elsif ($state eq "Installed") { - print "$name: Is already installed in archive. Skipping.\n"; - return; - } - elsif ($state eq "Uploaded") { - print "$name: Is already uploaded. Skipping.\n"; - return; - } - elsif ($pkg->{'Builder'} && - $self->get_conf('DB_USER') ne $pkg->{'Builder'}) { - print "$name: not taken by you, but by ". - "$pkg->{'Builder'}. Skipping.\n"; - return; - } - elsif ( !$self->pkg_version_eq($pkg,$version)) { - print "$name: version mismatch ". - "($pkg->{'Version'} ". - "by $pkg->{'Builder'})\n"; - return; - } - elsif ($self->get_conf('DB_FAIL_REASON') =~ /^\s*$/ || - !$self->parse_deplist( $self->get_conf('DB_FAIL_REASON'), 1 )) { - print "$name: Bad dependency list\n"; - return; - } - $self->change_state( $pkg, 'Dep-Wait' ); - $pkg->{'Builder'} = $self->get_conf('DB_USER'); - if (defined $pkg->{'PermBuildPri'}) { - $pkg->{'BuildPri'} = $pkg->{'PermBuildPri'}; - } else { - delete $pkg->{'BuildPri'}; - } - my $deplist = $self->parse_deplist( $pkg->{'Depends'}, 0 ); - my $new_deplist = $self->parse_deplist( $self->get_conf('DB_FAIL_REASON'), 0 ); - # add new dependencies, maybe overwriting old entries - foreach (keys %$new_deplist) { - $deplist->{$_} = $new_deplist->{$_}; - } - $pkg->{'Depends'} = $self->build_deplist($deplist); - $self->log_ta( $pkg, "--dep-wait" ); - $self->get('Current Database')->set_package($pkg); - print "$name: registered as waiting for dependencies\n" if $self->get_conf('VERBOSE'); -} - - -sub parse_sources { - my $self = shift; - my $full = shift; - - my %pkgs; - my %srcver; - my $name; - - local($/) = ""; # read in paragraph mode - while( <> ) { - my( $version, $arch, $section, $priority, $builddep, $buildconf, $binaries ); - s/\s*$//m; - /^Package:\s*(\S+)$/mi and $name = $1; - /^Version:\s*(\S+)$/mi and $version = $1; - /^Architecture:\s*(.+)$/mi and $arch = $1; - /^Section:\s*(\S+)$/mi and $section = $1; - /^Priority:\s*(\S+)$/mi and $priority = $1; - /^Build-Depends:\s*(.*)$/mi and $builddep = $1; - /^Build-Conflicts:\s*(.*)$/mi and $buildconf = $1; - /^Binary:\s*(.*)$/mi and $binaries = $1; - - next if (defined $srcver{$name} and version_less( $version, $srcver{$name} )); - $srcver{$name} = $version; - if ($buildconf) { - $buildconf = join( ", ", map { "!$_" } split( /\s*,\s*/, $buildconf )); - if ($builddep) { - $builddep .= "," . $buildconf; - } else { - $builddep = $buildconf; - } - } - - $pkgs{$name}{'dep'} = defined $builddep ? $builddep : ""; - $pkgs{$name}{'ver'} = $version; - $pkgs{$name}{'bin'} = $binaries; - my $pkg = $self->get('Current Database')->get_package($name); - - if (defined $pkg) { - my $change = 0; - - if ($arch eq "all" && !version_less( $version, $pkg->{'Version'} )) { - # package is now Arch: all, delete it from db - $self->change_state( $pkg, 'deleted' ); - $self->log_ta( $pkg, "--merge-sources" ); - print "$name ($pkg->{'Version'}): deleted ". - "from database, because now Arch: all\n" - if $self->get_conf('VERBOSE'); - $self->get('Current Database')->del_package($pkg); - next; - } - - # The "Version" should always be the source version -- - # not a possible binNMU version number. - $pkg->{'Version'} = $version, $change++ - if ($pkg->{'State'} eq 'Installed' and - !version_eq( $pkg->{'Version'}, $version)); - # Always update priority and section, if available - $pkg->{'Priority'} = $priority, $change++ - if defined $priority && (!defined($pkg->{'Priority'}) || - $pkg->{'Priority'} ne $priority); - $pkg->{'Section'} = $section, $change++ - if defined $section && (!defined($pkg->{'Section'}) || - $pkg->{'Section'} ne $section); - $self->get('Current Database')->set_package($pkg) if $change; - } - } - # Now that we only have the latest source version, build the list - # of binary packages from the Sources point of view - foreach $name (keys %pkgs) { - foreach my $bin (split( /\s*,\s*/, $pkgs{$name}{'bin'} ) ) { - $self->get('Merge Bin Src')->{$bin} = $name; - } - } - # remove installed packages that no longer have source available - # or binaries installed - foreach $name ($self->get('Current Database')->list_packages()) { - my $pkg = $self->get('Current Database')->get_package($name); - if (not defined($pkgs{$name})) { - $self->change_state( $pkg, 'deleted' ); - $self->log_ta( $pkg, "--merge-sources" ); - print "$name ($pkg->{'Version'}): ". - "deleted from database, because ". - "not in Sources anymore\n" - if $self->get_conf('VERBOSE'); - $self->get('Current Database')->del_package($name); - } else { - next if !isin( $pkg->{'State'}, qw(Installed) ); - if ($full && not defined $self->get('Merge Src Version')->{$name}) { - $self->change_state( $pkg, 'deleted' ); - $self->log_ta( $pkg, "--merge-sources" ); - print "$name ($pkg->{'Version'}): ". - "deleted from database, because ". - "binaries don't exist anymore\n" - if $self->get_conf('VERBOSE'); - $self->get('Current Database')->del_package($name); - } elsif ($full && version_less( $self->get('Merge Src Version')->{$name}, $pkg->{'Version'})) { - print "$name ($pkg->{'Version'}): ". - "package is Installed but binaries are from ". - $self->get('Merge Src Version')->{$name}. "\n" - if $self->get_conf('VERBOSE'); - } - } - } - return \%pkgs; -} - -# This function looks through a Packages file and sets the state of -# packages to 'Installed' -sub parse_packages { - my $self = shift; - - my $installed; - - local($/) = ""; # read in paragraph mode - while( <> ) { - my( $name, $version, $depends, $source, $sourcev, $architecture, $provides, $binaryv, $binnmu ); - s/\s*$//m; - /^Package:\s*(\S+)$/mi and $name = $1; - /^Version:\s*(\S+)$/mi and $version = $1; - /^Depends:\s*(.*)$/mi and $depends = $1; - /^Source:\s*(\S+)(\s*\((\S+)\))?$/mi and ($source,$sourcev) = ($1, $3); - /^Architecture:\s*(\S+)$/mi and $architecture = $1; - /^Provides:\s*(.*)$/mi and $provides = $1; - - next if !$name || !$version; - next if ($self->get_conf('ARCH') ne $architecture and $architecture ne "all"); - next if (defined ($installed->{$name}) and $installed->{$name}{'Version'} ne "" and - version_lesseq( $version, $installed->{$name}{'Version'} )); - $installed->{$name}{'Version'} = $version; - $installed->{$name}{'Depends'} = $depends; - $installed->{$name}{'all'} = 1 if $architecture eq "all"; - undef $installed->{$name}{'Provider'}; - $installed->{$name}{'Source'} = $source ? $source : $name; - - if ($provides) { - foreach (split( /\s*,\s*/, $provides )) { - if (not defined ($installed->{$_})) { - $installed->{$_}{'Version'} = ""; - $installed->{$_}{'Provider'} = $name; - } - } - } - if ( $version =~ /\+b(\d+)$/ ) { - $binnmu = $1; - } - $version = $sourcev if $sourcev; - $binaryv = $version; - $binaryv =~ s/\+b\d+$//; - $installed->{$name}{'Sourcev'} = $sourcev ? $sourcev : $binaryv; - $binaryv .= "+b$binnmu" if defined($binnmu); - - next if $architecture ne $self->get_conf('ARCH'); - $name = $source if $source; - next if defined($self->get('Merge Src Version')->{$name}) and $self->get('Merge Src Version')->{$name} eq $version; - - $self->get('Merge Src Version')->{$name} = $version; - - my $pkg = $self->get('Current Database')->get_package($name); - - if (defined $pkg) { - if (isin( $pkg->{'State'}, qw(Not-For-Us)) || - (isin($pkg->{'State'}, qw(Installed)) && - version_lesseq($binaryv, $pkg->{'Installed-Version'}))) { - print "Skipping $name because State == $pkg->{'State'}\n" - if $self->get_conf('VERBOSE') >= 2; - next; - } - if ($pkg->{'Binary-NMU-Version'} ) { - my $nmuver = binNMU_version($pkg->{'Version'}, $pkg->{'Binary-NMU-Version'}); - if (version_less( $binaryv, $nmuver )) { - print "Skipping $name ($version) because have newer ". - "version ($nmuver) in db.\n" - if $self->get_conf('VERBOSE') >= 2; - next; - } - } elsif (version_less($version, $pkg->{'Version'})) { - print "Skipping $name ($version) because have newer ". - "version ($pkg->{'Version'}) in db.\n" - if $self->get_conf('VERBOSE') >= 2; - next; - } - - if (!$self->pkg_version_eq($pkg, $version) && - $pkg->{'State'} ne "Installed") { - warn "Warning: $name: newer version than expected appeared ". - "in archive ($version vs. $pkg->{'Version'})\n"; - delete $pkg->{'Builder'}; - } - - if (!isin( $pkg->{'State'}, qw(Uploaded) )) { - warn "Warning: Package $name was not in uploaded state ". - "before (but in '$pkg->{'State'}').\n"; - delete $pkg->{'Builder'}; - delete $pkg->{'Depends'}; - } - } else { - $pkg = {}; - $pkg->{'Version'} = $version; - } - - $self->change_state( $pkg, 'Installed' ); - $pkg->{'Package'} = $name; - $pkg->{'Installed-Version'} = $binaryv; - if (defined $pkg->{'PermBuildPri'}) { - $pkg->{'BuildPri'} = $pkg->{'PermBuildPri'}; - } else { - delete $pkg->{'BuildPri'}; - } - $pkg->{'Version'} = $version - if version_less( $pkg->{'Version'}, $version); - delete $pkg->{'Binary-NMU-Version'}; - delete $pkg->{'Binary-NMU-Changelog'}; - $self->log_ta( $pkg, "--merge-packages" ); - $self->get('Current Database')->set_package($pkg); - print "$name ($version) is up-to-date now.\n" if $self->get_conf('VERBOSE'); - } - - $self->check_dep_wait( "--merge-packages", $installed ); - return $installed; -} - -sub pretend_avail { - my $self = shift; - - my ($package, $name, $version, $installed); - - foreach $package (@_) { - $package =~ s,^.*/,,; # strip path - $package =~ s/\.(dsc|diff\.gz|tar\.gz|deb)$//; # strip extension - $package =~ s/_[\w\d]+\.changes$//; # strip extension - if ($package =~ /^([\w\d.+-]+)_([\w\d:.+~-]+)/) { - ($name,$version) = ($1,$2); - } - else { - warn "$package: can't extract package name and version ". - "(bad format)\n"; - next; - } - $installed->{$name}{'Version'} = $version; - } - - $self->check_dep_wait( "--pretend-avail", $installed ); -} - -sub check_dep_wait { - my $self = shift; - my $action = shift; - my $installed = shift; - - # check all packages in state Dep-Wait if dependencies are all - # available now - my $name; - foreach $name ($self->get('Current Database')->list_packages()) { - my $pkg = $self->get('Current Database')->get_package($name); - next if $pkg->{'State'} ne "Dep-Wait"; - my $deps = $pkg->{'Depends'}; - if (!$deps) { - print "$name: was in state Dep-Wait, but with empty ", - "dependencies!\n"; - goto make_needs_build; - } - my $deplist = $self->parse_deplist($deps, 0); - my $new_deplist; - my $allok = 1; - my @removed_deps; - foreach (keys %$deplist) { - if (!exists $installed->{$_} || - ($deplist->{$_}->{'Rel'} && $deplist->{$_}->{'Version'} && - !version_compare( $installed->{$_}{'Version'}, - $deplist->{$_}->{'Rel'}, - $deplist->{$_}->{'Version'}))) { - $allok = 0; - $new_deplist->{$_} = $deplist->{$_}; - } - else { - push( @removed_deps, $_ ); - } - } - if ($allok) { - make_needs_build: - $self->change_state( $pkg, 'Needs-Build' ); - $self->log_ta( $pkg, $action ); - delete $pkg->{'Builder'}; - delete $pkg->{'Depends'}; - print "$name ($pkg->{'Version'}) has all ", - "dependencies available now\n" if $self->get_conf('VERBOSE'); - $self->get('New Version')->{$name}++; - $self->get('Current Database')->set_package($pkg); - } - elsif (@removed_deps) { - $pkg->{'Depends'} = $self->build_deplist( $new_deplist ); - print "$name ($pkg->{'Version'}): some dependencies ", - "(@removed_deps) available now, but not all yet\n" - if $self->get_conf('VERBOSE'); - $self->get('Current Database')->set_package($pkg); - } - } -} - -# This function accepts quinn-diff output (either from a file named on -# the command line, or on stdin) and sets the packages named there to -# state 'Needs-Build'. -sub parse_quinn_diff { - my $self = shift; - my $partial = shift; - - my %quinn_pkgs; - my $dubious = ""; - - while( <> ) { - my $change = 0; - next if !m,^([-\w\d/]*)/ # section - ([-\w\d.+]+)_ # package name - ([\w\d:.~+-]+)\.dsc\s* # version - \[([^:]*): # priority - ([^]]+)\]\s*$,x; # rest of notes - my($section,$name,$version,$priority,$notes) = ($1, $2, $3, $4, $5); - $quinn_pkgs{$name}++; - $section ||= "unknown"; - $priority ||= "unknown"; - $priority = "unknown" if $priority eq "-"; - $priority = "standard" if ($name eq "debian-installer"); - - my $pkg = $self->get('Current Database')->get_package($name); - - # Always update section and priority. - if (defined($pkg)) { - - $pkg->{'Section'} = $section, $change++ if not defined - $pkg->{'Section'} or $section ne "unknown"; - $pkg->{'Priority'} = $priority, $change++ if not defined - $pkg->{'Priority'} or $priority ne "unknown"; - } - - if (defined($pkg) && - $pkg->{'State'} =~ /^Dep-Wait/ && - version_less( $pkg->{'Version'}, $version )) { - $self->change_state( $pkg, 'Dep-Wait' ); - $pkg->{'Version'} = $version; - delete $pkg->{'Binary-NMU-Version'}; - delete $pkg->{'Binary-NMU-Changelog'}; - $self->log_ta( $pkg, "--merge-quinn" ); - $change++; - print "$name ($version) still waiting for dependencies.\n" - if $self->get_conf('VERBOSE'); - } - elsif (defined($pkg) && - $pkg->{'State'} =~ /-Removed$/ && - version_eq($pkg->{'Version'}, $version)) { - # reinstantiate a package that has been removed earlier - # (probably due to a quinn-diff malfunction...) - my $newstate = $pkg->{'State'}; - $newstate =~ s/-Removed$//; - $self->change_state( $pkg, $newstate ); - $pkg->{'Version'} = $version; - $pkg->{'Notes'} = $notes; - $self->log_ta( $pkg, "--merge-quinn" ); - $change++; - print "$name ($version) reinstantiated to $newstate.\n" - if $self->get_conf('VERBOSE'); - } - elsif (defined($pkg) && - $pkg->{'State'} eq "Not-For-Us" && - version_less( $pkg->{'Version'}, $version )) { - # for Not-For-Us packages just update the version etc., but - # keep the state - $self->change_state( $pkg, "Not-For-Us" ); - $pkg->{'Package'} = $name; - $pkg->{'Version'} = $version; - $pkg->{'Notes'} = $notes; - delete $pkg->{'Builder'}; - $self->log_ta( $pkg, "--merge-quinn" ); - $change++; - print "$name ($version) still Not-For-Us.\n" if $self->get_conf('VERBOSE'); - } - elsif (!defined($pkg) || - $pkg->{'State'} ne "Not-For-Us" && - (version_less( $pkg->{'Version'}, $version ) || - ($pkg->{'State'} eq "Installed" && version_less($pkg->{'Installed-Version'}, $version)))) { - if (defined( $pkg->{'State'} ) && - isin($pkg->{'State'}, qw(Building Built Build-Attempted))) { - $self->send_mail( - $pkg->{'Builder'}, - "new version of $name (dist=" . $self->get_conf('DISTRIBUTION') . ")", - "As far as I'm informed, you're currently ". - "building the package $name\n". - "in version $pkg->{'Version'}.\n\n". - "Now there's a new source version $version. ". - "If you haven't finished\n". - "compiling $name yet, you can stop it to ". - "save some work.\n". - "Just to inform you...\n". - "(This is an automated message)\n"); - print "$name: new version ($version) while building ". - "$pkg->{'Version'} -- sending mail ". - "to builder ($pkg->{'Builder'})\n" - if $self->get_conf('VERBOSE'); - } - $self->change_state( $pkg, 'Needs-Build' ); - $pkg->{'Package'} = $name; - $pkg->{'Version'} = $version; - $pkg->{'Section'} = $section; - $pkg->{'Priority'} = $priority; - $pkg->{'Notes'} = $notes; - delete $pkg->{'Builder'}; - delete $pkg->{'Binary-NMU-Version'}; - delete $pkg->{'Binary-NMU-Changelog'}; - $self->log_ta( $pkg, "--merge-quinn" ); - $self->get('New Version')->{$name}++; - $change++; - print "$name ($version) needs rebuilding now.\n" if $self->get_conf('VERBOSE'); - } - elsif (defined($pkg) && - !version_eq( $pkg->{'Version'}, $version ) && - isin( $pkg->{'State'}, qw(Installed Not-For-Us) )) { - print "$name: skipping because version in db ". - "($pkg->{'Version'}) is >> than ". - "what quinn-diff says ($version) ". - "(state is $pkg->{'State'})\n" - if $self->get_conf('VERBOSE'); - $dubious .= "$pkg->{'State'}: ". - "db ${name}_$pkg->{'Version'} >> ". - "quinn $version\n" if !$partial; - } - elsif ($self->get_conf('VERBOSE') >= 2) { - if ($pkg->{'State'} eq "Not-For-Us") { - print "Skipping $name because State == ". - "$pkg->{'State'}\n"; - } - elsif (!version_less($pkg->{'Version'}, $version)) { - print "Skipping $name because version in db ". - "($pkg->{'Version'}) is >= than ". - "what quinn-diff says ($version)\n"; - } - } - $self->get('Current Database')->set_package($pkg) if $change; - } - - if ($dubious) { - $self->send_mail( - $self->get_conf('DB_MAINTAINER_EMAIL'), - "Dubious versions in " . $self->get_conf('DISTRIBUTION') . " " . - $self->get_conf('DB_BASE_NAME') . " database", - "The following packages have a newer version in the ". - "wanna-build database\n". - "than what quinn-diff says, and this is strange for ". - "their state\n". - "It could be caused by a lame mirror, or the version ". - "in the database\n". - "is wrong.\n\n". - $dubious); - } - - # Now re-check the DB for packages in states Needs-Build, Failed, - # or Dep-Wait and remove them if they're not listed anymore by quinn-diff. - if ( !$partial ) { - my $name; - foreach $name ($self->get('Current Database')->list_packages()) { - my $pkg = $self->get('Current Database')->get_package($name); - next if defined $pkg->{'Binary-NMU-Version'}; - next if !isin($pkg->{'State'}, - qw(Needs-Build Building Built - Build-Attempted Uploaded Failed - Dep-Wait)); - my $virtual_delete = $pkg->{'State'} eq 'Failed'; - - if (!$quinn_pkgs{$name}) { - $self->change_state( $pkg, $virtual_delete ? - $pkg->{'State'}."-Removed" : - 'deleted' ); - $self->log_ta( $pkg, "--merge-quinn" ); - print "$name ($pkg->{'Version'}): ". - ($virtual_delete ? "(virtually) " : "") . "deleted ". - "from database, because not in quinn-diff anymore\n" - if $self->get_conf('VERBOSE'); - if ($virtual_delete) { - $self->get('Current Database')->set_package($pkg); - } else { - $self->get('Current Database')->set_package($name); - } - } - } - } -} - -# Unused? -sub send_reupload_mail { - my $self = shift; - my $to = shift; - my $pkg = shift; - my $version = shift; - my $dist = shift; - my $other_dist = shift; - - $self->send_mail( - $to, - "Please reupload ${pkg}_${'Version'} for $dist", - "You have recently built (or are currently building)\n". - "${pkg}_${'Version'} for $other_dist.\n". - "This version is now also needed in the $dist distribution.\n". - "Please reupload the files now present in the Debian archive\n". - "(best with buildd-reupload).\n"); -} - -sub sort_list_func { - my $self = shift; - - my $sortfunc = sub { - my($letter, $x); - - foreach $letter (split( "", $self->get_conf('DB_LIST_ORDER') )) { - SWITCH: foreach ($letter) { - /P/ && do { - my $ap = $a->{'BuildPri'}; - my $bp = $b->{'BuildPri'}; - $ap = 0 if !defined($ap); - $bp = 0 if !defined($bp); - $x = $bp <=> $ap; - return $x if $x != 0; - last SWITCH; - }; - /p/ && do { - $x = $self->get('Priority Values')->{$a->{'Priority'}} <=> $self->get('Priority Values')->{$b->{'Priority'}}; - return $x if $x != 0; - last SWITCH; - }; - /s/ && do { - $self->get('Section Values')->{$a->{'Section'}} = -125 if(!$self->get('Section Values')->{$a->{'Section'}}); - $self->get('Section Values')->{$b->{'Section'}} = -125 if(!$self->get('Section Values')->{$b->{'Section'}}); - $x = $self->get('Section Values')->{$a->{'Section'}} <=> $self->get('Section Values')->{$b->{'Section'}}; - return $x if $x != 0; - last SWITCH; - }; - /n/ && do { - $x = $a->{'Package'} cmp $b->{'Package'}; - return $x if $x != 0; - last SWITCH; - }; - /b/ && do { - my $ab = $a->{'Builder'}; - my $bb = $b->{'Builder'}; - $ab = "" if !defined($ab); - $bb = "" if !defined($bb); - $x = $ab cmp $bb; - return $x if $x != 0; - last SWITCH; - }; - /c/ && do { - my $ax = 0; - my $bx = 0; - if (defined($a->{'Notes'})) { - $ax = ($a->{'Notes'} =~ /^(out-of-date|partial)/) ? 0 : - ($a->{'Notes'} =~ /^uncompiled/) ? 2 : 1; - } - if (defined($b->{'Notes'})) { - $bx = ($b->{'Notes'} =~ /^(out-of-date|partial)/) ? 0 : - ($b->{'Notes'} =~ /^uncompiled/) ? 2 : 1; - $x = $ax <=> $bx; - } - return $x if $x != 0; - last SWITCH; - }; - /f/ && do { - my $ca = exists $a->{'Failed-Category'} ? - $a->{'Failed-Category'} : "none"; - my $cb = exists $b->{'Failed-Category'} ? - $b->{'Failed-Category'} : "none"; - $x = $self->get('Category Values')->{$ca} <=> $self->get('Category Values')->{$cb}; - return $x if $x != 0; - last SWITCH; - }; - /S/ && do { - my $pa = $self->get('Priority Values')->{$a->{'Priority'}} > - $self->get('Priority Values')->{'standard'}; - my $pb = $self->get('Priority Values')->{$b->{'Priority'}} > - $self->get('Priority Values')->{'standard'}; - $x = $pa <=> $pb; - return $x if $x != 0; - last SWITCH; - }; - /a/ && do { - my $x = $self->get('Current Time') - $self->parse_date($a->{'State-Change'}) <=> - $self->get('Current Time') - $self->parse_date($b->{'State-Change'}); - return $x if $x != 0; - last SWITCH; - }; - } - } - return 0; - }; - - return $sortfunc; -} - -sub list_packages { - my $self = shift; - my $state = shift; - - my( $name, $pkg, @list ); - my $cnt = 0; - my %scnt; - my $user = $self->get_conf('DB_USER'); - - foreach $name ($self->get('Current Database')->list_packages()) { - $pkg = $self->get('Current Database')->get_package($name); - next if $state ne "all" && $pkg->{'State'} !~ /^\Q$state\E$/i; - next if $user && (lc($state) ne 'needs-build' && - defined($pkg->{'Builder'}) && - $pkg->{'Builder'} ne $self->get_conf('DB_USER')); - next if $self->get_conf('DB_CATEGORY') && $pkg->{'State'} eq "Failed" && - $pkg->{'Failed-Category'} ne $self->get_conf('DB_CATEGORY'); - next if ($self->get_conf('DB_LIST_MIN_AGE') > 0 && - ($self->get('Current Time') - $self->parse_date($pkg->{'State-Change'})) < $self->get_conf('DB_LIST_MIN_AGE'))|| - ($self->get_conf('DB_LIST_MIN_AGE') < 0 && - ($self->get('Current Time') - $self->parse_date($pkg->{'State-Change'})) > -$self->get_conf('DB_LIST_MIN_AGE')); - push( @list, $pkg ); - } - - my $sortfunc = $self->sort_list_func(); - foreach $pkg (sort $sortfunc @list) { - print "$pkg->{'Section'}/$pkg->{'Package'}_$pkg->{'Version'}"; - print ": $pkg->{'State'}" - if $state eq "all"; - print " by $pkg->{'Builder'}" - if $pkg->{'State'} ne "Needs-Build" && $pkg->{'Builder'}; - print " [$pkg->{'Priority'}:"; - print "$pkg->{'Notes'}" - if defined($pkg->{'Notes'}); - print ":PREV-FAILED" - if defined($pkg->{'Previous-State'}) && - $pkg->{'Previous-State'} =~ /^Failed/; - print ":bp{" . $pkg->{'BuildPri'} . "}" - if exists $pkg->{'BuildPri'}; - print ":binNMU{" . $pkg->{'Binary-NMU-Version'} . "}" - if exists $pkg->{'Binary-NMU-Version'}; - print "]\n"; - print " Reasons for failing:\n", - " [Category: ", - exists $pkg->{'Failed-Category'} ? $pkg->{'Failed-Category'} : "none", - "]\n ", - join("\n ",split("\n",$pkg->{'Failed'})), "\n" - if $pkg->{'State'} =~ /^Failed/; - print " Dependencies: $pkg->{'Depends'}\n" - if $pkg->{'State'} eq "Dep-Wait" && - defined $pkg->{'Depends'}; - print " Previous state was $pkg->{'Previous-State'} until ", - "$pkg->{'State-Change'}\n" - if $self->get_conf('VERBOSE') && $pkg->{'Previous-State'}; - print " Previous failing reasons:\n ", - join("\n ",split("\n",$pkg->{'Old-Failed'})), "\n" - if $self->get_conf('VERBOSE') && $pkg->{'Old-Failed'}; - ++$cnt; - $scnt{$pkg->{'State'}}++ if $state eq "all"; - } - if ($state eq "all") { - foreach (sort keys %scnt) { - print "Total $scnt{$_} package(s) in state $_.\n"; - } - } - print "Total $cnt package(s)\n"; -} - -sub info_packages { - my $self = shift; - - my( $name, $pkg, $key, $dist ); - my @firstkeys = qw(Package Version Builder State Section Priority - Installed-Version Previous-State State-Change); - my @dists = $self->get_conf('DB_INFO_ALL_DISTS') ? keys %{$self->get_conf('DB_DISTRIBUTIONS')} : ($self->get_conf('DISTRIBUTION')); - - foreach $dist (@dists) { - if ($dist ne $self->get_conf('DISTRIBUTION')) { - if (!$self->open_db($dist)) { - warn "Cannot open database for $dist!\n"; - @dists = grep { $_ ne $dist } @dists; - } - } - } - - foreach $name (@_) { - $name =~ s/_.*$//; # strip version - foreach $dist (@dists) { - $self->set('Current Database', $self->get('Databases')->{$dist}); - my $pname = "$name" . ($self->get_conf('DB_INFO_ALL_DISTS') ? "($dist)" : ""); - - $pkg = $self->get('Current Database')->get_package($name); - if (!defined( $pkg )) { - print "$pname: not registered\n"; - next; - } - - print "$pname:\n"; - foreach $key (@firstkeys) { - next if !exists $pkg->{$key}; - my $val = $pkg->{$key}; - chomp( $val ); - $val = "\n$val" if isin( $key, qw(Failed Old-Failed)); - $val =~ s/\n/\n /g; - printf " %-20s: %s\n", $key, $val; - } - foreach $key (sort keys %$pkg) { - next if isin( $key, @firstkeys ); - my $val = $pkg->{$key}; - chomp( $val ); - $val = "\n$val" if isin( $key, qw(Failed Old-Failed)); - $val =~ s/\n/\n /g; - printf " %-20s: %s\n", $key, $val; - } - } - } -} - -sub forget_packages { - my $self = shift; - - my( $name, $pkg, $key, $data ); - - foreach $name (@_) { - $name =~ s/_.*$//; # strip version - $pkg = $self->get('Current Database')->get_package($name); - if (!defined( $pkg )) { - print "$name: not registered\n"; - next; - } - - $data = ""; - foreach $key (sort keys %$pkg) { - my $val = $pkg->{$key}; - chomp( $val ); - $val =~ s/\n/\n /g; - $data .= sprintf " %-20s: %s\n", $key, $val; - } - $self->send_mail( - $self->get_conf('DB_MAINTAINER_EMAIL'), - "$name deleted from DB " . $self->get_conf('DB_BASE_NAME'), - "The package '$name' has been deleted from the database ". - "by " . $self->get_conf('DB_USER') . ".\n\n". - "Data registered about the deleted package:\n". - "$data\n") - if $self->get_conf('DB_MAINTAINER_EMAIL'); - $self->change_state( $pkg, 'deleted' ); - $self->log_ta( $pkg, "--forget" ); - $self->get('Current Database')->set_package($name); - print "$name: deleted from database\n" if $self->get_conf('VERBOSE'); - } -} - -sub forget_users { - my $self = shift; - - my( $name, $ui ); - - foreach $name (@_) { - if (!$self->get('Current Database')->del_user($name)) { - print "$name: not registered\n"; - next; - } - - print "$name: deleted from database\n" if $self->get_conf('VERBOSE'); - } -} - -sub create_maintlock { - my $self = shift; - - my $lockfile = $self->db_filename("maintenance") . ".lock"; - my $try = 0; - local( *F ); - - print "Creating maintenance lock\n" if $self->get_conf('VERBOSE') >= 2; - repeat: - if (!sysopen( F, $lockfile, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644 )){ - if ($! == EEXIST) { - # lock file exists, wait - goto repeat if !open( F, "<$lockfile" ); - my $line = ; - close( F ); - if ($line !~ /^(\d+)\s+([\w\d.-]+)$/) { - warn "Bad maintenance lock file contents -- still trying\n"; - } - else { - my($pid, $usr) = ($1, $2); - if (kill( 0, $pid ) == 0 && $! == ESRCH) { - # process doesn't exist anymore, remove stale lock - print "Removing stale lock file (pid $pid, user $usr)\n"; - unlink( $lockfile ); - goto repeat; - } - warn "Maintenance lock already exists by $usr -- ". - "please wait\n" if $try == 0; - } - if (++$try > 120) { - die "Lock still present after 120 * 60 seconds.\n"; - } - sleep 60; - goto repeat; - } - die "Can't create maintenance lock $lockfile: $!\n"; - } - F->print(getppid(), " " . $self->get_conf('USERNAME') . "\n"); - F->close(); -} - -sub remove_maintlock { - my $self = shift; - - my $lockfile = $self->db_filename("maintenance") . ".lock"; - - print "Removing maintenance lock\n" if $self->get_conf('VERBOSE') >= 2; - unlink $lockfile; -} - -sub waitfor_maintlock { - my $self = shift; - - my $lockfile = $self->db_filename("maintenance") . ".lock"; - my $try = 0; - local( *F ); - - print "Checking for maintenance lock\n" if $self->get_conf('VERBOSE') >= 2; - repeat: - if (open( F, "<$lockfile" )) { - my $line = ; - close( F ); - if ($line !~ /^(\d+)\s+([\w\d.-]+)$/) { - warn "Bad maintenance lock file contents -- still trying\n"; - } - else { - my($pid, $usr) = ($1, $2); - if (kill( 0, $pid ) == 0 && $! == ESRCH) { - # process doesn't exist anymore, remove stale lock - print "Removing stale maintenance lock (pid $pid, user $usr)\n"; - unlink( $lockfile ); - return; - } - warn "Databases locked for general maintenance by $usr -- ". - "please wait\n" if $try == 0; - } - if (++$try > 120) { - die "Lock still present after 120 * 60 seconds.\n"; - } - sleep 60; - goto repeat; - } -} - -sub change_state { - my $self = shift; - my $pkg = shift; - my $newstate = shift; - - my $state = $pkg->{'State'}; - - return if defined($state) and $state eq $newstate; - $pkg->{'Previous-State'} = $state if defined($state); - - $pkg->{'State-Change'} = $self->get('Current Date'); - - if (defined($state) and $state eq 'Failed') { - $pkg->{'Old-Failed'} = - "-"x20 . " $pkg->{'Version'} " . "-"x20 . "\n" . - $pkg->{'Failed'} . "\n" . - $pkg->{'Old-Failed'}; - delete $pkg->{'Failed'}; - delete $pkg->{'Failed-Category'}; - } - - $pkg->{'State'} = $newstate; -} - -sub open_db { - my $self = shift; - my $dist = shift; - - my $newdb = $self->get('Databases')->{$dist}; - - if (!defined($newdb)) { - if ($self->get_conf('DB_TYPE') eq 'mldbm') { - $newdb = Sbuild::DB::MLDBM->new($self->get('Config')); - } elsif ($self->get_conf('DB_TYPE') eq 'postgres') { - $newdb = Sbuild::DB::Postgres->new($self->get('Config')); - } else { - die "Unsupported database type '" . $self->get_conf('DB_TYPE') . "'\n"; - } - - $newdb->open($self->db_filename($dist)); - $newdb->lock(); - - $self->get('Databases')->{$dist} = $newdb; - } - - return $newdb; -} - -sub log_ta { - my $self = shift; - my $pkg = shift; - my $action = shift; - - my $dist = $self->get_conf('DISTRIBUTION'); - my $str; - my $prevstate = 'Unknown'; - - $prevstate = $pkg->{'Previous-State'} if defined($pkg->{'Previous-State'}); - - $str = "$action($dist): $pkg->{'Package'}_$pkg->{'Version'} ". - "changed from $prevstate to $pkg->{'State'} ". - "by " . $self->get_conf('USERNAME'). " as " . $self->get_conf('DB_USER') . "."; - - my $transactlog = $self->get_conf('DB_BASE_DIR') . "/$dist-" . - $self->get_conf('DB_TRANSACTION_LOG'); - if (!open( LOG, ">>$transactlog" )) { - warn "Can't open log file $transactlog: $!\n"; - return; - } - print LOG $self->get('Current Date') . ": $str\n"; - close( LOG ); - - if (!($prevstate eq 'Failed' && $pkg->{'State'} eq 'Failed')) { - $str .= " (with --override)" - if $self->get_conf('DB_OVERRIDE'); - $self->set('Mail Logs', - $self->get('Mail Logs') . "$str\n"); - } -} - -# Unused? -sub dist_cmp { - my $self = shift; - my $d1 = shift; - my $d2 = shift; - - my $dist_order = $self->get_conf('DB_DISTRIBUTIONS'); - - return $dist_order->{$d1}->{'priority'} <=> $dist_order->{$d2}->{'priority'}; -} - -sub send_mail { - my $self = shift; - my $to = shift; - my $subject = shift; - my $text = shift; - - my $from = $self->get_conf('DB_MAINTAINER_EMAIL'); - my $domain = $self->get_conf('DB_MAIL_DOMAIN'); - - if (defined($domain)) { - $from .= "\@$domain" if $from !~ /\@/; - $to .= '@$domain' if $to !~ /\@/; - } else { - $from .= "\@" . $self->get_conf('HOSTNAME') if $from !~ /\@/; - $to .= '@' . $self->get_conf('HOSTNAME') if $to !~ /\@/; - } - - $text =~ s/^\.$/../mg; - local $SIG{'PIPE'} = 'IGNORE'; - open( PIPE, "| " . $self->get_conf('MAILPROG') . " -oem $to" ) - or die "Can't open pipe to " . $self->get_conf('MAILPROG') . ": $!\n"; - chomp $text; - print PIPE "From: $from\n"; - print PIPE "Subject: $subject\n\n"; - print PIPE "$text\n"; - close( PIPE ); -} - -sub db_filename { - my $self = shift; - my $dist = shift; - - return $self->get_conf('DB_BASE_DIR') . '/' . $self->get_conf('DB_BASE_NAME') . "-$dist"; -} - -# for parsing input to dep-wait -sub parse_deplist { - my $self = shift; - my $deps = shift; - my $verify = shift; - my %result; - - foreach (split( /\s*,\s*/, $deps )) { - if ($verify) { - # verification requires > starting prompts, no | crap - if (!/^(\S+)\s*(\(\s*(>(?:[>=])?)\s*(\S+)\s*\))?\s*$/) { - return 0; - } - next; - } - my @alts = split( /\s*\|\s*/, $_ ); - # Anything with an | is ignored, as it can be configured on a - # per-buildd basis what will be installed - next if $#alts != 0; - $_ = shift @alts; - - if (!/^(\S+)\s*(\(\s*(>=|=|==|>|>>|<<|<=)\s*(\S+)\s*\))?\s*$/) { - warn( "parse_deplist: bad dependency $_\n" ); - next; - } - my($dep, $rel, $relv) = ($1, $3, $4); - $rel = ">>" if defined($rel) and $rel eq ">"; - $result{$dep}->{'Package'} = $dep; - if ($rel && $relv) { - $result{$dep}->{'Rel'} = $rel; - $result{$dep}->{'Version'} = $relv; - } - } - return 1 if $verify; - return \%result; -} - -# for parsing Build-Depends from Sources -sub parse_srcdeplist { - my $self = shift; - my $pkg = shift; - my $deps = shift; - my $arch = shift; - - my $dep; - my @results; - - foreach $dep (split( /\s*,\s*/, $deps )) { - my @alts = split( /\s*\|\s*/, $dep ); - # Anything with an | is ignored, as it can be configured on a - # per-buildd basis what will be installed - next if $#alts != 0; - $_ = shift @alts; - if (!/^([^\s([]+)\s*(\(\s*([<=>]+)\s*(\S+)\s*\))?(\s*\[([^]]+)\])?/) { - warn( "parse_srcdeplist: bad dependency $_\n" ); - next; - } - my($dep, $rel, $relv, $archlist) = ($1, $3, $4, $6); - if ($archlist) { - $archlist =~ s/^\s*(.*)\s*$/$1/; - my @archs = split( /\s+/, $archlist ); - my ($use_it, $ignore_it, $include) = (0, 0, 0); - foreach (@archs) { - # Use 'dpkg-architecture' to support architecture - # wildcards. - if (/^!/) { - $ignore_it = 1 if Dpkg::Arch::debarch_is($arch, substr($_, 1)); - } else { - $use_it = 1 if Dpkg::Arch::debarch_is($arch, $_); - $include = 1; - } - } - warn "Warning: inconsistent arch restriction on ", - "$pkg: $dep depedency\n" - if $ignore_it && $use_it; - next if $ignore_it || ($include && !$use_it); - } - my $neg = 0; - if ($dep =~ /^!/) { - $dep =~ s/^!\s*//; - $neg = 1; - } - my $result; - $result->{'Package'} = $dep; - $result->{'Neg'} = $neg; - if ($rel && $relv) { - $result->{'Rel'} = $rel; - $result->{'Version'} = $relv; - } - push @results, $result; - - } - return \@results; -} - -sub build_deplist { - my $self = shift; - my $list = shift; - - my($key, $result); - - foreach $key (keys %$list) { - $result .= ", " if $result; - $result .= $key; - $result .= " ($list->{$key}->{'Rel'} $list->{$key}->{'Version'})" - if $list->{$key}->{'Rel'} && $list->{$key}->{'Version'}; - } - return $result; -} - -sub get_unsatisfied_dep { - my $self = shift; - my $bd = shift; - my $pkgs = shift; - my $dep = shift; - my $savedep = shift; - - my $pkgname = $dep->{'Package'}; - - if (defined $pkgs->{$pkgname}{'Provider'}) { - # provides. leave them for buildd/sbuild. - return ""; - } - - # check cache - return $pkgs->{$pkgname}{'Unsatisfied'} if $savedep and defined($pkgs->{$pkgname}{'Unsatisfied'}); - - # Return unsatisfied deps to a higher caller to process - if ((!defined($pkgs->{$pkgname})) or - (defined($dep->{'Rel'}) and !version_compare( $pkgs->{$pkgname}{'Version'}, $dep->{'Rel'}, $dep->{'Version'} ) ) ) { - my %deplist; - $deplist{$pkgname} = $dep; - my $deps = $self->build_deplist(\%deplist); - $pkgs->{$pkgname}{'Unsatisfied'} = $deps if $savedep; - return $deps; - } - - # set cache to "" to avoid infinite recursion - $pkgs->{$pkgname}{'Unsatisfied'} = "" if $savedep; - - if (defined $pkgs->{$dep->{'Package'}}{'Depends'}) { - my $deps = $self->parse_deplist( $pkgs->{$dep->{'Package'}}{'Depends'} ); - foreach (keys %$deps) { - $dep = $$deps{$_}; - # recur on dep. - my $ret = $self->get_unsatisfied_dep($bd,$pkgs,$dep,1); - if ($ret ne "") { - my $retdep = $self->parse_deplist( $ret ); - foreach (keys %$retdep) { - $dep = $$retdep{$_}; - - $dep->{'Rel'} = '>=' if defined($dep->{'Rel'}) and $dep->{'Rel'} =~ '^='; - - if (defined($dep->{'Rel'}) and $dep->{'Rel'} =~ '^>' and defined ($pkgs->{$dep->{'Package'}}) and - version_compare($bd->{$pkgs->{$dep->{'Package'}}{'Source'}}{'ver'},'>>',$pkgs->{$dep->{'Package'}}{'Sourcev'})) { - if (not defined($self->get('Merge Bin Src')->{$dep->{'Package'}})) { - # the uninstallable package doesn't exist in the new source; look for something else that does. - delete $$retdep{$dep->{'Package'}}; - foreach (sort (split( /\s*,\s*/, $bd->{$pkgs->{$dep->{'Package'}}{'Source'}}{'bin'}))) { - next if ($pkgs->{$_}{'all'} or not defined $pkgs->{$_}{'Version'}); - $dep->{'Package'} = $_; - $dep->{'Rel'} = '>>'; - $dep->{'Version'} = $pkgs->{$_}{'Version'}; - $$retdep{$_} = $dep; - last; - } - } - } else { - # sanity check to make sure the depending binary still exists, and the depended binary exists and dep-wait on a new version of it - if ( defined($self->get('Merge Bin Src')->{$pkgname}) and defined($pkgs->{$dep->{'Package'}}{'Version'}) ) { - delete $$retdep{$dep->{'Package'}}; - $dep->{'Package'} = $pkgname; - $dep->{'Rel'} = '>>'; - $dep->{'Version'} = $pkgs->{$pkgname}{'Version'}; - $$retdep{$pkgname} = $dep; - } - delete $$retdep{$dep->{'Package'}} if (defined ($dep->{'Rel'}) and $dep->{'Rel'} =~ '^>'); - } - } - $ret = $self->build_deplist($retdep); - $pkgs->{$pkgname}{'Unsatisfied'} = $ret if $savedep; - return $ret; - } - } - } - return ""; -} - -sub auto_dep_wait { - my $self = shift; - my $bd = shift; - my $pkgs = shift; - my $key; - - my $distribution = $self->get_conf('DISTRIBUTION'); - - return if (defined ($self->get_conf('DB_DISTRIBUTIONS')->{'$distribution'}) && - defined ($self->get_conf('DB_DISTRIBUTIONS')->{'$distribution'}->{'noadw'})); - - # We need to walk all of needs-build, as any new upload could make - # something in needs-build have uninstallable deps - foreach $key ($self->get('Current Database')->list_packages()) { - my $pkg = $self->get('Current Database')->get_package($key); - next - if not defined $pkg or $pkg->{'State'} ne "Needs-Build"; - my $srcdeps = $self->parse_srcdeplist($key,$bd->{$key}{'dep'}, - $self->get_conf('ARCH')); - foreach my $srcdep (@$srcdeps) { - next if $srcdep->{'Neg'} != 0; # we ignore conflicts atm - my $rc = $self->get_unsatisfied_dep($bd,$pkgs,$srcdep,0); - if ($rc ne "") { - # set dep-wait - my $deplist = $self->parse_deplist( $pkg->{'Depends'} ); - my $newdeps = $self->parse_deplist( $rc ); - my $change = 0; - foreach (%$newdeps) { - my $dep = $$newdeps{$_}; - # ensure we're not waiting on ourselves, or a package that has been removed - next if (not defined($self->get('Merge Bin Src')->{$dep->{'Package'}})) or ($self->get('Merge Bin Src')->{$dep->{'Package'}} eq $key); - if ($dep->{'Rel'} =~ '^>') { - $deplist->{$dep->{'Package'}} = $dep; - $change++; - } - } - if ($change) { - $pkg->{'Depends'} = $self->build_deplist($deplist); - $self->change_state( $pkg, 'Dep-Wait' ); - $self->log_ta( $pkg, "--merge-all" ); - $self->get('Current Database')->set_package($pkg); - print "Auto-Dep-Waiting ${key}_$pkg->{'Version'} to $pkg->{'Depends'}\n" if $self->get_conf('VERBOSE'); - } - last; - } - } - } -} - -sub pkg_version_eq { - my $self = shift; - my $pkg = shift; - my $version = shift; - - return 1 - if (defined $pkg->{'Binary-NMU-Version'}) and - version_compare(binNMU_version($pkg->{'Version'}, - $pkg->{'Binary-NMU-Version'}),'=', $version); - return version_compare( $pkg->{'Version'}, "=", $version ); -} - -1; diff -Nru sbuild-0.60.9/lib/WannaBuild/Mail.pm sbuild-0.62.2/lib/WannaBuild/Mail.pm --- sbuild-0.60.9/lib/WannaBuild/Mail.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/WannaBuild/Mail.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,431 +0,0 @@ -# wanna-build-mail: mail interface to wanna-build -# Copyright © 1998 Roman Hodek -# Copyright © 2009 Roger Leigh -# -# 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 WannaBuild::Mail; - -use strict; -use warnings; -use English; - -use Sbuild::Sysconfig; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter Sbuild::Base); - - @EXPORT = qw(); -} - -sub new { - my $class = shift; - my $conf = shift; - - my $self = $class->SUPER::new($conf); - bless($self, $class); - - return $self; -} - -# TODO: Convert to use WannaBuild::Conf and Sbuild::Sysconfig - -sub run { - my $self = shift; - - $main::tempfile = "/bin/tempfile"; - $main::wanna_build = -f "/usr/local/bin/wanna-build" ? - "/usr/local/bin/wanna-build" : "/usr/bin/wanna-build"; - $main::pgp = "/usr/bin/pgp"; - $main::gpg = "/usr/bin/gpg"; - $main::sendmail = "/usr/sbin/sendmail"; - $main::libdir = "/var/lib/wanna-build"; - $main::pgp_keyring = "$main::libdir/mail-keyring.pgp"; - $main::gpg_keyring = "$main::libdir/mail-keyring.gpg"; - $main::userdb = "$main::libdir/mail-users"; - $main::logfile = "$main::libdir/mail-processor.log"; - chomp( $main::date = `/bin/date '+%Y %b %d %H:%M:%S'` ); - -# TODO: Use File::Temp - my $tmpf = `$main::tempfile -p .wanna-build-mail -m 600`; - chomp( $tmpf ); - $tmpf =~ /^(.*)$/; $tmpf = $1; # untaint - open( F, ">$tmpf" ) or $self->fatal( "Can't create temp file $tmpf: $!" ); - - my $in_headers = 1; - my $lastheader = ""; - while( <> ) { - print F; - chomp; - next if !$in_headers; - if (/^$/) { - $in_headers = 0; - next; - } - elsif (/^\s/ && $lastheader) { - s/^\s+//; - $_ = "$lastheader $_"; - } - if (/^From:\s*/i) { - $main::from_addr = $POSTMATCH; - chomp( $lastheader = $_ ); - } - elsif (/^Reply-To:\s*/i) { - $main::reply_to = $POSTMATCH; - chomp( $lastheader = $_ ); - } - elsif (/^Subject:\s*/i) { - $main::subject = $POSTMATCH; - chomp( $lastheader = $_ ); - } - elsif (/^Message-Id:\s*/i) { - $main::msgid = $POSTMATCH; - chomp( $lastheader = $_ ); - } - else { - $lastheader = ""; - } - } - close( F ); - $main::reply_addr = $main::reply_to || $main::from_addr; - $self->fatal( "No reply address known!" ) if !$main::reply_addr; - $self->logger( "Mail from $main::reply_addr" ); - - my $signator; - $self->fatal( "Your message cannot be processed because it is not ". - "signed with PGP." ) - if !($signator = $self->pgp_check( $tmpf )); - - $self->read_users(); - $self->fatal( "The signator of this message\n($signator)\n". - "is not authorized to use this mail interface." ) - if !exists $main::users{$signator}; - $main::user = $main::users{$signator}; - - - my $in_sig = 0; - my $reply = ""; - my $n_depwait = 0; - my $nn_depwait = 0; - my $n_failed = 0; - my $nn_failed = 0; - my( @wanna_args, @uploaded_args, @giveback_args, @depwait_args, - @depwait_deps, @failed_args, @failed_msg, @info_args, @list_args, - @vlist_args ); - open( F, "<$tmpf" ) or $self->fatal( "Can't open $tmpf: $!" ); - while( && !/^$/ ) {} # skip headers - while( ) { - repeat_outer: - $in_sig = 1, next if /^---+\s*BEGIN PGP SIGNATURE/; - $in_sig = 0, next if /^---+\s*END PGP SIGNATURE/; - next if $in_sig || /^\s*$/ || /^---/; - next if !/^([\w]+)\s+(.*)\s*$/; - my( $command, $args ) = ($1, $2); - if ($command =~ /^w/) { - push( @wanna_args, split( /\s+/, $args )); - } - elsif ($command =~ /^u/) { - push( @uploaded_args, split( /\s+/, $args )); - } - elsif ($command =~ /^g/) { - push( @giveback_args, split( /\s+/, $args )); - } - elsif ($command =~ /^f/) { - push( @{$failed_args[$n_failed]}, split( /\s+/, $args )); - while( ) { - last if !/^\s+/; - my $text = $POSTMATCH; - chomp( $text ); - $text =~ s/'/'\\''/g; - $failed_msg[$n_failed] .= "$text\n"; - } - if (!$failed_msg[$n_failed]) { - $reply .= "Error on command \"$command $args\": ". - "no failure message specified\n"; - } - else { - chop( $failed_msg[$n_failed] ); - ++$n_failed; - } - goto repeat_outer; - } - elsif ($command =~ /^d/) { - push( @{$depwait_args[$n_depwait]}, split( /\s+/, $args )); - my $deps = ; - if ($deps !~ /^\s/) { - $reply .= "Error on command \"$command $args\": ". - "no dependency line specified\n"; - $_ = $deps; - goto repeat_outer; - } - chomp( $deps ); - $deps =~ s/^\s+//; - $deps =~ s/\s+$//; - $depwait_deps[$n_depwait] = $deps; - ++$n_depwait; - } - elsif ($command =~ /^i/) { - push( @info_args, split( /\s+/, $args )); - } - elsif ($command =~ /^l/) { - push( @list_args, split( /\s+/, $args )); - } - elsif ($command =~ /^v/) { - push( @vlist_args, split( /\s+/, $args )); - } - else { - $reply .= "Unknown command: \"$command\"\n"; - } - } - close( F ); - - if (@wanna_args) { - $reply .= "\nRunning wanna-build:\n"; - $self->logger( "take @wanna_args" ); - $reply .= `$main::wanna_build -U $main::user -v --take @wanna_args 2>&1`; - } - if (@uploaded_args) { - $reply .= "\nRunning uploaded-build:\n"; - $self->logger( "uploaded @uploaded_args" ); - $reply .= `$main::wanna_build -U $main::user -v --uploaded @uploaded_args 2>&1`; - } - if (@giveback_args) { - $reply .= "\nRunning give-back-build:\n"; - $self->logger( "giveback @uploaded_args" ); - $reply .= `$main::wanna_build -U $main::user -v --give-back @giveback_args 2>&1`; - } - if ($n_failed > 0) { - my $i; - $reply .= "\nRunning failed-build (may be different messages):\n"; - for( $i = 0; $i < $n_failed; ++$i ) { - $self->logger( "failed @{$failed_args[$i]}" ); - $reply .= `$main::wanna_build -U $main::user -v --failed -m'$failed_msg[$i]' @{$failed_args[$i]} 2>&1`; - $nn_failed += @{$failed_args[$i]}; - } - } - if ($n_depwait > 0) { - my $i; - $reply .= "\nRunning dep-wait-build (may be different dependencies):\n"; - for( $i = 0; $i < $n_depwait; ++$i ) { - $self->logger( "dep-wait @{$depwait_args[$i]} ($depwait_deps[$i])" ); - $reply .= `$main::wanna_build -U $main::user -v --dep-wait -m'$depwait_deps[$i]' @{$depwait_args[$i]} 2>&1`; - $nn_depwait += @{$depwait_args[$i]}; - } - } - if (@info_args) { - $reply .= "\nRunning build-info:\n"; - $self->logger( "info @info_args" ); - $reply .= `$main::wanna_build -v --info @info_args 2>&1`; - } - $self->logger( "list @list_args" ) if @list_args; - foreach (@list_args) { - $reply .= "\nRunning list-$_:\n"; - $reply .= `$main::wanna_build --list=$_ 2>&1`; - } - $self->logger( "vlist @vlist_args" ) if @vlist_args; - foreach (@vlist_args) { - $reply .= "\nRunning list-$_ -v:\n"; - $reply .= `$main::wanna_build -v --list=$_ 2>&1`; - } - - $reply = "No commands, nothing done.\n" if !$reply; - $reply =~ s/^wanna-build Revision:.*\n//mg; - $self->reply( $reply ); - - $self->logger( "Processed: ", - scalar(@wanna_args), " taken, ", - scalar(@uploaded_args), " upl, ", - scalar(@giveback_args), " giveb, ", - $nn_depwait, " dwait, ", - $nn_failed, " failed, ", - scalar(@info_args), " infos, ", - scalar(@list_args)+scalar(@vlist_args), " lists" ); - - return 0; - } - -sub read_users { - my $self = shift; - - local( *F ); - - open( F, "<$main::userdb" ) - or $self->fatal( "Cannot open $main::userdb: $!" ); - while( ) { - next if !/^([\w\d]+)\s+(.+)\s*/; - $main::users{$2} = $1; - } - close( F ); -} - -sub pgp_check { - my $self = shift; - my $file = shift; - - my $output = ""; - my $signator; - my $is_tmpfile = 0; - my $found = 0; - my $stat; - local( *PIPE ); - - $self->fatal( "No keyring (PGP or GnuPG) exists!" ) - if ! -f $main::pgp_keyring && ! -f $main::gpg_keyring; - - if ($main::content_type && - $main::content_type =~ m,multipart/signed, && - $main::content_type =~ /pgp/i && - (my ($bound) = ($main::content_type =~ /boundary=(\S+);/i))) { - my $file2 = "$file.pgptmp"; - local( *F, *F2 ); - if (!open( F, "<$file" )) { - $self->fatal( "Can't open $file: $!" ); - return "LOCAL ERROR"; - } - if (!open( F2, ">$file2" )) { - $self->fatal( "Can't open $file2: $!" ); - return "LOCAL ERROR"; - } - my $state = 0; - while( ) { - if (/^--\Q$bound\E(--)?$/) { - if ($state == 0) { - print F2 "-----BEGIN PGP SIGNED MESSAGE-----\n\n"; - $state = 1; - next; - } - elsif ($state == 1) { - while( ($_ = ) !~ /^---+BEGIN PGP SIGNATURE---+$/ ) {} - $state = 2; - } - elsif ($state == 2) { - next; - } - } - print F2; - } - close( F2 ); - close( F ); - $file = $file2; - $is_tmpfile = 1; - } - - $stat = 1; - if (-x $main::pgp && -f $main::pgp_keyring) { - if (!open( PIPE, "$main::pgp -f +batchmode +verbose=0 ". - "+pubring=$main::pgp_keyring <'$file' 2>&1 >/dev/null |" )) { - $self->fatal( "Can't open pipe to $main::pgp: $!" ); - unlink( $file ) if $is_tmpfile; - return "LOCAL ERROR"; - } - $output .= $_ while( ); - close( PIPE ); - $stat = $?; - $found = 1 if !$stat || $output =~ /^(good|bad) signature from/im - } - - if (!$found && -x $main::gpg && -f $main::gpg_keyring) { - if (!open( PIPE, "$main::gpg --no-options --batch ". - "--no-default-keyring --keyring $main::gpg_keyring ". - " --verify '$file' 2>&1 |" )) { - $self->fatal( "Can't open pipe to $main::gpg: $!" ); - unlink( $file ) if $is_tmpfile; - return "LOCAL ERROR"; - } - $output .= $_ while( ); - close( PIPE ); - $stat = $?; - } - - unlink( $file ) if $is_tmpfile; - return "" if $stat; - $output =~ /^(gpg: )?good signature from (user )?"(.*)"\.?$/im; - ($signator = $3) ||= "unknown signator"; - return $signator; -} - - -sub reply { - my $self = shift; - my $subject; - - if (!$main::reply_addr) { - $self->logger( "no reply address set" ); - return; - } - - $main::no_reply = 1; - if (!open( MAIL, "|$main::sendmail -t -oem" )) { - $self->fatal( "Could not open pipe to $main::sendmail: $!" ); - goto out; - } - - $subject = $main::subject ? "Re: $main::subject" : "Re: your request"; - print MAIL <<"EOF"; -From: wanna-build mail processor -To: $main::reply_addr -Subject: $subject -EOF -print MAIL "In-Reply-To: $main::msgid\n" if $main::msgid; - print MAIL "\n"; - - print MAIL @_; - print MAIL "\nGreetings,\n\n\tYour wanna-build mail processor\n"; - if (!close( MAIL )) { - $self->fatal( "$main::sendmail failed (exit status ", $? >> 8, ")\n" ); - goto out; - } - - out: - $main::no_reply = 0; -} - - -sub fatal { - my $self = shift; - - $self->logger( @_ ); - if ($main::reply_addr && !$main::no_reply) { - $self->reply( "FATAL ERROR: ", @_, "\n" ); - exit 1; - } - else { - die "wanna-build-mail: FATAL ERROR: ", @_, "\n"; - } -} - -sub logger { - my $self = shift; - - local( *F ); - my( $str, @lines ); - - open( F, ">>$main::logfile" ) or return; - foreach (@_) { - $str .= $_; - } - @lines = split( "\n", $str ); - foreach (@lines) { - print F "$main::date: ", $_, "\n"; - } - close( F ); -} - -1; diff -Nru sbuild-0.60.9/lib/WannaBuild/Makefile.am sbuild-0.62.2/lib/WannaBuild/Makefile.am --- sbuild-0.60.9/lib/WannaBuild/Makefile.am 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/WannaBuild/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -# sbuild Makefile template -# -# -# Copyright © 2004-2009 Roger Leigh -# -# sbuild 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 3 of the License, or -# (at your option) any later version. -# -# sbuild 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 -# . -# -##################################################################### - -include $(top_srcdir)/scripts/global.mk - -perlmodwannabuilddir = $(perlmoddir)/WannaBuild - -MODULES = \ - Conf.pm \ - Database.pm \ - Mail.pm \ - Options.pm - -perlmodwannabuild_DATA = \ - $(MODULES) - -EXTRA_DIST = \ - $(MODULES) diff -Nru sbuild-0.60.9/lib/WannaBuild/Makefile.in sbuild-0.62.2/lib/WannaBuild/Makefile.in --- sbuild-0.60.9/lib/WannaBuild/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/lib/WannaBuild/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,439 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# sbuild Makefile template -# -# -# Copyright © 2004-2009 Roger Leigh -# -# sbuild 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 3 of the License, or -# (at your option) any later version. -# -# sbuild 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 -# . -# -##################################################################### - -# sbuild Makefile template -# -# -# Copyright © 2004-2007 Roger Leigh -# -# sbuild 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 3 of the License, or -# (at your option) any later version. -# -# sbuild 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 -# . -# -##################################################################### - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/scripts/global.mk -subdir = lib/WannaBuild -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(perlmodwannabuilddir)" -DATA = $(perlmodwannabuild_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BUILDD_CONF = @BUILDD_CONF@ -BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL_MODULE_DIR = @PERL_MODULE_DIR@ -PLATFORM = @PLATFORM@ -RELEASE_DATE = @RELEASE_DATE@ -SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ -SBUILD_COMPAT = @SBUILD_COMPAT@ -SBUILD_CONF = @SBUILD_CONF@ -SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ -SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ -SCHROOT_CONF = @SCHROOT_CONF@ -SCHROOT_SYSCONF_DIR = @SCHROOT_SYSCONF_DIR@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -am__leading_dot = @am__leading_dot@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# Global options for use in all Makefiles. -perlmoddir = $(PERL_MODULE_DIR) -perlmodwannabuilddir = $(perlmoddir)/WannaBuild -MODULES = \ - Conf.pm \ - Database.pm \ - Mail.pm \ - Options.pm - -perlmodwannabuild_DATA = \ - $(MODULES) - -EXTRA_DIST = \ - $(MODULES) - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/WannaBuild/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu lib/WannaBuild/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-perlmodwannabuildDATA: $(perlmodwannabuild_DATA) - @$(NORMAL_INSTALL) - test -z "$(perlmodwannabuilddir)" || $(MKDIR_P) "$(DESTDIR)$(perlmodwannabuilddir)" - @list='$(perlmodwannabuild_DATA)'; test -n "$(perlmodwannabuilddir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(perlmodwannabuilddir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(perlmodwannabuilddir)" || exit $$?; \ - done - -uninstall-perlmodwannabuildDATA: - @$(NORMAL_UNINSTALL) - @list='$(perlmodwannabuild_DATA)'; test -n "$(perlmodwannabuilddir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(perlmodwannabuilddir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(perlmodwannabuilddir)" && rm -f $$files -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(perlmodwannabuilddir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-perlmodwannabuildDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-perlmodwannabuildDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-perlmodwannabuildDATA \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am uninstall uninstall-am \ - uninstall-perlmodwannabuildDATA - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru sbuild-0.60.9/lib/WannaBuild/Options.pm sbuild-0.62.2/lib/WannaBuild/Options.pm --- sbuild-0.60.9/lib/WannaBuild/Options.pm 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/lib/WannaBuild/Options.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,219 +0,0 @@ -# -# Options.pm: options parser for wanna-build -# Copyright © 2005 Ryan Murray -# Copyright © 2005-2009 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 WannaBuild::Options; - -use strict; -use warnings; - -use Getopt::Long qw(:config no_ignore_case auto_abbrev gnu_getopt); -use Sbuild qw(isin help_text version_text usage_error); -use Sbuild::Base; -use Sbuild::OptionsBase; -use Sbuild::DB::Info; - -BEGIN { - use Exporter (); - our (@ISA, @EXPORT); - - @ISA = qw(Exporter Sbuild::OptionsBase); - - @EXPORT = qw(); -} - -sub set_options { - my $self = shift; - - $self->add_options ( - "d|dist=s" => sub { - $self->set_conf('DISTRIBUTION', $_[1]); - $self->set_conf('DISTRIBUTION', "oldstable") - if $self->get_conf('DISTRIBUTION') eq "o"; - $self->set_conf('DISTRIBUTION', "stable") - if $self->get_conf('DISTRIBUTION') eq "s"; - $self->set_conf('DISTRIBUTION', "testing") - if $self->get_conf('DISTRIBUTION') eq "t"; - $self->set_conf('DISTRIBUTION', "unstable") - if $self->get_conf('DISTRIBUTION') eq "u"; - $self->set_conf('DISTRIBUTION', "experimental") - if $self->get_conf('DISTRIBUTION') eq "e"; - $self->set_conf('OVERRIDE_DISTRIBUTION', 1); - - # TODO: Get entire list from database, and - # remove DB_INFO_ALL_DISTS. - if ($self->get_conf('DISTRIBUTION') eq "a" || - $self->get_conf('DISTRIBUTION') eq "all") { - $self->set_conf('DB_INFO_ALL_DISTS', 1); - $self->set_conf('DISTRIBUTION', "") - } - }, - - "o|override" => sub { - $self->set_conf('DB_OVERRIDE', 1); - }, - "create-db" => sub { - $self->set_conf('DB_CREATE', 1); - }, - # TODO: Remove opt_ prefix... - "correct-compare" => \$Sbuild::opt_correct_version_cmp, - # normal actions - "take" => sub { - $self->set_conf('DB_OPERATION', 'set-building'); - }, - "f|failed" => sub { - $self->set_conf('DB_OPERATION', 'set-failed'); - }, - "u|uploaded" => sub { - $self->set_conf('DB_OPERATION', 'set-uploaded'); - }, - "n|no-build" => sub { - $self->set_conf('DB_OPERATION', 'set-not-for-us'); - }, - "built" => sub { - $self->set_conf('DB_OPERATION', 'set-built'); - }, - "attempted" => sub { - $self->set_conf('DB_OPERATION', 'set-attempted'); - }, - "give-back" => sub { - $self->set_conf('DB_OPERATION', 'set-needs-build'); - }, - "dep-wait" => sub { - $self->set_conf('DB_OPERATION', 'set-dep-wait'); - }, - "forget" => sub { - $self->set_conf('DB_OPERATION', 'forget'); - }, - "forget-user" => sub { - $self->set_conf('DB_OPERATION', 'forget-user'); - }, - "merge-all" => sub { - $self->set_conf('DB_OPERATION', 'merge-all'); - }, - "merge-quinn" => sub { - $self->set_conf('DB_OPERATION', 'merge-quinn'); - }, - "merge-partial-quinn" => sub { - $self->set_conf('DB_OPERATION', - 'merge-partial-quinn'); - }, - "merge-packages" => sub { - $self->set_conf('DB_OPERATION', 'merge-packages'); - }, - "merge-sources" => sub { - $self->set_conf('DB_OPERATION', 'merge-sources'); - }, - "p|pretend-avail" => sub { - $self->set_conf('DB_OPERATION', 'pretend-avail'); - }, - "i|info" => sub { - $self->set_conf('DB_OPERATION', 'info'); - }, - - # TODO: Move checks to Conf.pm. - "binNMU=s" => sub { - die "Invalid binNMU version: $_[1]\n" - if $_[1] !~ /^([\d]*)$/ and $1 >= 0; - $self->set_conf('DB_OPERATION', 'set-binary-nmu'); - $self->set_conf('DB_BIN_NMU_VERSION', $_[1]); - }, - "perm-build-priority=s" => sub { - die "Invalid build priority: $_[1]\n" - if $_[1] !~ /^-?[\d]+$/; - $self->set_conf('DB_OPERATION', 'set-permanent-build-priority'); - $self->set_conf('DB_BUILD_PRIORITY', $_[1]); - }, - "build-priority=s" => sub { - die "Invalid build priority: $_[1]\n" - if $_[1] !~ /^-?[\d]+$/; - $self->set_conf('DB_OPERATION', 'set-build-priority'); - $self->set_conf('DB_BUILD_PRIORITY', $_[1]); - }, - "l|list=s" => sub { - die "Unknown state to list: $_[1]\n" - if !isin( $_[1], qw(needs-build building uploaded - built build-attempted failed - installed dep-wait not-for-us all - failed-removed install-wait - reupload-wait)); - $self->set_conf('DB_OPERATION', 'list'); - $self->set_conf('DB_LIST_STATE', $_[1]); - }, - "O|order=s" => sub { - die "Bad ordering character\n" - if $_[1] !~ /^[PSpsncb]+$/; - $self->set_conf('DB_LIST_ORDER', $_[1]); - }, - "m|message=s" => sub { - $self->set_conf('DB_FAIL_REASON', $_[1]); - }, - "b|database=s" => sub { - $self->set_conf('DB_BASE_NAME', $_[1]); - }, - "A|arch=s" => sub { - $self->set_conf('ARCH', $_[1]); - }, - "U|user=s" => sub { - $self->set_conf('DB_USER', $_[1]); - }, - "c|category=s" => sub { - my $category = category($_[1]); - die "Unknown category: $_[1]\n" - if !defined($category); - $self->set_conf('DB_CATEGORY', $category); - }, - "a|min-age=i" => sub { - die "Minimum age must be a non-zero number\n" - if $_[1] == 0; - $self->set_conf('DB_LIST_MIN_AGE', $_[1] * 24*60*60); - }, - "max-age=i" => sub { - die "Maximum age must be a non-zero number\n" - if $_[1] == 0; - # NOTE: Negative value - $self->set_conf('DB_LIST_MIN_AGE', - $_[1] * 24*60*60); - }, - # special actions - "import=s" => sub { - $self->set_conf('DB_OPERATION', 'import'); - $self->set_conf('DB_IMPORT_FILE', $_[1]); - }, - "export=s" => sub { - $self->set_conf('DB_OPERATION', 'export'); - $self->set_conf('DB_EXPORT_FILE', $_[1]); - }, - "manual-edit" => sub { - $self->set_conf('DB_OPERATION', 'manual-edit'); - }, - "create-maintenance-lock" => sub { - $self->set_conf('DB_OPERATION', 'maintlock-create'); - }, - "remove-maintenance-lock" => sub { - $self->set_conf('DB_OPERATION', 'maintlock-remove'); - }, - "clean-db" => sub { - $self->set_conf('DB_OPERATION', 'clean-db'); - }, - ); -} - -1; diff -Nru sbuild-0.60.9/Makefile.am sbuild-0.62.2/Makefile.am --- sbuild-0.60.9/Makefile.am 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/Makefile.am 2011-04-04 17:43:53.000000000 +0000 @@ -21,7 +21,7 @@ include $(top_srcdir)/scripts/global.mk -SUBDIRS = bin configs etc lib man db test +SUBDIRS = bin wrapper tools configs etc lib man db test dist-hook: # Remove junk from the generated tarball. diff -Nru sbuild-0.60.9/Makefile.in sbuild-0.62.2/Makefile.in --- sbuild-0.60.9/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -79,8 +79,8 @@ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure $(top_srcdir)/scripts/global.mk \ AUTHORS COPYING ChangeLog INSTALL NEWS TODO \ - scripts/config.guess scripts/config.sub scripts/install-sh \ - scripts/missing + scripts/config.guess scripts/config.sub scripts/depcomp \ + scripts/install-sh scripts/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -160,21 +160,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -189,6 +197,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -197,14 +206,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -250,7 +259,7 @@ # Global options for use in all Makefiles. perlmoddir = $(PERL_MODULE_DIR) -SUBDIRS = bin configs etc lib man db test +SUBDIRS = bin wrapper tools configs etc lib man db test EXTRA_DIST = \ bootstrap \ debian \ diff -Nru sbuild-0.60.9/man/buildd.1.in sbuild-0.62.2/man/buildd.1.in --- sbuild-0.60.9/man/buildd.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/buildd.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH BUILDD 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH BUILDD 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME buildd \- package autobuilder daemon .SH SYNOPSIS @@ -59,6 +60,7 @@ Copyright \[co] 2005-2008 Roger Leigh .fi .SH "SEE ALSO" +.BR buildd.conf (5), .BR buildd\-mail (1), .BR buildd\-uploader (1), .BR buildd\-watcher (1), diff -Nru sbuild-0.60.9/man/buildd.conf.5.in sbuild-0.62.2/man/buildd.conf.5.in --- sbuild-0.60.9/man/buildd.conf.5.in 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/man/buildd.conf.5.in 2011-04-04 17:43:53.000000000 +0000 @@ -0,0 +1,75 @@ +.\" Copyright © 2011 Roger Leigh +.\" +.\" 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 +.\" . +.so defs.man +.TH BUILDD.CONF 5 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" +.SH NAME +buildd.conf \- configuration file for buildd +.SH DESCRIPTION +\fBbuildd.conf\fR is a Perl script which is sourced by buildd to permit +configuration. It is run in a sandbox and restricted to setting a small number +of variables, detailed below, which may be set to configure the behaviour of +buildd. Each variable has an internal name, shown in all caps, and a perl +variable showing the default setting. Note that the internal name is not +accessible within buildd.conf; only the variable may be assigned. Also note +that some of the defaults are set to be unique for each build, and so some of +the defaults shown here are unique to the user and system used to build sbuild, +and will be different for your system. +.PP +While buildd permits many aspects of its behaviour to be configured, this +should not normally be required. The defaults should be adequate for most +uses, and should only be changed if you are doing something more advanced, or +have specialist requirements. +.SH CONFIGURATION +.so buildd.conf.man +.SH FILES +.TP +.I /etc/buildd/buildd.conf +Configuration, maintained by the system administrator. This may be used to +override the defaults. +.TP +.I ~/.builddrc +User-specific configuration. +.SH AUTHORS +Roman Hodek . +.PP +\fBsbuild\fR is based on debbuild, written by James Troup + and has been modified by +.nf +Ben Collins , +Ryan Murray , +Francesco Paolo Lovergine , +Michael Banck , and +Roger Leigh +.fi +.SH COPYRIGHT +.nf +Copyright \[co] 1998-2000 Roman Hodek +Copyright \[co] 1998-1999 James Troup +Copyright \[co] 2003-2006 Ryan Murray +Copyright \[co] 2001-2003 Rick Younie +Copyright \[co] 2003-2004 Francesco Paolo Lovergine +Copyright \[co] 2005 Michael Banck +Copyright \[co] 2005-2009 Roger Leigh +.fi +.SH "SEE ALSO" +.BR buildd (1), +.BR sbuild (1), +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff -Nru sbuild-0.60.9/man/buildd-mail.1.in sbuild-0.62.2/man/buildd-mail.1.in --- sbuild-0.60.9/man/buildd-mail.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/buildd-mail.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH BUILDD\-MAIL 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH BUILDD\-MAIL 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME buildd\-mail \- mail answer processor for buildd .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/buildd-uploader.1.in sbuild-0.62.2/man/buildd-uploader.1.in --- sbuild-0.60.9/man/buildd-uploader.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/buildd-uploader.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH BUILDD\-UPLOADER 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH BUILDD\-UPLOADER 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME buildd\-uploader \- upload built packages for buildd .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/buildd-vlog.1.in sbuild-0.62.2/man/buildd-vlog.1.in --- sbuild-0.60.9/man/buildd-vlog.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/buildd-vlog.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH BUILDD\-VLOG 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH BUILDD\-VLOG 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME buildd\-vlog \- view current build log .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/buildd-watcher.1.in sbuild-0.62.2/man/buildd-watcher.1.in --- sbuild-0.60.9/man/buildd-watcher.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/buildd-watcher.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH BUILDD\-WATCHER 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH BUILDD\-WATCHER 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME buildd\-watcher \- watch buildd activity .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/defs.man.in sbuild-0.62.2/man/defs.man.in --- sbuild-0.60.9/man/defs.man.in 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/man/defs.man.in 2011-04-04 17:43:53.000000000 +0000 @@ -0,0 +1,28 @@ +.ds WANNA_BUILD_CONF @WANNA_BUILD_CONF@ +.ds SCHROOT_CONF @SCHROOT_CONF@ +.ds WANNA_BUILD_SYSCONF_DIR @WANNA_BUILD_SYSCONF_DIR@ +.ds SCHROOT_SYSCONF_DIR @SCHROOT_SYSCONF_DIR@ +.ds BUILDD_CONF @BUILDD_CONF@ +.ds BUILDD_SYSCONF_DIR @BUILDD_SYSCONF_DIR@ +.ds SBUILD_CONF @SBUILD_CONF@ +.ds SBUILD_SYSCONF_DIR @SBUILD_SYSCONF_DIR@ +.ds WANNA_BUILD_LIBEXEC_DIR @WANNA_BUILD_LIBEXEC_DIR@ +.ds SBUILD_LIBEXEC_DIR @SBUILD_LIBEXEC_DIR@ +.ds PLATFORM @PLATFORM@ +.ds host_os @host_os@ +.ds host_vendor @host_vendor@ +.ds host_cpu @host_cpu@ +.ds host @host@ +.ds build_os @build_os@ +.ds build_vendor @build_vendor@ +.ds build_cpu @build_cpu@ +.ds build @build@ +.ds RELEASE_DATE @RELEASE_DATE@ +.ds VERSION @VERSION@ +.ds PACKAGE @PACKAGE@ +.ds PACKAGE_URL @PACKAGE_URL@ +.ds PACKAGE_BUGREPORT @PACKAGE_BUGREPORT@ +.ds PACKAGE_STRING @PACKAGE_STRING@ +.ds PACKAGE_VERSION @PACKAGE_VERSION@ +.ds PACKAGE_TARNAME @PACKAGE_TARNAME@ +.ds PACKAGE_NAME @PACKAGE_NAME@ diff -Nru sbuild-0.60.9/man/Makefile.am sbuild-0.62.2/man/Makefile.am --- sbuild-0.60.9/man/Makefile.am 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/Makefile.am 2011-04-04 17:43:53.000000000 +0000 @@ -23,11 +23,13 @@ man_MANS = \ buildd.1 \ + buildd.conf.5 \ buildd-mail.1 \ buildd-uploader.1 \ buildd-vlog.1 \ buildd-watcher.1 \ sbuild.1 \ + sbuild.conf.5 \ sbuild-abort.1 \ sbuild-adduser.8 \ sbuild-apt.1 \ @@ -37,22 +39,58 @@ sbuild-setup.7 \ sbuild-shell.1 \ sbuild-stats.1 \ - sbuild-update.1 \ - wanna-build.1 \ - wanna-build-catdb.1 \ - wanna-build-mail.1 \ - wanna-build-merge-packages.1 \ - wanna-build-statistics.1 + sbuild-update.1 + +sbuild.conf.man: $(abs_top_srcdir)/tools/sbuild-dumpconfig + PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ + $< sbuild man > $@ + +buildd.conf.man: $(abs_top_srcdir)/tools/sbuild-dumpconfig + PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ + $< buildd man > $@ + +sbuild.conf.5: sbuild.conf.5.in defs.man sbuild.conf.man + soelim $< > $@ + +buildd.conf.5: buildd.conf.5.in defs.man buildd.conf.man + soelim $< > $@ + +%.1: %.1.in defs.man + soelim $< > $@ + +%.5: %.5.in defs.man + soelim $< > $@ + +%.7: %.7.in defs.man + soelim $< > $@ + +%.8: %.8.in defs.man + soelim $< > $@ + +CLEANFILES = \ + sbuild.conf.man \ + buildd.conf.man + +EXTRA_DIST = \ + defs.man.in \ + $(addsuffix .in, $(man_MANS)) install-data-hook: ln -sf sbuild-hold.1 $(DESTDIR)$(man1dir)/sbuild-unhold.1 ln -sf sbuild-update.1 $(DESTDIR)$(man1dir)/sbuild-upgrade.1 ln -sf sbuild-update.1 $(DESTDIR)$(man1dir)/sbuild-distupgrade.1 ln -sf sbuild-update.1 $(DESTDIR)$(man1dir)/sbuild-clean.1 - ln -sf wanna-build-catdb.1 $(DESTDIR)$(man1dir)/wanna-build-catgdbm.1 - ln -sf wanna-build-catdb.1 $(DESTDIR)$(man1dir)/wanna-build-catmldbm.1 - ln -sf wanna-build-merge-packages.1 $(DESTDIR)$(man1dir)/wanna-build-merge-quinn.1 ln -sf buildd-mail.1 $(DESTDIR)$(man1dir)/buildd-mail-wrapper.1 ln -sf sbuild-abort.1 $(DESTDIR)$(man1dir)/buildd-abort.1 ln -sf sbuild-update.1 $(DESTDIR)$(man1dir)/buildd-update-chroots.1 ln -sf sbuild-createchroot.8 $(DESTDIR)$(man8dir)/buildd-make-chroot.8 + +uninstall-hook: + $(RM) $(DESTDIR)$(man1dir)/sbuild-unhold.1 + $(RM) $(DESTDIR)$(man1dir)/sbuild-upgrade.1 + $(RM) $(DESTDIR)$(man1dir)/sbuild-distupgrade.1 + $(RM) $(DESTDIR)$(man1dir)/sbuild-clean.1 + $(RM) $(DESTDIR)$(man1dir)/buildd-mail-wrapper.1 + $(RM) $(DESTDIR)$(man1dir)/buildd-abort.1 + $(RM) $(DESTDIR)$(man1dir)/buildd-update-chroots.1 + $(RM) $(DESTDIR)$(man8dir)/buildd-make-chroot.8 diff -Nru sbuild-0.60.9/man/Makefile.in sbuild-0.62.2/man/Makefile.in --- sbuild-0.60.9/man/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/man/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -76,19 +76,7 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/buildd-mail.1.in $(srcdir)/buildd-uploader.1.in \ - $(srcdir)/buildd-vlog.1.in $(srcdir)/buildd-watcher.1.in \ - $(srcdir)/buildd.1.in $(srcdir)/sbuild-abort.1.in \ - $(srcdir)/sbuild-adduser.8.in $(srcdir)/sbuild-apt.1.in \ - $(srcdir)/sbuild-checkpackages.1.in \ - $(srcdir)/sbuild-createchroot.8.in $(srcdir)/sbuild-hold.1.in \ - $(srcdir)/sbuild-setup.7.in $(srcdir)/sbuild-shell.1.in \ - $(srcdir)/sbuild-stats.1.in $(srcdir)/sbuild-update.1.in \ - $(srcdir)/sbuild.1.in $(srcdir)/wanna-build-catdb.1.in \ - $(srcdir)/wanna-build-mail.1.in \ - $(srcdir)/wanna-build-merge-packages.1.in \ - $(srcdir)/wanna-build-statistics.1.in \ - $(srcdir)/wanna-build.1.in $(top_srcdir)/scripts/global.mk + $(srcdir)/defs.man.in $(top_srcdir)/scripts/global.mk subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -96,13 +84,7 @@ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = buildd.1 buildd-mail.1 buildd-uploader.1 \ - buildd-vlog.1 buildd-watcher.1 sbuild.1 sbuild-abort.1 \ - sbuild-adduser.8 sbuild-apt.1 sbuild-checkpackages.1 \ - sbuild-createchroot.8 sbuild-hold.1 sbuild-setup.7 \ - sbuild-shell.1 sbuild-stats.1 sbuild-update.1 wanna-build.1 \ - wanna-build-catdb.1 wanna-build-mail.1 \ - wanna-build-merge-packages.1 wanna-build-statistics.1 +CONFIG_CLEAN_FILES = defs.man CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) @@ -134,8 +116,9 @@ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 -am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man7dir)" \ - "$(DESTDIR)$(man8dir)" +am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ + "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" +man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff @@ -150,21 +133,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -179,6 +170,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -187,14 +179,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -242,11 +234,13 @@ perlmoddir = $(PERL_MODULE_DIR) man_MANS = \ buildd.1 \ + buildd.conf.5 \ buildd-mail.1 \ buildd-uploader.1 \ buildd-vlog.1 \ buildd-watcher.1 \ sbuild.1 \ + sbuild.conf.5 \ sbuild-abort.1 \ sbuild-adduser.8 \ sbuild-apt.1 \ @@ -256,12 +250,15 @@ sbuild-setup.7 \ sbuild-shell.1 \ sbuild-stats.1 \ - sbuild-update.1 \ - wanna-build.1 \ - wanna-build-catdb.1 \ - wanna-build-mail.1 \ - wanna-build-merge-packages.1 \ - wanna-build-statistics.1 + sbuild-update.1 + +CLEANFILES = \ + sbuild.conf.man \ + buildd.conf.man + +EXTRA_DIST = \ + defs.man.in \ + $(addsuffix .in, $(man_MANS)) all: all-am @@ -296,47 +293,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -buildd.1: $(top_builddir)/config.status $(srcdir)/buildd.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -buildd-mail.1: $(top_builddir)/config.status $(srcdir)/buildd-mail.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -buildd-uploader.1: $(top_builddir)/config.status $(srcdir)/buildd-uploader.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -buildd-vlog.1: $(top_builddir)/config.status $(srcdir)/buildd-vlog.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -buildd-watcher.1: $(top_builddir)/config.status $(srcdir)/buildd-watcher.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild.1: $(top_builddir)/config.status $(srcdir)/sbuild.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-abort.1: $(top_builddir)/config.status $(srcdir)/sbuild-abort.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-adduser.8: $(top_builddir)/config.status $(srcdir)/sbuild-adduser.8.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-apt.1: $(top_builddir)/config.status $(srcdir)/sbuild-apt.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-checkpackages.1: $(top_builddir)/config.status $(srcdir)/sbuild-checkpackages.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-createchroot.8: $(top_builddir)/config.status $(srcdir)/sbuild-createchroot.8.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-hold.1: $(top_builddir)/config.status $(srcdir)/sbuild-hold.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-setup.7: $(top_builddir)/config.status $(srcdir)/sbuild-setup.7.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-shell.1: $(top_builddir)/config.status $(srcdir)/sbuild-shell.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-stats.1: $(top_builddir)/config.status $(srcdir)/sbuild-stats.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -sbuild-update.1: $(top_builddir)/config.status $(srcdir)/sbuild-update.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -wanna-build.1: $(top_builddir)/config.status $(srcdir)/wanna-build.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -wanna-build-catdb.1: $(top_builddir)/config.status $(srcdir)/wanna-build-catdb.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -wanna-build-mail.1: $(top_builddir)/config.status $(srcdir)/wanna-build-mail.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -wanna-build-merge-packages.1: $(top_builddir)/config.status $(srcdir)/wanna-build-merge-packages.1.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -wanna-build-statistics.1: $(top_builddir)/config.status $(srcdir)/wanna-build-statistics.1.in +defs.man: $(top_builddir)/config.status $(srcdir)/defs.man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-man1: $(man_MANS) @$(NORMAL_INSTALL) @@ -376,6 +333,44 @@ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } +install-man5: $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" + @list=''; test -n "$(man5dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.5[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ + done; } + +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man5dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.5[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man5dir)" && rm -f $$files; } install-man7: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man7dir)" || $(MKDIR_P) "$(DESTDIR)$(man7dir)" @@ -506,7 +501,7 @@ check: check-am all-am: Makefile $(MANS) installdirs: - for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ + for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -526,6 +521,7 @@ mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -571,7 +567,7 @@ install-info-am: -install-man: install-man1 install-man7 install-man8 +install-man: install-man1 install-man5 install-man7 install-man8 install-pdf: install-pdf-am @@ -600,38 +596,74 @@ ps-am: uninstall-am: uninstall-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +uninstall-man: uninstall-man1 uninstall-man5 uninstall-man7 \ + uninstall-man8 -uninstall-man: uninstall-man1 uninstall-man7 uninstall-man8 - -.MAKE: install-am install-data-am install-strip +.MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 install-man7 \ - install-man8 install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ - uninstall-am uninstall-man uninstall-man1 uninstall-man7 \ + install-info-am install-man install-man1 install-man5 \ + install-man7 install-man8 install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-hook \ + uninstall-man uninstall-man1 uninstall-man5 uninstall-man7 \ uninstall-man8 +sbuild.conf.man: $(abs_top_srcdir)/tools/sbuild-dumpconfig + PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ + $< sbuild man > $@ + +buildd.conf.man: $(abs_top_srcdir)/tools/sbuild-dumpconfig + PERL5LIB=$(abs_top_srcdir)/lib:$(abs_top_builddir)/lib \ + $< buildd man > $@ + +sbuild.conf.5: sbuild.conf.5.in defs.man sbuild.conf.man + soelim $< > $@ + +buildd.conf.5: buildd.conf.5.in defs.man buildd.conf.man + soelim $< > $@ + +%.1: %.1.in defs.man + soelim $< > $@ + +%.5: %.5.in defs.man + soelim $< > $@ + +%.7: %.7.in defs.man + soelim $< > $@ + +%.8: %.8.in defs.man + soelim $< > $@ + install-data-hook: ln -sf sbuild-hold.1 $(DESTDIR)$(man1dir)/sbuild-unhold.1 ln -sf sbuild-update.1 $(DESTDIR)$(man1dir)/sbuild-upgrade.1 ln -sf sbuild-update.1 $(DESTDIR)$(man1dir)/sbuild-distupgrade.1 ln -sf sbuild-update.1 $(DESTDIR)$(man1dir)/sbuild-clean.1 - ln -sf wanna-build-catdb.1 $(DESTDIR)$(man1dir)/wanna-build-catgdbm.1 - ln -sf wanna-build-catdb.1 $(DESTDIR)$(man1dir)/wanna-build-catmldbm.1 - ln -sf wanna-build-merge-packages.1 $(DESTDIR)$(man1dir)/wanna-build-merge-quinn.1 ln -sf buildd-mail.1 $(DESTDIR)$(man1dir)/buildd-mail-wrapper.1 ln -sf sbuild-abort.1 $(DESTDIR)$(man1dir)/buildd-abort.1 ln -sf sbuild-update.1 $(DESTDIR)$(man1dir)/buildd-update-chroots.1 ln -sf sbuild-createchroot.8 $(DESTDIR)$(man8dir)/buildd-make-chroot.8 +uninstall-hook: + $(RM) $(DESTDIR)$(man1dir)/sbuild-unhold.1 + $(RM) $(DESTDIR)$(man1dir)/sbuild-upgrade.1 + $(RM) $(DESTDIR)$(man1dir)/sbuild-distupgrade.1 + $(RM) $(DESTDIR)$(man1dir)/sbuild-clean.1 + $(RM) $(DESTDIR)$(man1dir)/buildd-mail-wrapper.1 + $(RM) $(DESTDIR)$(man1dir)/buildd-abort.1 + $(RM) $(DESTDIR)$(man1dir)/buildd-update-chroots.1 + $(RM) $(DESTDIR)$(man8dir)/buildd-make-chroot.8 + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru sbuild-0.60.9/man/sbuild.1.in sbuild-0.62.2/man/sbuild.1.in --- sbuild-0.60.9/man/sbuild.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild.1.in 2011-04-04 23:02:12.000000000 +0000 @@ -15,7 +15,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild \- build debian packages from source .SH SYNOPSIS @@ -45,6 +46,7 @@ .RB [ \-\-dpkg-source-opts=\fIoptions\fP ] .RB [ \-p \[or] \-\-purge=\fPpurge-mode\fP ] .RB [ \-\-purge\-deps=\fPpurge-mode\fP ] +.RB [ \-\-purge\-session=\fPpurge-mode\fP ] .RB [ \-b \[or] \-\-batch] .RB [ \-n \[or] \-\-nolog ] .RB [ \-\-run\-lintian ] @@ -169,16 +171,28 @@ Enable debug output. .TP .BR "\-\-apt\-clean" -Run apt-get clean in the chroot before executing the build. +.TQ +.BR "\-\-no\-apt\-clean" +Run (or do not run) apt-get clean in the chroot before executing the build, +overriding the default setting. .TP .BR "\-\-apt\-update" -Run apt-get update in the chroot before executing the build. +.TQ +.BR "\-\-no\-apt\-update" +Run (or do not run) apt-get update in the chroot before executing the build, +overriding the default setting. .TP .BR "\-\-apt\-upgrade" -Run apt-get upgrade in the chroot before executing the build. +.TQ +.BR "\-\-no\-apt\-upgrade" +Run (or do not run) apt-get upgrade in the chroot before executing the build, +overriding the default setting. .TP .BR "\-\-apt\-distupgrade" -Run apt-get distupgrade in the chroot before executing the build. +.TQ +.BR "\-\-no\-apt\-distupgrade" +Run (or do not run) apt-get distupgrade in the chroot before executing the build, +overriding the default setting. .TP .BR \-m ", " "\-\-maintainer=\fImaintainer\fP" Specify the identity to use for GPG signing packages, and also used as the @@ -220,11 +234,19 @@ .TP .BR \-p ", " "\-\-purge=\fIpurge-mode\fP" \fIpurge-mode\fR determines if the build directory will be deleted after a -build. Possible values are \fBalways\fR, \fBnever\fR, and \fBsuccessful\fR. +build. Possible values are \fBalways\fR (default), \fBnever\fR, and +\fBsuccessful\fR. .TP .BR "\-\-purge\-deps=\fIpurge-mode\fP" \fIpurge-mode\fR determines if the build dependencies will be removed after a -build. Possible values are \fBalways\fR, \fBnever\fR, and \fBsuccessful\fR. +build. Possible values are \fBalways\fR (default), \fBnever\fR, and +\fBsuccessful\fR. +.TP +.BR "\-\-purge\-session=\fIpurge-mode\fP" +Purge the schroot session following a build. This is useful in conjunction +with the \fI\-\-purge\fP and \fI\-\-purge\-deps\fP options when using snapshot +chroots, since by default the snapshot will be deleted. Possible values are +\fBalways\fR (default), \fBnever\fR, and \fBsuccessful\fR. .TP .BR \-s ", " "\-\-source" Also build source package, i.e. use dpkg\-buildpackage without \-B. @@ -323,9 +345,21 @@ .TP .BR "\-\-build\-dep\-resolver=\fIresolver\fP" Use the specified resolver to handle selecting the build dependencies. -Supported resolvers are \fIinternal\fP (the default) and \fIaptitude\fP. The -latter tries to be smarter but is also slower. It may be of some help when -trying to pull build dependencies from an extra suite, like \fIexperimental\fP. +Supported resolvers are \fIapt\fP (the default), \fIaptitude\fP and +\fIinternal\fP (deprecated). The apt resolver is the most appropriate resolver +for most users, for building for unstable, stable and other distributions. If +alternative build dependencies are used (excluding architecture restrictions), +only the first alternative will be used; the others will be ignored. The +aptitude resolver is very similar, but smarter and slower, and it will consider +all alternatives by default; it is suited to more complex situations, such as +building packages for the experimental distribution, where packages need +installing from multiple suites (\fIunstable\fP and \fIexperimental\fP). Due +to performance and other issues (bug #139615), aptitude is not recommended for +use by default. The internal resolver is much older, contains several +significant deficiencies such as not being able to handle complex alternative +and virtual dependencies, and is deprecated. Like apt, it only uses the first +alternative build dependency when multiple alternatives exist. It is not +recommended for future use, and will be removed in the future. .SH EXTERNAL COMMANDS Support to run external commands during an sbuild run is provided. A set of external commands can be run at various stages of a build. Providing commands to @@ -471,6 +505,7 @@ Copyright \[co] 2005-2009 Roger Leigh .fi .SH "SEE ALSO" +.BR sbuild.conf (5), .BR sbuild\-abort (1), .BR sbuild\-adduser (8), .BR sbuild\-apt (1), diff -Nru sbuild-0.60.9/man/sbuild-abort.1.in sbuild-0.62.2/man/sbuild-abort.1.in --- sbuild-0.60.9/man/sbuild-abort.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-abort.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-ABORT 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD\-ABORT 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-abort \- abort the current sbuild build .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/sbuild-adduser.8.in sbuild-0.62.2/man/sbuild-adduser.8.in --- sbuild-0.60.9/man/sbuild-adduser.8.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-adduser.8.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-ADDUSER 8 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD\-ADDUSER 8 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-adduser \- add an sbuild user .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/sbuild-apt.1.in sbuild-0.62.2/man/sbuild-apt.1.in --- sbuild-0.60.9/man/sbuild-apt.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-apt.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-APT 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD\-APT 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-apt \- run apt-get or apt-cache in an sbuild chroot .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/sbuild-checkpackages.1.in sbuild-0.62.2/man/sbuild-checkpackages.1.in --- sbuild-0.60.9/man/sbuild-checkpackages.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-checkpackages.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-CHECKPACKAGES 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD\-CHECKPACKAGES 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-checkpackages \- check the package list in a sbuild chroot against a reference list .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/sbuild.conf.5.in sbuild-0.62.2/man/sbuild.conf.5.in --- sbuild-0.60.9/man/sbuild.conf.5.in 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/man/sbuild.conf.5.in 2011-04-04 17:43:53.000000000 +0000 @@ -0,0 +1,74 @@ +.\" Copyright © 2011 Roger Leigh +.\" +.\" 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 +.\" . +.so defs.man +.TH SBUILD.CONF 5 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" +.SH NAME +sbuild.conf \- configuration file for sbuild +.SH DESCRIPTION +\fBsbuild.conf\fR is a Perl script which is sourced by sbuild to permit +configuration. It is run in a sandbox and restricted to setting a small number +of variables, detailed below, which may be set to configure the behaviour of +sbuild. Each variable has an internal name, shown in all caps, and a perl +variable showing the default setting. Note that the internal name is not +accessible within sbuild.conf; only the variable may be assigned. Also note +that some of the defaults are set to be unique for each build, and so some of +the defaults shown here are unique to the user and system used to build sbuild, +and will be different for your system. +.PP +While sbuild permits many aspects of its behaviour to be configured, this +should not normally be required. The defaults should be adequate for most +uses, and should only be changed if you are doing something more advanced, or +have specialist requirements. +.SH CONFIGURATION +.so sbuild.conf.man +.SH FILES +.TP +.I /etc/sbuild/sbuild.conf +Configuration, maintained by the system administrator. This may be used to +override the defaults. +.TP +.I ~/.sbuildrc +User-specific configuration. +.SH AUTHORS +Roman Hodek . +.PP +\fBsbuild\fR is based on debbuild, written by James Troup + and has been modified by +.nf +Ben Collins , +Ryan Murray , +Francesco Paolo Lovergine , +Michael Banck , and +Roger Leigh +.fi +.SH COPYRIGHT +.nf +Copyright \[co] 1998-2000 Roman Hodek +Copyright \[co] 1998-1999 James Troup +Copyright \[co] 2003-2006 Ryan Murray +Copyright \[co] 2001-2003 Rick Younie +Copyright \[co] 2003-2004 Francesco Paolo Lovergine +Copyright \[co] 2005 Michael Banck +Copyright \[co] 2005-2009 Roger Leigh +.fi +.SH "SEE ALSO" +.BR sbuild (1). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff -Nru sbuild-0.60.9/man/sbuild-createchroot.8.in sbuild-0.62.2/man/sbuild-createchroot.8.in --- sbuild-0.60.9/man/sbuild-createchroot.8.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-createchroot.8.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-CREATECHROOT 8 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD\-CREATECHROOT 8 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-createchroot \- create sbuild chroot .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/sbuild-hold.1.in sbuild-0.62.2/man/sbuild-hold.1.in --- sbuild-0.60.9/man/sbuild-hold.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-hold.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-HOLD 1 "28 Dec 2007" "Version 0.57.0" "Debian sbuild" +.so defs.man +.TH SBUILD\-HOLD 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-hold \- hold packages in an sbuild chroot .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/sbuild-setup.7.in sbuild-0.62.2/man/sbuild-setup.7.in --- sbuild-0.60.9/man/sbuild-setup.7.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-setup.7.in 2011-04-04 17:43:53.000000000 +0000 @@ -15,7 +15,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD-SETUP 7 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD-SETUP 7 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild-setup \- sbuild setup procedure .SH DESCRIPTION diff -Nru sbuild-0.60.9/man/sbuild-shell.1.in sbuild-0.62.2/man/sbuild-shell.1.in --- sbuild-0.60.9/man/sbuild-shell.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-shell.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-SHELL 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD\-SHELL 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-shell \- run a shell in an sbuild chroot .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/sbuild-stats.1.in sbuild-0.62.2/man/sbuild-stats.1.in --- sbuild-0.60.9/man/sbuild-stats.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-stats.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -14,7 +14,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-STATS 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD\-STATS 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-stats \- display or alter database of package build times/space .SH SYNOPSIS diff -Nru sbuild-0.60.9/man/sbuild-update.1.in sbuild-0.62.2/man/sbuild-update.1.in --- sbuild-0.60.9/man/sbuild-update.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/sbuild-update.1.in 2011-04-04 17:43:53.000000000 +0000 @@ -13,7 +13,8 @@ .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see .\" . -.TH SBUILD\-UPDATE 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" +.so defs.man +.TH SBUILD\-UPDATE 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" .SH NAME sbuild\-update \- update, upgrade, and clean an sbuild chroot with apt-get .SH SYNOPSIS @@ -84,7 +85,12 @@ .TP .BR \-k ", " \-\-keygen Generate a GPG public/private key pair for self-signing local apt archives, -used for installation of dependency packages. +used for installation of dependency packages. Note that this requires a +significant amount of entropy (randomness) and may hang on systems with poor +entropy sources, such as headless systems without direct user input. In this +situation, it is advisable to create the key on a trusted local system, and +copy the files to the build system by hand from +\fI/var/lib/sbuild/apt-keys/\fP. .SS Chroot selection .TP .B CHROOT diff -Nru sbuild-0.60.9/man/wanna-build.1.in sbuild-0.62.2/man/wanna-build.1.in --- sbuild-0.60.9/man/wanna-build.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/wanna-build.1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,770 +0,0 @@ -'\" tp -.\" Copyright © 2000 Roman Hodek -.\" Copyright © 2008 Roger Leigh -.\" -.\" 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 -.\" . -.TH WANNA\-BUILD 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" -.SH NAME -wanna\-build \- package build database for sbuild -.SH SYNOPSIS -.\" TODO: add complete option list. -.B wanna\-build -\-\-take (default) -\-f, \-\-failed -\-u, \-\-uploaded -\-n, \-\-no\-build -\-i, \-\-info -\-l STATE, \-\-list=STATE -\-\-merge\-quinn -\-\-merge\-packages -\-O, \-\-order -package -.SH VERSION -This man page documents the packaged version of wanna\-build. This version -is maintained by the \fBbuildd-tools\fP project developers on Alioth -(\f[CR]https://alioth.debian.org/projects/buildd\-tools/\fP). -.PP -There is also a version maintained by Ryan Murray which is adapted to build -daemon needs, with similar functionality. This version should be equally -capable of working in a buildd setup, but has a number of enhancements aimed at -making it suitable for use by end-users. -.PP -Please note that this manual page was created from the README files -accompanying the wanna\-build sources and may be outdated and incorrect in -places, as well as containing duplicated information. Improvements to the -documentation are welcome. -.SH DESCRIPTION -wanna\-build is intended to coordinate package building, and to make it easy to -determine which packages need recompilation. -.SH OVERVIEW -wanna\-build is an automatic distributed build system intended to -recompile Debian binary packages from the Debian source. The system consists -of seven components: -.PS -define program { box rad 0.125 } -lineht = 0.25; - -Input: [ - right; - P: box "Packages"; - move; - Q: box "Quinn-Diff" "output"; - - A: line down from P .s lineht/2; - B: line down from Q .s lineht/2; -] -move down lineht from last [] .s; - -W: program wid 1.25 ht 0.75 "Wanna-Build" "database" "\f[CR]wanna\-build\fP" -arrow from Input.A.end to W.nw; -arrow from Input.B.end to W.ne; -move to W .s; -arrow <->; -BD: program ht 0.75 "Build" "D\[ae]mon" "\f[CR]buildd\fP"; -arrow <->; -SB: program ht 0.75 "Source" "Builder" "\f[CR]sbuild\fP" - -AD: box wid 1 dashed at BD + (1.5, 0) "Administrator"; -line dashed from AD.w to BD.e ->; -DV: box wid 1 dashed at SB + (1.5, 0) "Developer"; -line dashed from DV.w to SB.e ->; -.PE -.TP -Quinn-Diff -This program determines which packages need to be recompiled. It is -optional; any program which produces the same output could be used in -its place. quinn\-diff may be run on the same machine as wanna\-build -or on any other machine. -.TP -Packages -The Packages file from an ftp site (preferablly all build daemons -should use the same ftp mirror as wanna\-build); wanna\-build uses the -information to determine which packages have been installed (after -they've been `uploaded'), and which packages can now be built (after -they've been put on `dep-wait'). -.TP -Wanna\-Build -The heart of the build system. This is a database of packages which -need to be rebuilt. The packages can be in several states -(e.g. `needs-build', `failed', `dep-wait' etc.). The database does -full locking, so as long as build daemons and humans all register what -they want to build via wanna\-build, there will be no duplication of -work. -.TP -Build Daemon -The build daemon can be used on a permanently connected machine to -ensure packages are being compiled continuously. It gets a list of -packages to build from the wanna\-build database and builds them with -sbuild. The logs of the build are then sent to the human -adminstrator. -.TP -Sbuild -This is the script used to build Debian source packages. -.TP -Adminstrator -Each build daemon must have a human adminstrator who looks at each build logs -and sends a response. The response can be a signed .changes file, in which -case the build daemon will upload the package, or it can be a `fail' response -along with a reason, in which case the build daemon will notify the -wanna\-build database about the change of state for the package. -.TP -Developers -Developers can compile and upload packages without duplication of work -if they register their intent with wanna\-build. Developers are -recommended to use sbuild, pbuilder, or something similar, but there's -nothing that requires this. -.SH OPTIONS -As usual, a double minus ("\-\-") stops option processing, and remaining -arguments will be treated as non-options, even if they start with a '\-'. -.SS General options -.TP -\-v, \-\-verbose -Verbose execution. Be somewhat more verbose, and print revision number at -start. -.SS Actions -.TP -\-\-take -Take package for building (this is the default operation). -.TP -\-f, \-\-failed -Record in database that a build failed due to deficiencies in the -package (that are not fixable without a new source version). -.TP -\-u, \-\-uploaded -Record in the database that the packages build correctly and were -uploaded. -.TP -\-n, \-\-no\-build -Record in the database that the packages are not desired for m68k and -should not appear in listings even if they are out of date. -.TP -\-\-dep\-wait -Record in the database that the packages are waiting for some source -dependencies to become available. If you see that a package source-depends on -some other package which isn't available yet for your architecture, you best -set the package to state Dep-Wait. You additionally give a list of dependencies -with the \-m option, formatted just like a Depends: field (versioned -dependencies are allowed, but no alternatives). If \-m is not used, -wanna\-build will ask interactively for the dependency list. The package is set -back to state Needs-Build as soon as all the dependencies are known to be -available (detected by \-\-merge\-packages). -.TP -\-d DIST, \-\-dist=DIST -Set distribution on which wanna\-build should work. There are separate -databases for stable, frozen, and unstable. A default distribution is set with -the variable $default_dist in /etc/wanna\-build.conf. The distributions -"stable", "frozen", "unstable" can be abbreviated as 's', 'f', and 'u', resp. -.TP -\-\-forget -This is another action: The named packages (only name, no version) will be -removed from the database completely. This is for maintenance purposes, not -for day-by-day use. A mail will be sent to the database maintainer. -.TP -\-\-give\-back -Mark a package as ready to build that is in state Building, Built or -Build-Attempted. To give back a package in state Failed, use \-\-override. If -you decide to stop building a package that you have taken before (i.e., which -is in state Building and you're the builder), but that package hasn't failed, -you can give it back with this option. The state changes back to Needs-Build. -.TP -\-\-merge\-quinn -Merge quinn\-diff output into database. -.TP -\-\-merge\-packages -Merge Packages files into database. -.TP -\-\-pretend\-avail -Pretend that given packages are available now and give -free packages waiting for them. -.TP -.SS Information -\-i \fIsource-package\fP, \-\-info \fIsource-package\fP -Show information for source package. -.TP -\-l \fIstate\fP, \-\-list=\fIstate\fP: -List all packages in state \fIstate\fP; can be combined with \-U to -restrict to a specific user; \fIstate\fP can also be 'all'. -.SS Behaviour -.TP -\-m \fImessage\fP, \-\-message=\fImessage\fP -Give reason why package failed or source dependency list (used with -\-f, \-\-dep\-wait, and \-\-binNMU). -Set fail message for \-\-failed. If not set on the command line, wanna\-build -will ask interactively for it. -Set the dependencies that a package should wait for if used with -\-\-dep\-wait. Again, wanna\-build will ask interactively for the dependencies -if this option isn't given. -.TP -\-o, \-\-override -Override another user's lock on a package, i.e. take it over; a -notification will be mailed to the other user. -Take over a package from somebody else. This is possible for packages in -state Building or Failed. The new state will be Building, and the owner -changes. A mail notice will be sent to the previous owner. -.TP -\-O ORDER, \-\-order=ORDER -Select criteria for how to order \-\-list output (see above). -.TP -\-U \fIuser\fP, \-\-user=\fIuser\fP -Select user name for which listings should apply, if not given all -users are listed. if \-l is missing, set user name to be entered in -db; usually automatically chosen. -Set the user whose name is logged with the transaction, or who will be -entered in the database as builder of the package (\-\-take). The default is -the login name of the caller, but for maintenance purposes it can be -changed on the command line. -.TP -\-c CATEGORY, \-\-category=CATEGORY -Set/change the failed category (with \-\-failed) or list only failed packages -in this category (with \-\-list). For more details on failed categories, -please see the file README.failcat. -.TP -\-a DAYS, \-\-min\-age=DAYS -Used together with \-\-list. List only packages whose state change is at -least DAYS ago. Days can be negative, then only packages at most DAYS -old are listed. -.TP -\-\-max\-age=DAYS -Same as the above, but specifies a maximum age (same meaning as negative -DAYS in \-\-min\-days). DAYS can be negativ here, too, meaning a minimum age -again. -.TP -\-\-correct\-compare -Use dpkg \-\-compare\-versions for version comparisons, as it is really -correct. However, spawning a dpkg process for every comparison is very -time-consuming, so the default is to use the internal implementation. (Which -has been derived from the dpkg source.) -.TP -.SS Administration -\-\-import \fIfile\fP -Import database from an ASCII file \fIfile\fP into the internal database. This -is NOT intended for public use. \fBCaution\fP: the internal database is cleared -before the import, so that packages can also be deleted by manual editing. But -this also means that you can also easily destroy the whole DB with this option! -.TP -\-\-export \fIfile\fP -Export database to an ASCII file \fIfile\fP. The internal database is in -Berkeley DB hash format, to speed up operation. The file format is somewhat -similar to a Packages file, but with different keywords. The \-\-export option -is not intended for public use, but for the database maintainer to view the -contents of the DB directly, or the make manual changes. -.TP -\-\-create\-maintenance\-lock -This action creates a master lock file for all databases. All operations except -\-\-merge\-packages and \-\-merge\-quinn will block until this master lock is -gone. The purpose of this lock is to interception of other operation in the -middle of a database update that must be done sequentially for different -distributions, but the merged data nevertheless belong together. The -maintenance lock is used by the do\-merge\-quinn and do\-merge\-packages -scripts. -.TP -\-\-remove\-maintenance\-lock -Remove a master lock file again. -.TP -\-\-manual\-edit -Lock the database, export it, start an editor for it, and after the editor -exists, re-import the modified file. Then the db is unlocked again. This option -is meant for manual fixes to the database, with full locking. -.TP -\-\-create\-db -Since wanna\-build refuses to open (and thus create) non-existing databases -now, this option is necessary if you really want to create a not-yet-existing -db. -.TP -\-\-introduce\-epochs -This was needed when an old database was updated to contain epochs. As now all -databases should include epochs, this option should be unneeded. -.SH ALIASES -wanna\-build includes a set of aliases (found in @WANNA_BUILD_LIBEXEC_DIR@) -which save typing the operation option (add the directory to the PATH in your -environment). The following aliases exist: -.SS Actions -.TS -lfI lfI -lfCR lfCR. -_ -Command Effective commandline -_ -wanna\-build wanna\-build \-\-take -uploaded\-build wanna\-build \-\-uploaded -failed\-build wanna\-build \-\-failed -give\-back\-build wanna\-build \-\-give\-back -dep\-wait\-build wanna\-build \-\-dep\-wait -forget\-build wanna\-build \-\-forget -no\-build wanna\-build \-\-no\-build -_ -.TE -.SS Information -.TS -lfI lfI -lfCR lfCR. -_ -Command Effective commandline -_ -build\-info wanna\-build \-\-info -list\-needs\-build wanna\-build \-\-list=needs\-build -list\-building wanna\-build \-\-list=building -list\-uploaded wanna\-build \-\-list=uploaded -list\-installed wanna\-build \-\-list=installed -list\-failed wanna\-build \-\-list=failed -list\-dep\-wait wanna\-build \-\-list=dep\-wait -list\-not\-for\-us wanna\-build \-\-list=not\-for\-us -list\-all wanna\-build \-\-list=all -_ -.TE -.SS Internal -These are used by cron jobs. -.TS -lfI lfI -lfCR lfCR. -_ -Command Effective commandline -_ -merge\-quinn wanna\-build \-\-merge\-quinn -merge\-packages wanna\-build \-\-merge\-packages -_ -.TE -.SH DATABASE STATES -wanna\-build maintains a database (/var/lib/wanna\-build/build\-db\-DIST) -in which it keeps information about all the packages and their -states. These states can be: -.TP -Installed -The source and binary version of a package match, no action is needed. -.TP -Needs-Build -The source version is newer than the binary version for this architecture, so -the package needs recompilation. -.TP -Building -Someone has taken the package and currently builds it. -.TP -Uploaded -A previous rebuild has been successfull, and the resulting binary package has -been uploaded, but it is not installed into the archive yet. -.TP -Failed -A previous build failed for some reason, and a new version of the source -package is needed to fix this. This means you don't need to try to recompile -this version of the package again, it's in vain. The "Failed" state is reset if -a new source version appears (but there are some warnings that it previously -failed). -.TP -Dep-Wait -A previous build failed because it needs some other package (or newer version -of) that isn't available yet for this architecture. Along with this state a -dependency list is stored (normal Depends: syntax and features). Once all those -dependencies are known to be available (are in state Installed and satisfying -version requirements if present), the package changes state to Needs-Build -again. -.TP -Not-For-Us -The package isn't suitable for this architecture for some reason. (E.g., -isdnutils is useless on m68k.) The package is (nearly) completely ignored by -wanna\-build and never will appear in needs-build lists, even if new source -versions come up. -.TP -Failed-Removed -This is a rather special state... It occurs if a package disappears from -quinn\-diff output and was in state Failed before. Such disappearing packages -are usually deleted from the database, but state Failed packages are treated -differently, to avoid loosing the failure messages. Therefore they're put into -this special state, so that they still have an entry, but are otherwise -ignored. If was missing from quinn\-diff due to an error and re-appears later, -it will change back state to Failed as nothing has happened. -.TP -Dep-Wait-Removed -This is similar to Failed-Remove, and this state is entered if a package was in -Dep-Wait and then disappears from quinn\-diff. The state is just to prevent -loosing the dependency information if the package later is listed again (for -example, if the disappearance was a quinn\-diff failure). -.TP -Install-Wait -.TP -Reupload-Wait: -These states handle a special case, the delayed-frozen-installation, which is -described in its own chapter at the end of this document. -.PP -A packages changes states by the various calls to wanna\-build. The usual -process is: -.IP \[bu] -merge\-quinn (run by a cron job) detects that some package needs recompilation -due to a new source version. The state changes from "Installed" to -"Needs-Build", and the version number is updated. -.IP \[bu] -Somebody notices that the package needs rebuilding, and takes it with -.IP -\f[CR]%\ \f[CB]wanna\-build hello_1.0\-1\fP\fP\[CR] -.br -.IP -The state changes from "Needs-Build" to "Building". -.IP \[bu] -The build is successfull and the job is uploaded. Then the uploader calls -.IP -\f[CR]%\ \f[CB]uploaded\-build hello_1.0\-1.dsc\fP\fP\[CR] -.br -.IP -The package changes state from "Building" to "Uploaded". -.IP \[bu] -If the package has been installed into the Debian archive by dinstall on -master, it will be in the binary\-ARCH/Packages file eventually some days -later. A cron job calls merge\-packages and this detects that the version that -previously was uploaded is now in there and changes the state from "Uploaded" -to "Installed". -.PP -The wanna\-build call in the second step also serves another purpose: It -detects (and tells you) if somebody else already has taken the package (to -avoid double work), or if the package failed previously. The output could -look like: -.PP -\f[CR]%\ \f[CB]wanna\-build hello_1.0\-1\fP\fP\[CR] -.br -\f[CR] hello: NOT OK!\fP -.br -\f[CR] already taken by rnhodek\fP -.br -.PP -or -.PP -\f[CR]%\ \f[CB]wanna\-build hello_1.0\-1\fP\fP\[CR] -\f[CR] hello: NOT OK!\fP -\f[CR] build of 1.0\-1 failed previously:\fP -\f[CR] Needs a special source patch to compile for m68k (see #99999)\fP -.PP -For packages that are not taken yet and have no other specialities, you get no -output except you give the \-v (verbose) option. -.PP -The arguments you give to wanna\-build, uploaded\-build, and failed\-build are -rather free-format. The tools just need the package name and the version -number, separated by '_'. Path prefixes and extensions like ".dsc", ".deb", -".changes", ... are ignored. This often allows you to use your shell's filename -completion or cut&paste to enter the arguments. -.PP -uploaded\-build shouldn't fail except the state is wrong (not "Building"), or -you're not the one who has taken the package, or if there is a version -mismatch. But there is no coordination or the like here. -.PP -If a build fails (and the error can't be fixed without source modifications), -you should inform your fellows by calling -.PP -\f[CR]%\ \f[CB]failed\-build hello_1.0\-1\fP\fP\[CR] -.br -.PP -You will be asked for a failure message that will be put in the database. -It can be more than one line. For example: -.PP -\f[CR]Enter reason for failing (end with '.' alone on its line):\fP -.br -\f[CR]\f[CB]Needs a special source patch to compile for m68k (see #99999)\fP\fP\[CR] -.br -\f[CR]\f[CB]\&.\fP\fP\[CR] -.br -\f[CR]hello: registered as failed\fP -.br -.PP -The failed messages are also useful for keeping failed lists (list\-failed) and -going though it and remembering maintainers about bugs from time to time. If -the package was already in state "Failed", your message will be appended to the -previous one. -.PP -If later a new source version is detected by merging quinn\-diff output, the -state will be reset to "Needs-Build", assuming that the new source version -fixes the problem. For example, if the new version of hello is 1.0\-2 and you -take the package, you'll see: -.PP -\f[CR]%\ \f[CB]wanna\-build \-v hello_1.0\-2\fP\fP\[CR] -.br -\f[CR]hello: Warning: Previous version failed!\fP -.br -\f[CR]hello: ok\fP -.br -.PP -This should make you cautious and you can look at the fail message: -.PP -\f[CR]%\ \f[CB]build\-info hello\fP\fP\[CR] -.br -\f[CR]hello:\fP -.br -\f[CR] Package : hello\fP -.br -\f[CR] Version : 1.0\-2\fP -.br -\f[CR] Builder : rnhodek\fP -.br -\f[CR] State : Building\fP -.br -\f[CR] Section : devel\fP -.br -\f[CR] Priority : optional\fP -.br -\f[CR] Previous\-State : Failed\fP -.br -\f[CR] State\-Change : 1998 Jun 16 16:17:41\fP -.br -\f[CR] Notes : out\-of\-date:libc6\fP -.br -\f[CR] Old\-Failed : \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 1.0\-1 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\fP -.br -\f[CR] Needs a special source patch to compile for m68k (see #99999)\fP -.br -.PP -Now you can look into the changelog of the package and check if bug #99999 -really has been fixed. If it seems unlikely that this version will work, you -can immediately call failed\-build again. -.PP -Besides build\-info, there is the \-\-list option or the list\-* aliases that -retrieve information from the database. The most commonly used command is -list\-needs\-build, which tells you which packages are ready for taking. For -example: -.PP -\f[CR]%\ \f[CB]list\-needs\-build\fP\fP\[CR] -.br -\f[CR]editors/xemacs19_19.16\-9 [important:uncompiled:libc6:X]\fP -.br -\f[CR]editors/sex_0.16 [optional:uncompiled:libc6:X]\fP -.br -\f[CR]editors/the_2.5\-0.6 [optional:uncompiled:libc6]\fP -.br -\f[CR]editors/xemacs20_20.4\-12 [optional:uncompiled:libc6:X]\fP -.br -\f[CR]Total 4 package(s)\fP -.br -.PP -The output is similar to quinn\-diff intentionally. The difference is that -already taken or uploaded or failed packages aren't listed. quinn\-diff can't -know these things. -.PP -The packages are usually ordered by the following criteria (in this order): -.IP \[bu] -out-of-date/uncompiled (the former come first) -.IP \[bu] -priority (e.g. "required" before "optional") -.IP \[bu] -section (alphabetically) -.IP \[bu] -package name (alphabetically) -.PP -You can also change the sorting with the \-O or \-\-order option. That option -needs an argument that consists of a series of letters. Each letter stands for -one criterium, and the order of the letters decides in which order to apply -these criteria. Available letters are: -.TP -b -builder, alphabetically -.TP -c -out-of-date/uncompiled (out-of-date comes before uncompiled) -.TP -n -package name, alphabetically -.TP -p -priority (required -> important -> ... -> extra) -.TP -s -section name, ordered by some kind of importance -.TP -f -failed category (none > uploaded-fixed-pkg > fix-expected > reminder-sent > -nmu-offered > easy > medium > hard > compiler-error) -.PP -I.e., the default order would be \-\-order=cpsn. If listing failed packages, -the default order becomes fcpsn. -.PP -The other list\-* commands can list packages in other states, e.g. -list\-uploaded would list all packages that have been uploaded, but are not -installed yet. Or list\-building would give you infos on who currently builds -what. -.PP -All the list\-* commands can also take a \-U (\-\-user) option to restrict the -output to a specific user. -.SH -THE DELAYED-FROZEN-INSTALL PROBLEM -.PP -A special problem should be documented here, since wanna\-build tries to handle -it, but nevertheless some manual work is required, and there is a deficiency -you might want to know about. -.PP -If a source upload is for frozen and unstable, the source will be installed in -unstable immediately, but before going to frozen it needs manual acknowledge by -the release manager. (The same can also happen if stable is involved. In the -following frozen+unstable will be used as example, but there are also different -combinations to which the problem applies to: stable+unstable, stable+frozen -(unlikely), stable+frozen+unstable.) Therefore, quinn\-diff for unstable will -list the package earlier then the one for frozen, and it will be in Needs-Build -in unstable earlier. If now someone takes the unstable package, the state -change is not propagated to frozen, because there is still an older version in -the database. (The same scenario can also happen if the quinn\-diff for frozen -isn't updated for a few days due to malfunctions.) -.PP -Now the builder may not upload the package for frozen and unstable, because he -cannot know if the package will be accepted for frozen. So he must delete -frozen from the Distribution: field in the .changes file. (sbuild does this.) -He should also save the .changes file because he will need it later. (Also this -done automatically by sbuild.) But if the package is accepted for frozen, the -new version will become Needs-Build a few days or so later. To avoid building -the same version again as far as this can be avoided, wanna\-build takes the -following actions: -.IP \[bu] -If a package comes in from quinn\-diff for distribution A and the -Installed-Version: of the same package in another distribution B is equal to -the incoming version, the state in distrib A will not be Needs-Build but -Reupload-Wait. -.IP \[bu] -If a package comes in from quinn\-diff for distribution A and the the same -package in another distribution B has the same version number and is in states -Building or Uploaded, the state in distrib A will not be Needs-Build but -Install-Wait. -.IP \[bu] -If a package comes in from quinn\-diff for distribution A and the the same -package in another distribution B has the same version number and the state -there is Failed or Dep-Wait, the state from B is copied, together with fail -messages or dependencies, resp. -.IP \[bu] -If during \-\-merge\-packages for distribution A the same version of the -package in another distrib B is in state Install-Wait, the state in B is -changed to Reupload-Wait. -.IP \[bu] -Any time a package changes state to Reupload-Wait, a mail is sent to the -previous builder that he should reupload the package for the distribution in -question. The builder is supposed to take the binary packages from a Debian -mirror, and make a new upload based on the .changes he saved after the build -for unstable. The Distribution: should be what wanna\-build tells him in its -mail. (There is a script, buildd-reupload, for this task.) -.PP -This way, a lot of recompilations of the same version can be avoided. -However, unfortunately, not all of them. If another version for unstable is -installed in the archive before the frozen version comes in from -quinn\-diff, the binary packages are already lost and cannot be reuploaded. -.SH FAILURE CATEGORIES -Every package in state Failed can be assigned a category. The -following categories exist: -.IP \[bu] - easy (e) -.IP \[bu] - medium (m) -.IP \[bu] - hard (h) -.IP \[bu] - compiler-error (c) -.IP \[bu] - fix-expected (f) -.IP \[bu] - reminder-sent (r) -.IP \[bu] - nmu-offered (n) -.IP \[bu] - uploaded-fixed-pkg (u) -.PP -Additionally, a special category `none' is used if no category has -been assigned. -.PP -Usually, if a package failed recompilation, you report a bug and set -it to Failed. Now you should also assign a category to this failed -package. "easy" is for more or less trivial bugs, like typos or the -like. "medium" is for things that require a bit more effort (e.g., -writing new configs for your arch) but are still doable with a normal -NMU. "hard" is meant for things that need special bootstrapping, for -programs that segfault and need debugging, and so on. If you know the -package maintainer to fix reported bugs quickly and reliably, you can -also use "fix-expected" as category. -.PP -You can assign a category directly with wanna\-build: -.PP -\f[CR]%\ \f[CB]failed\-build \-c easy some\-pkg_1.0\-1\fP\fP\[CR] -.br -.PP -or -.PP -\f[CR]%\ \f[CB]wanna\-build \-c easy some\-pkg_1.0\-1\fP\fP\[CR] -.br -.PP -You can also use one-letter abbreviations for the categories, as mentioned -above in parens. Another way to assign a category is to include them in the -fail message, probably the one that you send back to the build daemon. If the -message starts with [XXX], the XXX will be interpreted as a category and be -assigned to the package. Of course, you can use the abbreviations here, -too. You can also change an existing category by including a new one in a fail -message (that will be appended). That inclusion into a message is usually the -most convenient way to set or change a category. -.PP -From time to time you should make a bug fixing session to check for -old, unfixed bugs. You can easily list such failed packages with the -new \-\-min\-age=DAYS (\-a) option of wanna\-build. For example, I -regularily do -.PP -\f[CR]%\ \f[CB]list\-failed \-a 14\fP\fP\[CR] -.PP -to list all failed packages that haven't been fixed in the last 14 days. The -listing is sorted by categories. You probably can ignore "hard" packages -(except you have lots of spare time now :-) -.PP -For packages that are "easy" or "medium", you can send a reminder to the -maintainer and change the category to "reminder-sent". If a package is in that -category for several days and the maintainer still didn't respond, you should -offer to make a NMU if there is no reaction. The category changes to -"nmu-offered". If a package has that label and is older than (e.g.) 21 days, -you really should do the NMU now. -.PP -Of course, the timings are more or less a subjective choice, and also -can very with importance of the failed package. Simply use common -sense. For really old bugs, you obviously also can skip the reminder -phase. -.PP -If the maintainer replies to a bug report and says he is actively -working on a fix, a good new category is "fix-expected". With this you -note for yourself that a reminder and NMU offer is probably not -necessary (except the package is for too long in this state...) -.PP -If the maintainer says that he already has uploaded a fixed version -(or is about to do this), you can set the category to -"uploaded-fixed-pkg". This again is a note for your bug tracking. -.PP -The above to actions can be easily done with the Emacs functions -buildd\-bug\-change\-category (C\-c C\-a C\-c) and buildd\-comment (C\-c C\-a -C\-a). They both can be called in a reply to the bug report, provided that the -maintainer left the subject unchanged, i.e. it still is in the form -.PP -\f[CR]Re: Bug#XXXX: PACKAGE_VERSION(DIST): blabla\fP -.br -.PP -Those infos are needed to construct a mail with correct subject to -buildd that will call failed\-build then. Obviously, you can also -change the category with buildd\-bug\-comment, by including [CATEGORY] -in the text to be appended. -.SH FILES -.TP -.I /etc/wanna\-build/wanna\-build.conf -Configuration, maintained by the system administrator. This may be used to -override the defaults. -.TP -.I ~/.wanna\-buildrc -User-specific configuration. -.TP -.I /var/lib/wanna\-build -Database files. -.SH AUTHORS -Roman Hodek , -Ryan Murray , and -Roger Leigh . -.fi -.SH "SEE ALSO" -.BR sbuild (1). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff -Nru sbuild-0.60.9/man/wanna-build-catdb.1.in sbuild-0.62.2/man/wanna-build-catdb.1.in --- sbuild-0.60.9/man/wanna-build-catdb.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/wanna-build-catdb.1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -'\" tp -.\" Copyright © 2009 Roger Leigh -.\" -.\" 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 -.\" . -.TH WANNA\-BUILD\-CATDB 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" -.SH NAME -wanna\-build\-catdb \- dump wanna\-build database -.SH SYNOPSIS -.B wanna\-build\-catdb -.B package -.br -.B wanna\-build\-catgdbm -.B package -.br -.B wanna\-build\-catmldbm -.B package -.SH VERSION -This man page documents the packaged version of wanna\-build. This version -is maintained by the \fBbuildd-tools\fP project developers on Alioth -(\f[CR]https://alioth.debian.org/projects/buildd\-tools/\fP). -.PP -There is also a version maintained by Ryan Murray which is adapted to build -daemon needs, with similar functionality. This version should be equally -capable of working in a buildd setup, but has a number of enhancements aimed at -making it suitable for use by end-users. -.SH DESCRIPTION -wanna\-build\-catdb is used to make a raw text dump of a wanna\-build database. -wanna\-build\-catdb will dump databases in Berkely DB format, while -wanna\-build\-catgdbm will dump GDBM format databases and -wanna\-build\-catmldbm will dump MLDBM format databases. MLDBM is the database -format currently used by wanna\-build. -.PP -wanna\-build\-catdb is deprecated. It will not dump the complete multi-level -hash structure of current databases, and will be removed in the future. -wanna\-build -provides \-\-export and \-\-import options to dump and restore its database as -a text file. Please use these instead of wanna\-build\-catdb. -.SH OPTIONS -.TP -.I database -The database file to dump. -.SH FILES -.TP -.I /var/lib/wanna\-build -Database files. -.SH AUTHORS -Roman Hodek , -Ryan Murray , and -Roger Leigh . -.fi -.SH "SEE ALSO" -.BR wanna\-build (1). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff -Nru sbuild-0.60.9/man/wanna-build-mail.1.in sbuild-0.62.2/man/wanna-build-mail.1.in --- sbuild-0.60.9/man/wanna-build-mail.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/wanna-build-mail.1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -'\" tp -.\" Copyright © 2009 Roger Leigh -.\" -.\" 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 -.\" . -.TH WANNA\-BUILD\-MAIL 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" -.SH NAME -wanna\-build\-mail \- wanna\-build mail interface -.SH SYNOPSIS -.B wanna\-build\-mail -.B package -.br -.B wanna\-build\-catgdbm -.B package -.br -.B wanna\-build\-catmldbm -.B package -.SH VERSION -This man page documents the packaged version of wanna\-build. This version -is maintained by the \fBbuildd-tools\fP project developers on Alioth -(\f[CR]https://alioth.debian.org/projects/buildd\-tools/\fP). -.PP -There is also a version maintained by Ryan Murray which is adapted to build -daemon needs, with similar functionality. This version should be equally -capable of working in a buildd setup, but has a number of enhancements aimed at -making it suitable for use by end-users. -.SH DESCRIPTION -wanna\-build\-mail is used to drive wanna\-build though an email interface. -Set up wanna\-build\-mail as the mail filter for the wanna\-build user on your -system, then when you send this user mail, wanna\-build\-mail will run to -process the mail and query the database with the commands you specify in the -mail. -.PP -The mail processor sends a reply mail with all the program output to the -address the request came from (From: header). Alternatively, it obeys a -Reply-To: header if present. -.SH OVERVIEW -The email subject does not matter. The body must be signed with PGP, with a -key registered in /var/lib/wanna-build/mail-keyring.pgp. Only these keys are -authorised to use the mail interface. Additionally, the file mail-users in the -same directory is used to map PGP-key names to user names. -.PP -In the body (the PGP-signed part), you can write commands like: -.PP -\f[CR]wanna-build hello_1.0-1\fP -.br -\f[CR]uploaded tst1_1.0 tst2_0.99a\fP -.br -\f[CR]info hello\fP -.br -\f[CR]list needs-build failed\fP -.SH COMMANDS -The commands below are available. All be be abbreviated to their first letter -and must start in column 0. An argument \fIpackage_version\fP is the package -name and its version number, as usual with wanna-build. -.TP -.BR wanna-build " package_version " -.TP -.BR uploaded-build " package_version " -.TP -.BR failed-build " package_version " -The failed-build command also needs a failing message. You put this message in -the lines after the command, each line with some whitespace at the start. This -whitespace is stripped for the message actually passed to failed-build. The -first line without whitespace is treated as the next command. -.TP -.BR info package1 " [ " package2 " [ " packagen ]] -Get package information. No version number is required. -.TP -.BR list\ state1 " [ " state2 " [ " staten ]] -List packages in given states. Valid states are \fIinstalled\fP, -\fIneeds-build\fP, \fIbuilding\fP, \fIuploaded\fP, \fIfailed\fP, -\fInot-for-us\fP, and additionally \fIall\fP (for any state). -.TP -.BR vlist\ state1 " [ " state2 " [ " staten ]] -\fBvlist\fP is the same as list, but includes a \fI-v\fP option, so that -previous states and old failing messages are printed, too. -.PP -.SH FILES -.TP -.I /var/lib/wanna\-build -Database files. -.TP -.I /var/lib/wanna-build/mail-keyring.pgp -PGP keys of users authorised to use the mail interface. -.TP -.I /var/lib/wanna-build/mail-users -Mapping between PGP keys and system usernames. -.SH AUTHORS -Roman Hodek , -Ryan Murray , and -Roger Leigh . -.fi -.SH "SEE ALSO" -.BR wanna\-build (1). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff -Nru sbuild-0.60.9/man/wanna-build-merge-packages.1.in sbuild-0.62.2/man/wanna-build-merge-packages.1.in --- sbuild-0.60.9/man/wanna-build-merge-packages.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/wanna-build-merge-packages.1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -'\" tp -.\" Copyright © 2009 Roger Leigh -.\" -.\" 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 -.\" . -.TH WANNA\-BUILD\-MERGE\-PACKAGES 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" -.SH NAME -wanna\-build\-merge\-packages \- merge current Packages and Sources files into wanna\-build database -.SH SYNOPSIS -.B wanna\-build\-merge\-packages -.br -.B wanna\-build\-merge\-quinn -.RB [ "\-\-stat\-only" ] -.SH VERSION -This man page documents the packaged version of wanna\-build. This version -is maintained by the \fBbuildd-tools\fP project developers on Alioth -(\f[CR]https://alioth.debian.org/projects/buildd\-tools/\fP). -.PP -There is also a version maintained by Ryan Murray which is adapted to build -daemon needs, with similar functionality. This version should be equally -capable of working in a buildd setup, but has a number of enhancements aimed at -making it suitable for use by end-users. -.SH DESCRIPTION -wanna\-build\-merge\-packages is used to download Packages and Sources files -for each of the databases in the database directory and then update them -with the new information. wanna\-build\-merge\-quinn is used to merge current -quinn\-diff output into the database as well as make statistics. -.SH OPTIONS -.BR \-\-stat\-only -Only show statistics (wanna\-build\-merge\-quinn only). -.SH FILES -.TP -.I /var/lib/wanna\-build -Database files. -.SH AUTHORS -Roman Hodek , -Ryan Murray , and -Roger Leigh . -.fi -.SH "SEE ALSO" -.BR quinn\-diff (1), -.BR wanna\-build (1). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff -Nru sbuild-0.60.9/man/wanna-build-statistics.1.in sbuild-0.62.2/man/wanna-build-statistics.1.in --- sbuild-0.60.9/man/wanna-build-statistics.1.in 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/man/wanna-build-statistics.1.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -'\" tp -.\" Copyright © 2009 Roger Leigh -.\" -.\" 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 -.\" . -.TH WANNA\-BUILD\-STATISTICS 1 "@RELEASE_DATE@" "Version @VERSION@" "Debian sbuild" -.SH NAME -wanna\-build\-statistics \- print statistics for wanna\-build databases -.SH SYNOPSIS -.B wanna\-build\-statistics -.BR [ \-\-database=\fIdatabase\fP ] -.BR [ \-\-dist=\fIdistribution\fP ] -.BR [ \-\-verbose ] -.SH VERSION -This man page documents the packaged version of wanna\-build. This version -is maintained by the \fBbuildd-tools\fP project developers on Alioth -(\f[CR]https://alioth.debian.org/projects/buildd\-tools/\fP). -.PP -There is also a version maintained by Ryan Murray which is adapted to build -daemon needs, with similar functionality. This version should be equally -capable of working in a buildd setup, but has a number of enhancements aimed at -making it suitable for use by end-users. -.SH DESCRIPTION -wanna\-build\-statistics is used to print summary statistics for the given -database or distribution. -.SH OPTIONS -.TP -.BR \-\-database=\fIdatabase\fP -Database to use. -.TP -.BR \-\-dist=\fIdistribution\fP -Distribution to use. -.TP -.BR \-\-verbose -Verbose messages. -.SH FILES -.TP -.I /var/lib/wanna\-build -Database files. -.SH AUTHORS -Roman Hodek , -Ryan Murray , and -Roger Leigh . -.fi -.SH "SEE ALSO" -.BR wanna\-build (1). -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: diff -Nru sbuild-0.60.9/NEWS sbuild-0.62.2/NEWS --- sbuild-0.60.9/NEWS 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/NEWS 2011-04-05 09:45:09.000000000 +0000 @@ -1,12 +1,163 @@ NEWS -*- outline -*- ---- -Welcome to sbuild 0.60.9. Please read these release notes carefully. +Welcome to sbuild 0.62.2. 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.62.2: + + 1) New options --no-apt-clean, --no-apt-update, --no-apt-upgrade and + --no-apt-distupgrade have been added to allow these actions to be + disabled even when set as the default in the configuration. + + 2) --keep-session is replaced by + --purge-session=(always|successful|never). This will allow the + session to be purged for all, successful and no builds, + respectively. + + 3) $purge_session uses the same purge modes as $purge_build_deps and + $purge_build_directory, rather than a boolean value. + + 4) Log filtering may be disabled using $log_filter = 0 in the + configuration. The replacement text is now also surrounded with + "«" and "»" so that strings such as CHROOT and BUILDDIR can't be + confused with any actual appearance of the same string in the + build log. + + 5) Log colouring may be disabled using $log_colour = 0 in the + configuration. + +* Major changes in 0.62.1: + + 1) Fixed security issue in the sbuild-schroot wrapper program which + did not enforce sbuild group membership in order to allow users + to access the chroots as user sbuild. + +* Major changes in 0.62.0: + + 1) 'apt' is now the default build dependency resolver. Users should + not see any significant changes compared with the old 'internal' + resolver. Please note that you may need to generate a GPG key + for the local archive created for dependency package + installation, if one does not already exist; see sbuild-update + (--keygen) for further details. + + 2) The 'internal' build dependency resolver is deprecated. It is + not recommended for future use, and will be removed once it is no + longer used by the buildd infrastructure. Please use the 'apt' + resolver as a drop-in replacement. + + 3) The 'aptitude' build dependency resolver will, unlike 'apt' and + 'internal', consider alternative dependencies by default, rather + than only using the first alternative. This is intended to both + preserve backward compatibility, and make the 'aptitude' resolver + the preferred choice for more complex situations, such as + building for experimental. + + 4) sbuild.conf and buildd.conf are now automatically generated from + the help text and defaults in the source code. This means that + the examples will always be syntactically correct, the help text + will always be current, and the defaults will always match the + defaults in the source code. + + 5) All of the allowed values in sbuild.conf and buildd.conf are now + documented in the new sbuild.conf(5) and buildd.conf(5) manual + pages, respectively. Like sbuild.conf, this is entirely + generated from the source code, so will always match the defaults + for the same sbuild version. + + 6) Non-scalar (or reference) types are deprecated in sbuild.conf. + This is because it is not possible to tell the difference between + an empty and an undefined value. Values using array or hash + types should use the equivalent array reference or hash + reference, which have been supported for some time. The old + style array and hash values will remain supported for now, but + will be removed in a future release. + + 7) sbuild now performs an apt dist-upgrade at the start of each + build by default, rather than an upgrade. This is to reduce the + amount of manual administration required to keep chroots up to + date, and is not much more risky than upgrade in this context. + + 8) A new option, --keep-session, has been added. This prevents the + automatic removal of session-managed snapshot chroots. + Previously, snapshots would not be deleted if purging of the + build directory or build dependencies was disabled, but this was + not always desirable, hence it is now configurable separately. + + 9) Internally, building and other actions in the chroot are + performed by the 'sbuild' system user, where previously the user + invoking sbuild would be used instead. The aim of this change is + to separate privileges to increase security and reduce the chance + of accidental or deliberate tampering of the build environment. + While the latter is not addressed by these changes, this will be + taken care of during future architectural changes. + + 10) In order to handle errors more robustly, the build code now has + initial support for exception handling. Normal operation will + not be affected, but fatal errors may be logged in a different + order than seen previously. Fatal errors will now be seen at the + end of the build log, which should make it easier to spot + problems. + + 11) sbuild now always cleans up fully when receiving a termination + signal such as SIGINT or SIGTERM. Note that you may need to wait + while the cleanup actions are performed, or the current task is + completed prior to initiating cleanup. When running + interactively, hitting Ctrl-C will sent SIGINT to the entire + process group; doing this while apt-get or aptitude are running + will potentially leave dpkg in an inconsistent state, so aborting + at this point is not recommended. Sending a SIGTERM to the + sbuild process will always work cleanly. + + 12) Long paths such as the chroot location and the build directory + inside the chroot are now filtered in the build log and replaced + with small, constant, abbreviations. This makes the build logs + comparable between builds with tools such as diff(1). + + 13) Logging messages have been improved, and important messages are + now coloured when running interactively (does not affect log + files). Errors, warnings and informational messages are coloured + red, yellow and green, respectively. Build status is coloured + green for success and red for all failure conditions. + + 14) The sbuild package build directory created inside the chroot now + has a reduced name length. It's now /build/packagename-XXXXXX + where XXXXXX are random characters. This helps reduce the chance + of hitting path length restrictions on some architectures, + particularly when using sockets. + + 15) Build log mails are now compressed and mailed in MIME format by + default, together with a copy of the .changes file. The old + behaviour (plain mailing of uncompressed logs) may be restored by + setting $mime_build_log_mails=0 in the configuration, and + compression may also be disabled in the MIME mails by setting + $compress_build_log_mails=0. Note that it is no longer possible + to send compressed log mails unless MIME mailing is enabled. + + 16) The wanna-build database has been removed entirely. This part of + the sbuild package was not used, and was not maintained for some + time. Users wishing to use wanna-build should investigate the + version in the wanna-build.git repository used by the Debian + autobuilding infrastructure. This version is actively maintained + and in continual use. + + +* Major changes in 0.61.0: + + 1) The apt and aptitude build dependency resolvers now use only the + first alternative in alternative dependencies. The other + alternatives are stripped out entirely. This makes the apt and + aptitude resolvers behave exactly like the internal resolver. + Note that this is configurable with the $resolve_alternatives + option, so alternative resolving may be re-enabled with this + option if desired. This is useful for e.g. backports, but not + for unstable where the strict consistency and reproducibility + offered by only using the first alternative is required. + * Major changes in 0.60.9: 1) The architecture specified with --arch (defaulting to the host diff -Nru sbuild-0.60.9/scripts/depcomp sbuild-0.62.2/scripts/depcomp --- sbuild-0.60.9/scripts/depcomp 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/scripts/depcomp 2011-04-05 09:48:08.000000000 +0000 @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# 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, 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 . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru sbuild-0.60.9/test/Makefile.in sbuild-0.62.2/test/Makefile.in --- sbuild-0.60.9/test/Makefile.in 2011-02-15 00:18:06.000000000 +0000 +++ sbuild-0.62.2/test/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -112,21 +112,29 @@ AWK = @AWK@ BUILDD_CONF = @BUILDD_CONF@ BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -141,6 +149,7 @@ SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ SBUILD_COMPAT = @SBUILD_COMPAT@ SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ SCHROOT_CONF = @SCHROOT_CONF@ @@ -149,14 +158,14 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ -WANNA_BUILD_CONF = @WANNA_BUILD_CONF@ -WANNA_BUILD_LIBEXEC_DIR = @WANNA_BUILD_LIBEXEC_DIR@ -WANNA_BUILD_SYSCONF_DIR = @WANNA_BUILD_SYSCONF_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ diff -Nru sbuild-0.60.9/TODO sbuild-0.62.2/TODO --- sbuild-0.60.9/TODO 2011-02-15 00:16:27.000000000 +0000 +++ sbuild-0.62.2/TODO 2011-04-04 17:43:53.000000000 +0000 @@ -5,9 +5,6 @@ sbuild-createchroot should import most of buildd-make-chroot. (note: only needed for buildd use--accounts and passwords needed for access) -Split utility programs into library functions. Functions should operate on -chroot objects, or plain files where appropriate. - Chroot.pm: Move chroot naming out of begin_session. Are 'Build Start Time' and 'Pkg Start Time' different? @@ -55,42 +52,18 @@ Copyright details of new files. -ConfBase get/set code doesn't distinguish between undefined and empty - hashes (and also arrays?) Due to Perl automatically creating an - instance if the reference is undefined (autovivification). - Validate programs and paths only if required - programs which only work inside the chroot - programs which only work outside the chroot (if required by config) - programs which may or may not be required inside and/or outside -gzip log files - -send gzipped log mail, with correct headers -Content-Transfer-Encoding and Content-Type need setting. -message['Content-Transfer-Encoding'] = 'base64' -message['Content-Type'] = 'application/x-gzip' -https://buildd.debian.org/docs/log-compressor.py - Where did the 0.57.7 debian/changelog go to? buildd-mail: Why do we use lockfiles rather than real fcntl locks? -sbuild: Add alternative build-dep resolver support: - - traditional (current) - - apt_get (apt-get build-dep) - - apt_package (dependency package) - - aptitude (aptitude build-dep) - - aptitude_package (dependency package) - Move locking functions out of Sbuild::Build. Use proper locking in place of lockfiles. -Wannabuild::Database::send_reupload_mail unused. - -Wannabuild::Database: Move priority, section and category values into -configuration file to allow customisation. - Sbuild::Base: Add append method to simplify set(get() . ) idiom. buildd auto-restart isn't useful due to loss of @INC and failure to @@ -112,13 +85,6 @@ END blocks should be inside object destructors. -run|pipe_apt_command should be generic functions, not class -methods. - -Use ChrootRoot to run commands on host system. Remove CHROOT -parameter? Only needed for run_apt_command, which can work -accordingly without CHROOT. - buildd-vlog: Rather than tailing the output of sbuild logs, once buildd uses Sbuild::Build directly, the daemon will be able to do its own output (if desired). @@ -147,16 +113,9 @@ lib/Buildd: Move logger vfunc into Sbuild::Log as the default logger? -Add sbuild configuration option to disable package removal on cleanup. -(#528312) - -sbuild-* should use ChrootSetup. - -sbuild-checkpackage: Make functions to get and set the package list -in Sbuild::ChrootSetup. +Generalise chroot setup logic in Build.pm and Chroot.pm +Put all APT and debconf configuration into sbuild.conf. -sbuild-hold|unhold: Make functions to get and set the package list -in Sbuild::ChrootSetup. +Documentation improvements: -Generalise chroot setup logic in Build.pm and Chroot.pm -Put all APT and debconf configuration into sbuild.conf. \ No newline at end of file +- setup of cloned chroots (source-*) diff -Nru sbuild-0.60.9/tools/Makefile.am sbuild-0.62.2/tools/Makefile.am --- sbuild-0.60.9/tools/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/tools/Makefile.am 2011-04-04 23:03:13.000000000 +0000 @@ -0,0 +1,28 @@ +# sbuild Makefile template +# +# +# Copyright © 2004-2008 Roger Leigh +# +# sbuild 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 3 of the License, or +# (at your option) any later version. +# +# sbuild 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 +# . +# +##################################################################### + +include $(top_srcdir)/scripts/global.mk + +noinst_SCRIPTS = \ + sbuild-dumpconfig + +EXTRA_DIST = \ + $(noinst_SCRIPTS) diff -Nru sbuild-0.60.9/tools/Makefile.in sbuild-0.62.2/tools/Makefile.in --- sbuild-0.60.9/tools/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/tools/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -0,0 +1,394 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# sbuild Makefile template +# +# +# Copyright © 2004-2008 Roger Leigh +# +# sbuild 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 3 of the License, or +# (at your option) any later version. +# +# sbuild 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 +# . +# +##################################################################### + +# sbuild Makefile template +# +# +# Copyright © 2004-2007 Roger Leigh +# +# sbuild 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 3 of the License, or +# (at your option) any later version. +# +# sbuild 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 +# . +# +##################################################################### + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk +subdir = tools +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SCRIPTS = $(noinst_SCRIPTS) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDD_CONF = @BUILDD_CONF@ +BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL_MODULE_DIR = @PERL_MODULE_DIR@ +PLATFORM = @PLATFORM@ +RELEASE_DATE = @RELEASE_DATE@ +SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ +SBUILD_COMPAT = @SBUILD_COMPAT@ +SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ +SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ +SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ +SCHROOT_CONF = @SCHROOT_CONF@ +SCHROOT_SYSCONF_DIR = @SCHROOT_SYSCONF_DIR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Global options for use in all Makefiles. +perlmoddir = $(PERL_MODULE_DIR) +noinst_SCRIPTS = \ + sbuild-dumpconfig + +EXTRA_DIST = \ + $(noinst_SCRIPTS) + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru sbuild-0.60.9/tools/sbuild-dumpconfig sbuild-0.62.2/tools/sbuild-dumpconfig --- sbuild-0.60.9/tools/sbuild-dumpconfig 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/tools/sbuild-dumpconfig 2011-04-04 17:43:53.000000000 +0000 @@ -0,0 +1,158 @@ +#!/usr/bin/perl +# +# sbuild: build packages, obeying source dependencies +# Copyright © 1998-2000 Roman Hodek +# Copyright © 2005 Ryan Murray +# Copyright © 2005-2009 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 +# . +# +####################################################################### + +use strict; +use warnings; + +use Sbuild::Conf qw(); +use Buildd::Conf qw(); +use Sbuild::Sysconfig; +use Text::Wrap; +use Data::Dumper; + +die "Usage: $0 sbuild|buildd config|man" if @ARGV != 2; + +my $program = $ARGV[0]; +my $output = $ARGV[1]; + +$Sbuild::Sysconfig::paths{'SBUILD_CONF'} = '/invalid'; +$Sbuild::Sysconfig::paths{'BUILDD_CONF'} = '/invalid'; + +my $conf; +if ($program eq "sbuild") { + $conf = Sbuild::Conf::new(CHECK=>0); +} elsif ($program eq "buildd") { + $conf = Buildd::Conf::new(CHECK=>0); +} else { + die "Unsupported configuration type $program"; +} +exit 1 if !defined($conf); + + +die "Unsupported output type $output" + if ($output ne "config" && $output ne "man"); + + + +my @keys = sort $conf->get_keys(); + +# print "KEYS: " . join(", ", @keys) . "\n"; + +my %tmpgroups; + +foreach my $key (@keys) { +# print "KEY: $key, GROUP: " . $conf->_get_group($key) . "\n"; + $tmpgroups{$conf->_get_group($key)} = 1; +} + +my @groups = sort keys %tmpgroups; + +# print "GROUPS: " . join(",\n", @groups) . "\n"; + + +my $header = "# ${program}.conf: ${program} settings. -*- Perl -*-\n"; + +$header .= <_get_group($key) eq $group) { + my $type = $conf->_get_type($key); + my $varname = $conf->_get_varname($key); + my $help = $conf->_get_help($key); + my $default = $conf->_get_default($key); + my $ignore_default = $conf->_get_ignore_default($key); + if ($output eq "config") { + print "# $key\n"; + print "# Type: $type\n"; + if ($help) { + print wrap("# ", "# ", "$help\n"); + } + my $example = $conf->_get_example($key); + if ($example) { + foreach my $line (split("\n", $example)) { + print "# $line\n"; + } + } + print wrap("#", "#", Data::Dumper->Dump([$default], + ["$varname"])) + if (!$ignore_default); + print("\n"); + } elsif ($output eq "man") { + print ".TP\n"; + print ".BR $key\n"; + print "$type type.\n"; + if ($help) { + print wrap("", "", "$help\n"); + } + my $example = $conf->_get_example($key); + if ($example) { + print "Example:\n"; + print ".PP\n"; + print ".RS\n"; + foreach my $line (split("\n", $example)) { + print "\\f[CR]$line\\fP\n"; + print ".br\n" + } + print ".RE\n"; + } + if (!$ignore_default) { + print ".IP\n"; + print "Default:\n"; + print ".PP\n"; + print ".RS\n"; + foreach my $line (split("\n", + Data::Dumper->Dump([$default], + ["$varname"]))) { + print "\\f[CR]$line\\fP\n"; + print ".br\n" + } + print ".RE\n"; + } + } + } + } +} +if ($output eq "config") { + print "1;\n"; +} diff -Nru sbuild-0.60.9/VERSION sbuild-0.62.2/VERSION --- sbuild-0.60.9/VERSION 2011-02-15 00:18:03.000000000 +0000 +++ sbuild-0.62.2/VERSION 2011-04-05 09:48:03.000000000 +0000 @@ -1,5 +1,4 @@ Package: sbuild -Version: 0.60.9 -Release-Date: 14 Feb 2011 -Released-By: Roger Leigh -Git-Tag: release/sbuild-0.60.9 +Version: 0.62.2 +Release-Date: 05 Apr 2011 +Released-By: Unreleased diff -Nru sbuild-0.60.9/wrapper/Makefile.am sbuild-0.62.2/wrapper/Makefile.am --- sbuild-0.60.9/wrapper/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/wrapper/Makefile.am 2011-04-04 23:03:13.000000000 +0000 @@ -0,0 +1,33 @@ +# sbuild Makefile template +# +# +# Copyright © 2004-2011 Roger Leigh +# +# sbuild 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 3 of the License, or +# (at your option) any later version. +# +# sbuild 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 +# . +# +##################################################################### + +include $(top_srcdir)/scripts/global.mk + +sbuildlibexecdir = $(SBUILD_LIBEXEC_DIR) + +DEFS=-DSBUILD_LIBEXEC_DIR=\"$(SBUILD_LIBEXEC_DIR)\" + +sbuildlibexec_PROGRAMS = sbuild-schroot + +sbuild_schroot_SOURCES = \ + wrapper.cc \ + util.h \ + util.cc diff -Nru sbuild-0.60.9/wrapper/Makefile.in sbuild-0.62.2/wrapper/Makefile.in --- sbuild-0.60.9/wrapper/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/wrapper/Makefile.in 2011-04-05 09:48:08.000000000 +0000 @@ -0,0 +1,547 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# sbuild Makefile template +# +# +# Copyright © 2004-2011 Roger Leigh +# +# sbuild 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 3 of the License, or +# (at your option) any later version. +# +# sbuild 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 +# . +# +##################################################################### + +# sbuild Makefile template +# +# +# Copyright © 2004-2007 Roger Leigh +# +# sbuild 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 3 of the License, or +# (at your option) any later version. +# +# sbuild 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 +# . +# +##################################################################### + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/scripts/global.mk +sbuildlibexec_PROGRAMS = sbuild-schroot$(EXEEXT) +subdir = wrapper +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(sbuildlibexecdir)" +PROGRAMS = $(sbuildlibexec_PROGRAMS) +am_sbuild_schroot_OBJECTS = wrapper.$(OBJEXT) util.$(OBJEXT) +sbuild_schroot_OBJECTS = $(am_sbuild_schroot_OBJECTS) +sbuild_schroot_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_$(V)) +am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY)) +am__v_CXX_0 = @echo " CXX " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +AM_V_CXXLD = $(am__v_CXXLD_$(V)) +am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CXXLD_0 = @echo " CXXLD " $@; +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(sbuild_schroot_SOURCES) +DIST_SOURCES = $(sbuild_schroot_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDD_CONF = @BUILDD_CONF@ +BUILDD_SYSCONF_DIR = @BUILDD_SYSCONF_DIR@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = -DSBUILD_LIBEXEC_DIR=\"$(SBUILD_LIBEXEC_DIR)\" +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL_MODULE_DIR = @PERL_MODULE_DIR@ +PLATFORM = @PLATFORM@ +RELEASE_DATE = @RELEASE_DATE@ +SBUILD_CHROOT_CHECKS = @SBUILD_CHROOT_CHECKS@ +SBUILD_COMPAT = @SBUILD_COMPAT@ +SBUILD_CONF = @SBUILD_CONF@ +SBUILD_DATA_DIR = @SBUILD_DATA_DIR@ +SBUILD_LIBEXEC_DIR = @SBUILD_LIBEXEC_DIR@ +SBUILD_SYSCONF_DIR = @SBUILD_SYSCONF_DIR@ +SCHROOT_CONF = @SCHROOT_CONF@ +SCHROOT_SYSCONF_DIR = @SCHROOT_SYSCONF_DIR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Global options for use in all Makefiles. +perlmoddir = $(PERL_MODULE_DIR) +sbuildlibexecdir = $(SBUILD_LIBEXEC_DIR) +sbuild_schroot_SOURCES = \ + wrapper.cc \ + util.h \ + util.cc + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu wrapper/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu wrapper/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-sbuildlibexecPROGRAMS: $(sbuildlibexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(sbuildlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(sbuildlibexecdir)" + @list='$(sbuildlibexec_PROGRAMS)'; test -n "$(sbuildlibexecdir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbuildlibexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbuildlibexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-sbuildlibexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbuildlibexec_PROGRAMS)'; test -n "$(sbuildlibexecdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sbuildlibexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sbuildlibexecdir)" && rm -f $$files + +clean-sbuildlibexecPROGRAMS: + -test -z "$(sbuildlibexec_PROGRAMS)" || rm -f $(sbuildlibexec_PROGRAMS) +sbuild-schroot$(EXEEXT): $(sbuild_schroot_OBJECTS) $(sbuild_schroot_DEPENDENCIES) + @rm -f sbuild-schroot$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(sbuild_schroot_OBJECTS) $(sbuild_schroot_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrapper.Po@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(sbuildlibexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-sbuildlibexecPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-sbuildlibexecPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-sbuildlibexecPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-sbuildlibexecPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-sbuildlibexecPROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-sbuildlibexecPROGRAMS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru sbuild-0.60.9/wrapper/util.cc sbuild-0.62.2/wrapper/util.cc --- sbuild-0.60.9/wrapper/util.cc 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/wrapper/util.cc 2011-04-04 17:43:53.000000000 +0000 @@ -0,0 +1,250 @@ +/* Copyright © 2005-2007 Roger Leigh + * + * sbuild 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. + * + * sbuild 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 + * . + * + *********************************************************************/ + +#include + +#include "util.h" + +#include +#include +#include + +#include + +using namespace sbuild; + +sbuild::passwd::passwd (): + ::passwd(), + buffer(), + valid(false) +{ + clear(); +} + +sbuild::passwd::passwd (uid_t uid): + ::passwd(), + buffer(), + valid(false) +{ + clear(); + + query_uid(uid); +} + +sbuild::passwd::passwd (const char *name): + ::passwd(), + buffer(), + valid(false) +{ + clear(); + + query_name(name); +} + +sbuild::passwd::passwd (std::string const& name): + ::passwd(), + buffer(), + valid(false) +{ + clear(); + + query_name(name); +} + +void +sbuild::passwd::clear () +{ + valid = false; + + buffer.clear(); + + ::passwd::pw_name = 0; + ::passwd::pw_passwd = 0; + ::passwd::pw_uid = 0; + ::passwd::pw_gid = 0; + ::passwd::pw_gecos = 0; + ::passwd::pw_dir = 0; + ::passwd::pw_shell = 0; +} + +void +sbuild::passwd::query_uid (uid_t uid) +{ + buffer_type::size_type size = 1 << 7; + buffer.reserve(size); + int error; + + ::passwd *pwd_result; + + while ((error = getpwuid_r(uid, this, + &buffer[0], buffer.capacity(), + &pwd_result))) + { + size <<= 1; + buffer.reserve(size); + } + + if (pwd_result) + valid = true; + else + errno = error; +} + +void +sbuild::passwd::query_name (const char *name) +{ + buffer_type::size_type size = 1 << 8; + buffer.reserve(size); + int error; + + ::passwd *pwd_result; + + while ((error = getpwnam_r(name, this, + &buffer[0], buffer.capacity(), + &pwd_result))) + { + size <<= 1; + buffer.reserve(size); + } + + if (pwd_result) + valid = true; + else + errno = error; +} + +void +sbuild::passwd::query_name (std::string const& name) +{ + query_name(name.c_str()); +} + +bool +sbuild::passwd::operator ! () const +{ + return !valid; +} + +sbuild::group::group (): + ::group(), + buffer(), + valid(false) +{ + clear(); +} + +sbuild::group::group (gid_t gid): + ::group(), + buffer(), + valid(false) +{ + clear(); + + query_gid(gid); +} + +sbuild::group::group (const char *name): + ::group(), + buffer(), + valid(false) +{ + clear(); + + query_name(name); +} + +sbuild::group::group (std::string const& name): + ::group(), + buffer(), + valid(false) +{ + clear(); + + query_name(name); +} + +void +sbuild::group::clear () +{ + valid = false; + + buffer.clear(); + + ::group::gr_name = 0; + ::group::gr_passwd = 0; + ::group::gr_gid = 0; + ::group::gr_mem = 0; +} + +void +sbuild::group::query_gid (gid_t gid) +{ + buffer_type::size_type size = 1 << 7; + buffer.reserve(size); + int error; + + ::group *grp_result; + + while ((error = getgrgid_r(gid, this, + &buffer[0], buffer.capacity(), + &grp_result))) + { + size <<= 1; + buffer.reserve(size); + } + + if (grp_result) + valid = true; + else + errno = error; +} + +void +sbuild::group::query_name (const char *name) +{ + buffer_type::size_type size = 1 << 8; + buffer.reserve(size); + int error; + + ::group *grp_result; + + while ((error = getgrnam_r(name, this, + &buffer[0], buffer.capacity(), + &grp_result))) + { + size <<= 1; + buffer.reserve(size); + } + + if (grp_result) + valid = true; + else + errno = error; +} + +void +sbuild::group::query_name (std::string const& name) +{ + query_name(name.c_str()); +} + +bool +sbuild::group::operator ! () const +{ + return !valid; +} diff -Nru sbuild-0.60.9/wrapper/util.h sbuild-0.62.2/wrapper/util.h --- sbuild-0.60.9/wrapper/util.h 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/wrapper/util.h 2011-04-04 17:43:53.000000000 +0000 @@ -0,0 +1,194 @@ +/* Copyright © 2005-2007 Roger Leigh + * + * sbuild 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. + * + * sbuild 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 + * . + * + *********************************************************************/ + +#ifndef SBUILD_UTIL_H +#define SBUILD_UTIL_H + +#include +#include + +#include +#include +#include + +namespace sbuild +{ + + /** + * System passwd database entry + */ + class passwd : public ::passwd + { + public: + /// A buffer for reentrant passwd functions. + typedef std::vector buffer_type; + + /// The contructor. + passwd (); + + /** + * The constructor. + * + * @param uid the UID to search for. + */ + passwd (uid_t uid); + + /** + * The constructor. + * + * @param name the user name to search for. + */ + passwd (const char *name); + + /** + * The constructor. + * + * @param name the user name to search for. + */ + passwd (std::string const& name); + + /** + * Clear search result. The query result is undefined following + * this operation. + */ + void + clear (); + + /** + * Query using a UID. + * + * @param uid the UID to search for. + */ + void + query_uid (uid_t uid); + + /** + * Query using a name. + * + * @param name the user name to search for. + */ + void + query_name (const char *name); + + /** + * Query using a name. + * + * @param name the user name to search for. + */ + void + query_name (std::string const& name); + + /** + * Check if the query result is valid. + */ + bool + operator ! () const; + + private: + /// Query result buffer. + buffer_type buffer; + /// Object validity. + bool valid; + }; + + /** + * System group database entry + */ + class group : public ::group + { + public: + /// A buffer for reentrant group functions. + typedef std::vector buffer_type; + + /// The constructor. + group (); + + /** + * The constructor. + * + * @param gid the GID to search for. + */ + group (gid_t gid); + + /** + * The constructor. + * + * @param name the group name to search for. + */ + group (const char *name); + + /** + * The constructor. + * + * @param name the group name to search for. + */ + group (std::string const& name); + + /** + * Clear search result. The query result is undefined following + * this operation. + */ + void + clear (); + + /** + * Query using a GID. + * + * @param gid the GID to search for. + */ + void + query_gid (gid_t gid); + + /** + * Query using a name. + * + * @param name the group name to search for. + */ + void + query_name (const char *name); + + /** + * Query using a name. + * + * @param name the group name to search for. + */ + void + query_name (std::string const& name); + + /** + * Check if the query result is valid. + */ + bool + operator ! () const; + + private: + /// Query result buffer. + buffer_type buffer; + /// Object validity. + bool valid; + }; + +} + +#endif /* SBUILD_UTIL_H */ + +/* + * Local Variables: + * mode:C++ + * End: + */ diff -Nru sbuild-0.60.9/wrapper/wrapper.cc sbuild-0.62.2/wrapper/wrapper.cc --- sbuild-0.60.9/wrapper/wrapper.cc 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.62.2/wrapper/wrapper.cc 2011-04-04 17:43:53.000000000 +0000 @@ -0,0 +1,195 @@ +/* Copyright © 2005-2011 Roger Leigh + * + * sbuild 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. + * + * sbuild 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 + * . + * + *********************************************************************/ + +#include +#include +#include +#include +#include + +#include "util.h" + +using namespace sbuild; +/** + * Check group membership. + * + * @param group the group to check for. + * @returns true if the user is a member of group, otherwise false. + */ +bool +is_group_member (sbuild::group const& group) +{ + errno = 0; + + bool group_member = false; + if (group.gr_gid == getgid()) + { + group_member = true; + } + else + { + int supp_group_count = getgroups(0, 0); + if (supp_group_count < 0) + { + std::cerr << "Failed to get supplementary group count" << std::endl; + exit (1); + } + if (supp_group_count > 0) + { + gid_t *supp_groups = new gid_t[supp_group_count]; + assert (supp_groups); + if (getgroups(supp_group_count, supp_groups) < 1) + { + // Free supp_groups before throwing to avoid leak. + delete[] supp_groups; + std::cerr << "Failed to get supplementary groups: " + << strerror(errno) << std::endl; + exit(1); + } + + for (int i = 0; i < supp_group_count; ++i) + { + if (group.gr_gid == supp_groups[i]) + group_member = true; + } + delete[] supp_groups; + } + } + + return group_member; +} + +const char *sbuild_user = "sbuild"; +const char *sbuild_group = "sbuild"; + +int +main (int argc, char *argv[]) +{ + bool in_group = false; + + sbuild::group grp(sbuild_group); + if (!grp) + { + if (errno == 0) + { + std::cerr << "Group '" << sbuild_group << "' not found" << std::endl; + } + else + { + std::cerr << "Group '" << sbuild_group << "' not found: " + << strerror(errno) << std::endl; + } + exit(1); + } + + sbuild::passwd current_user(getuid()); + if (!current_user) + { + if (errno == 0) + { + std::cerr << "User '" << getuid() << "' not found" << std::endl; + } + else + { + std::cerr << "User '" << getuid() << "' not found: " + << strerror(errno) << std::endl; + } + exit(1); + } + + sbuild::passwd new_user(sbuild_user); + if (!new_user) + { + if (errno == 0) + { + std::cerr << "User '" << sbuild_user << "' not found" << std::endl; + } + else + { + std::cerr << "User '" << sbuild_user << "' not found: " + << strerror(errno) << std::endl; + } + exit(1); + } + + sbuild::group new_group(new_user.pw_gid); + if (!new_group) + { + if (errno == 0) + { + std::cerr << "Group '" << new_user.pw_gid << "' not found" << std::endl; + } + else + { + std::cerr << "Group '" << new_user.pw_gid << "' not found: " + << strerror(errno) << std::endl; + } + exit(1); + } + + // Check primary group + if (current_user.pw_gid == grp.gr_gid) + in_group = true; + + // Check supplementary groups + if (is_group_member(grp)) + in_group = true; + + // Root is allowed to skip the permissions checks, i.e. not be + // required to be in the sbuild group. + if (current_user.pw_uid != 0 && !in_group) { + std::cerr << "Permission denied: not a member of group sbuild" << std::endl; + exit(1); + } + + // Set primary group + if (setgid (new_user.pw_gid)) + { + std::cerr << "Failed to set group '" << new_group.gr_name << "': " + << strerror(errno) << std::endl; + exit(1); + } + + // Set supplementary groups + if (initgroups (new_user.pw_name, new_user.pw_gid)) + { + std::cerr << "Failed to set supplementary groups: " + << strerror(errno) << std::endl; + exit(1); + } + + // Set user + if (setuid (new_user.pw_uid)) + { + std::cerr << "Failed to set user '" << new_user.pw_name << "': " + << strerror(errno) << std::endl; + exit(1); + } + + // Check we're not still root + if (!setuid (0)) + { + std::cerr << "Failed to drop root permissions" << std::endl; + exit(1); + } + + // exec schroot under new identity + execvp("schroot", argv); + std::cerr << "Failed to exec 'schroot'" << std::endl; + exit(1); +}