diff -Nru sbuild-0.73.0/bin/Makefile.am sbuild-0.75.0/bin/Makefile.am --- sbuild-0.73.0/bin/Makefile.am 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/bin/Makefile.am 2018-03-21 21:22:44.000000000 +0000 @@ -28,6 +28,7 @@ sbuild-abort \ sbuild-apt \ sbuild-checkpackages \ + sbuild-debian-developer-setup \ sbuild-update \ sbuild-upgrade \ sbuild-distupgrade \ diff -Nru sbuild-0.73.0/bin/sbuild-createchroot sbuild-0.75.0/bin/sbuild-createchroot --- sbuild-0.73.0/bin/sbuild-createchroot 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/bin/sbuild-createchroot 2018-03-21 21:22:44.000000000 +0000 @@ -84,6 +84,9 @@ 'EXTRA_REPOSITORIES' => { DEFAULT => [] }, + 'COMMAND_PREFIX' => { + DEFAULT => '' + }, ); $conf->set_allowed_keys(\%createchroot_keys); @@ -160,6 +163,9 @@ }, "extra-repository=s" => sub { push @{$self->get_conf('EXTRA_REPOSITORIES')}, $_[1]; + }, + "command-prefix=s" => sub { + $self->set_conf('COMMAND_PREFIX', $_[1]); }); } @@ -177,6 +183,8 @@ use File::Temp qw(tempfile); use File::Copy; use Cwd qw(abs_path); +use IPC::Open3; +use File::Spec; sub add_items ($@); sub makedir ($$); @@ -209,11 +217,14 @@ } $chrootname .= "-" . $conf->get('BUILD_ARCH') . $conf->get('CHROOT_SUFFIX'); -open my $pipe, 'schroot -l --all-source-chroots |'; -while (my $line = <$pipe>) { +# We redirect stderr to /dev/null because otherwise schroot might print +# warnings on stderr which throws off autopkgtest +open(NULL, ">", File::Spec->devnull); +my $pid = open3(my $in = '', \*PH, \*NULL, 'schroot', '-l', '--all-source-chroots'); +while (my $line = ) { $line ne "source:$chrootname\n" or die "chroot with name $chrootname already exists"; } -close $pipe; +waitpid($pid, 0); # Create the target directory in advance so abs_path (which is buggy) # won't fail. Remove if abs_path is replaced by something better. @@ -359,9 +370,9 @@ } else { # Determine whether system has overlayfs capability my $uniontype = "none"; - if (lc("$^O") =~ /linux/) { - system(qw(/sbin/modprobe overlay)); - if (open(FILE, "/proc/filesystems")) { + if (lc("$^O") =~ /linux/ && -e '/sbin/modprobe') { + my $ret = system(qw(/sbin/modprobe overlay)); + if ($ret == 0 && open(FILE, "/proc/filesystems")) { if (grep {/\soverlay$/} ) { $uniontype = "overlay"; } @@ -381,6 +392,10 @@ $config_entry .= "aliases=$aliases\n"; } +if ($conf->get('COMMAND_PREFIX') ne '') { + $config_entry .= "command-prefix=" . $conf->get('COMMAND_PREFIX') . "\n"; +} + if (-d "/etc/schroot/chroot.d") { # TODO: Don't hardcode path my $SCHROOT_CONF = diff -Nru sbuild-0.73.0/bin/sbuild-debian-developer-setup sbuild-0.75.0/bin/sbuild-debian-developer-setup --- sbuild-0.73.0/bin/sbuild-debian-developer-setup 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.75.0/bin/sbuild-debian-developer-setup 2018-03-21 21:22:44.000000000 +0000 @@ -0,0 +1,71 @@ +#!/usr/bin/perl +# +# Set up sbuild so that packages for Debian unstable can be built and +# maintenance is done automatically via a daily update cronjob. +# Copyright © 2017 Michael Stapelberg . +# +# 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 v5.10; +use Getopt::Long; +use Sbuild qw(help_text version_text usage_error check_group_membership); + +my $dist = "debian"; +my $suite = "unstable"; + +my @options = ( + 'distribution=s' => \$dist, + 'suite=s' => \$suite, + 'help' => sub { help_text(1, "sbuild-debian-developer-setup") }, + ); +GetOptions(@options); + +if (!defined($ENV{SUDO_USER})) { + die "Please run sudo $0"; +} + +system("adduser", "--", $ENV{SUDO_USER}, "sbuild") == 0 + or die "adduser failed: $?"; + +chomp(my $arch = `dpkg --print-architecture`); + +sub chroot_exists { + system("schroot -i -c chroot:$suite-$arch-sbuild >/dev/null 2>&1") == 0 +} + +if (!chroot_exists()) { + system("sbuild-createchroot", + "--command-prefix=eatmydata", + "--include=eatmydata", + "--alias=UNRELEASED", + "--alias=sid", + "$suite", + "/srv/chroot/$suite-$arch-sbuild", + "http://localhost:3142/deb.debian.org/debian") == 0 + or die "sbuild-createchroot failed: $!"; +} else { + say "chroot $suite-$arch-sbuild already exists"; +} + +if (! -e "/etc/cron.daily/sbuild-debian-developer-setup-update-all") { + symlink("/usr/share/doc/sbuild/examples/sbuild-update-all", "/etc/cron.daily/sbuild-debian-developer-setup-update-all"); + say "ln -s /usr/share/doc/sbuild/examples/sbuild-update-all /etc/cron.daily/sbuild-debian-developer-setup-update-all"; +} + +say "Now run `newgrp sbuild', or log out and log in again."; diff -Nru sbuild-0.73.0/ChangeLog.in sbuild-0.75.0/ChangeLog.in --- sbuild-0.73.0/ChangeLog.in 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/ChangeLog.in 2018-03-21 21:22:44.000000000 +0000 @@ -7,6 +7,40 @@ README file also contains more specific notes regarding building and configuration. + * Major changes in 0.75.0: + + 1) buildd: only build arch:any packages + + 2) buildd: do not run lintian + + 3) remove harmful unnecessary lintian binary check + + * Major changes in 0.74.0: + + 1) Install dose-distcheck and lintian for the native architecture + + 2) remove DCMD config value which is not used and just uselessly making + libsbuild-perl depend on devscripts + + 3) use dpkg-query instead of grep-status so that dependency on grep-dctrl is + not needed anymore + + 4) suppress schroot writing to stderr in sbuild-createchroot + + 5) check for modprobe in sbuild-createchroot + + 6) Add missing newline character to a bunch of error messages + + 7) dose3 failures no longer mask the --build-deps-failed-commands + + 8) Build arch: all packages by default. + + 9) Run lintian by default. + + 10) sbuild-createchroot: add --command-prefix + + 11) add sbuild-debian-developer-setup package + * Major changes in 0.73.0: 1) starting-build-command and finished-build-commands are now run as root. diff -Nru sbuild-0.73.0/debian/changelog sbuild-0.75.0/debian/changelog --- sbuild-0.73.0/debian/changelog 2017-02-01 15:06:52.000000000 +0000 +++ sbuild-0.75.0/debian/changelog 2018-03-23 05:15:11.000000000 +0000 @@ -1,3 +1,55 @@ +sbuild (0.75.0-1ubuntu1) bionic; urgency=low + + * Merge from Debian Sid (LP: #1756195). Remaining changes: + - no-pkg-mangle-deps.patch: Set NO_PKG_MANGLE=1 when building dummy + packages, as pkgbinarymangler's dpkg-deb expects to be run from a source + package. + - utf-8-by-default.patch: Switch to C.UTF-8 by default. + - abs-path-revert.patch: Revert upstream commit that breaks lp-buildd by + causing symlinks to files not ending in .dsc to no longer be buildable. + + -- Simon Quigley Fri, 23 Mar 2018 00:15:11 -0500 + +sbuild (0.75.0-1) unstable; urgency=medium + + * New upstream release. + * buildd: only build arch:any packages (closes: #893608) + * buildd: do not run lintian + * remove harmful unnecessary lintian binary check (closes: #893226) + + -- Michael Stapelberg Wed, 21 Mar 2018 22:24:01 +0100 + +sbuild (0.74.0-1ubuntu1) bionic; urgency=medium + + * Merge from Debian Sid (LP: #1756195). Remaining changes: + - no-pkg-mangle-deps.patch: Set NO_PKG_MANGLE=1 when building dummy + packages, as pkgbinarymangler's dpkg-deb expects to be run from a source + package. + - utf-8-by-default.patch: Switch to C.UTF-8 by default. + - abs-path-revert.patch: Revert upstream commit that breaks lp-buildd by + causing symlinks to files not ending in .dsc to no longer be buildable. + + -- Simon Quigley Sat, 17 Mar 2018 00:56:58 -0500 + +sbuild (0.74.0-1) unstable; urgency=medium + + * New upstream release + * Install dose-distcheck and lintian for the native architecture + * remove DCMD config value which is not used and just uselessly making + libsbuild-perl depend on devscripts + * use dpkg-query instead of grep-status so that dependency on grep-dctrl is + not needed anymore + * suppress schroot writing to stderr in sbuild-createchroot + * check for modprobe in sbuild-createchroot + * Add missing newline character to a bunch of error messages + * dose3 failures no longer mask the --build-deps-failed-commands + * Build arch: all packages by default (closes: #870263) + * Run lintian by default (closes: #870263) + * sbuild-createchroot: add --command-prefix (closes: #870260) + * add sbuild-debian-developer-setup package (closes: #859867) + + -- Michael Stapelberg Wed, 14 Mar 2018 21:55:42 +0100 + sbuild (0.73.0-4ubuntu1) zesty; urgency=medium * Merge from Debian unstable. Remaining changes: diff -Nru sbuild-0.73.0/debian/control sbuild-0.75.0/debian/control --- sbuild-0.73.0/debian/control 2017-01-19 08:27:18.000000000 +0000 +++ sbuild-0.75.0/debian/control 2018-03-22 04:48:26.000000000 +0000 @@ -6,7 +6,8 @@ Uploaders: Johannes Schauer , Michael Banck , Francesco Paolo Lovergine , - Wookey + Wookey , + Michael Stapelberg Build-Depends: debhelper (>= 10) Build-Depends-Indep: groff-base, @@ -76,6 +77,23 @@ build-essential packages, plus those in the package build dependencies. +Package: sbuild-debian-developer-setup +Architecture: all +Depends: sbuild, + schroot, + apt-cacher-ng | apt-cacher, + cron-daemon, + ${misc:Depends}, + ${perl:Depends}, + ${shlibs:Depends} +Description: Convenience script to set up an sbuild environment for Debian Developers + Run "sudo sbuild-debian-developer-setup" to add the current user to the sbuild + group, create an schroot for building packages for Debian unstable, and create + a cronjob which updates said schroot daily. + . + This script assumes you are on an un-metered internet connection (daily schroot + updates might be costly otherwise). + Package: buildd Architecture: all Depends: adduser, diff -Nru sbuild-0.73.0/debian/NEWS sbuild-0.75.0/debian/NEWS --- sbuild-0.73.0/debian/NEWS 2017-02-01 15:03:34.000000000 +0000 +++ sbuild-0.75.0/debian/NEWS 2018-03-22 04:48:26.000000000 +0000 @@ -1,3 +1,11 @@ +sbuild (0.75.0-1) unstable; urgency=medium + + sbuild now builds arch:all packages by default. + sbuild now runs lintian by default. + + -- Michael Stapelberg Wed, 21 Mar 2018 22:25:31 +0100 + + sbuild (0.73.0-3) unstable; urgency=medium Generating a public/private keypair using "sbuild-update --keygen" for diff -Nru sbuild-0.73.0/debian/patches/0001-Install-dose-distcheck-and-lintian-for-the-native-ar.patch sbuild-0.75.0/debian/patches/0001-Install-dose-distcheck-and-lintian-for-the-native-ar.patch --- sbuild-0.73.0/debian/patches/0001-Install-dose-distcheck-and-lintian-for-the-native-ar.patch 2017-02-01 15:03:34.000000000 +0000 +++ sbuild-0.75.0/debian/patches/0001-Install-dose-distcheck-and-lintian-for-the-native-ar.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -From 2adfa29406612c5d9716d84ccdea4633621516ed Mon Sep 17 00:00:00 2001 -From: Johannes 'josch' Schauer -Date: Sun, 22 Jan 2017 14:37:33 +0100 -Subject: [PATCH 1/5] Install dose-distcheck and lintian for the native - architecture - -When crossbuilding, sbuild will try to install the host architecture -versions of dose-distcheck and lintian. This doesn't make much of a -difference for lintian as that package is Architecture:all right now but -dose-distcheck is Architecture:any and the host architecture version -will not be installable and/or executable. Lets explicitly install the -native version instead. ---- - lib/Sbuild/Build.pm | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm -index 9a767a20..b8a4b402 100644 ---- a/lib/Sbuild/Build.pm -+++ b/lib/Sbuild/Build.pm -@@ -1657,7 +1657,7 @@ sub run_lintian { - push @lintian_command, $dsc; - } - -- $resolver->add_dependencies('LINTIAN', 'lintian', "", "", "", "", ""); -+ $resolver->add_dependencies('LINTIAN', 'lintian:native', "", "", "", "", ""); - return 1 unless $resolver->install_core_deps('lintian', 'LINTIAN'); - - $session->run_command( -@@ -1885,7 +1885,7 @@ sub explain_bd_uninstallable { - # restrictions, we don't want to limit ourselves by it. In cases where - # apt cannot find a solution, this check is supposed to allow the user - # to know that choosing a different resolver might fix the problem. -- $resolver->add_dependencies('DOSE3', 'dose-distcheck', "", "", "", "", ""); -+ $resolver->add_dependencies('DOSE3', 'dose-distcheck:native', "", "", "", "", ""); - if (!$resolver->install_core_deps('dose3', 'DOSE3')) { - return 0; - } --- -2.11.0 - diff -Nru sbuild-0.73.0/debian/patches/0002-remove-DCMD-config-value-which-is-not-used-and-just-.patch sbuild-0.75.0/debian/patches/0002-remove-DCMD-config-value-which-is-not-used-and-just-.patch --- sbuild-0.73.0/debian/patches/0002-remove-DCMD-config-value-which-is-not-used-and-just-.patch 2017-02-01 15:03:34.000000000 +0000 +++ sbuild-0.75.0/debian/patches/0002-remove-DCMD-config-value-which-is-not-used-and-just-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From f7ca27402ccb5925ce54bafbae9de4eef8bf604e Mon Sep 17 00:00:00 2001 -From: Johannes 'josch' Schauer -Date: Sun, 22 Jan 2017 14:46:30 +0100 -Subject: [PATCH 2/5] remove DCMD config value which is not used and just - uselessly making libsbuild-perl depend on devscripts - ---- - lib/Sbuild/Conf.pm | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/lib/Sbuild/Conf.pm b/lib/Sbuild/Conf.pm -index 2df69c51..b70f721e 100644 ---- a/lib/Sbuild/Conf.pm -+++ b/lib/Sbuild/Conf.pm -@@ -368,14 +368,6 @@ sub setup ($) { - HELP => 'Additional command-line options for dpkg-source', - CLI_OPTIONS => ['--dpkg-source-opt', '--dpkg-source-opts'] - }, -- 'DCMD' => { -- TYPE => 'STRING', -- VARNAME => 'dcmd', -- GROUP => 'Programs', -- CHECK => $validate_program, -- DEFAULT => 'dcmd', -- HELP => 'Path to dcmd binary' -- }, - 'MD5SUM' => { - TYPE => 'STRING', - VARNAME => 'md5sum', --- -2.11.0 - diff -Nru sbuild-0.73.0/debian/patches/0003-use-dpkg-query-instead-of-grep-status-so-that-depend.patch sbuild-0.75.0/debian/patches/0003-use-dpkg-query-instead-of-grep-status-so-that-depend.patch --- sbuild-0.73.0/debian/patches/0003-use-dpkg-query-instead-of-grep-status-so-that-depend.patch 2017-02-01 15:03:34.000000000 +0000 +++ sbuild-0.75.0/debian/patches/0003-use-dpkg-query-instead-of-grep-status-so-that-depend.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -From 74e7d8a034e447aa8d8d17c73ef11b284e6c8b7d Mon Sep 17 00:00:00 2001 -From: Johannes 'josch' Schauer -Date: Sun, 22 Jan 2017 14:49:48 +0100 -Subject: [PATCH 3/5] use dpkg-query instead of grep-status so that dependency - on grep-dctrl is not needed anymore - ---- - lib/Sbuild.pm | 23 +++++++++++++---------- - 1 file changed, 13 insertions(+), 10 deletions(-) - -diff --git a/lib/Sbuild.pm b/lib/Sbuild.pm -index 61584b5b..d4ddf528 100644 ---- a/lib/Sbuild.pm -+++ b/lib/Sbuild.pm -@@ -156,23 +156,26 @@ sub dump_file ($) { - - # set and list saved package list (used by sbuild-checkpackages) - sub check_packages ($$) { -- my $chroot = shift; -+ my $session = shift; - my $mode = shift; - -- my $package_checklist = $chroot->get_conf('PACKAGE_CHECKLIST'); -- my $chroot_dir = $chroot->get('Location'); -+ my $package_checklist = $session->get_conf('PACKAGE_CHECKLIST'); -+ my $chroot_dir = $session->get('Location'); - - my (@status, @ref, @install, @remove); - -- if (! open STATUS, "grep-status -F Status -s Package ' installed' '$chroot_dir/var/lib/dpkg/status' | awk '{print \$2}' |" ) { -- print STDERR "Can't read dpkg status file in chroot: $!\n"; -- return 1; -- } -- while () { -+ my $pipe = $session->pipe_command({ -+ COMMAND => ['dpkg-query', '--show', '--showformat=${Package} ${db:Status-Status}\n'] -+ }); -+ while (<$pipe>) { - chomp; -- push @status, $_; -+ my @token = split / /, $_; -+ my $pkgname = shift @token; -+ my $state = shift @token; -+ next if $state ne "installed"; -+ push @status, $pkgname; - } -- if (! close STATUS) { -+ if (! close $pipe) { - print STDERR "Error reading dpkg status file in chroot: $!\n"; - return 1; - } --- -2.11.0 - diff -Nru sbuild-0.73.0/debian/patches/0004-suppress-schroot-writing-to-stderr-in-sbuild-createc.patch sbuild-0.75.0/debian/patches/0004-suppress-schroot-writing-to-stderr-in-sbuild-createc.patch --- sbuild-0.73.0/debian/patches/0004-suppress-schroot-writing-to-stderr-in-sbuild-createc.patch 2017-02-01 15:03:34.000000000 +0000 +++ sbuild-0.75.0/debian/patches/0004-suppress-schroot-writing-to-stderr-in-sbuild-createc.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -From 3188a1addeb18c745767987e53015d3538ad276d Mon Sep 17 00:00:00 2001 -From: Johannes 'josch' Schauer -Date: Sun, 22 Jan 2017 14:51:14 +0100 -Subject: [PATCH 4/5] suppress schroot writing to stderr in sbuild-createchroot - ---- - bin/sbuild-createchroot | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/bin/sbuild-createchroot b/bin/sbuild-createchroot -index 501f622d..4cd79aa7 100755 ---- a/bin/sbuild-createchroot -+++ b/bin/sbuild-createchroot -@@ -177,6 +177,8 @@ use File::Path qw(mkpath rmtree); - use File::Temp qw(tempfile); - use File::Copy; - use Cwd qw(abs_path); -+use IPC::Open3; -+use File::Spec; - - sub add_items ($@); - sub makedir ($$); -@@ -209,11 +211,14 @@ if (defined $conf->get('CHROOT_PREFIX') && $conf->get('CHROOT_PREFIX') ne "") { - } - $chrootname .= "-" . $conf->get('BUILD_ARCH') . $conf->get('CHROOT_SUFFIX'); - --open my $pipe, 'schroot -l --all-source-chroots |'; --while (my $line = <$pipe>) { -+# We redirect stderr to /dev/null because otherwise schroot might print -+# warnings on stderr which throws off autopkgtest -+open(NULL, ">", File::Spec->devnull); -+my $pid = open3(my $in = '', \*PH, \*NULL, 'schroot', '-l', '--all-source-chroots'); -+while (my $line = ) { - $line ne "source:$chrootname\n" or die "chroot with name $chrootname already exists"; - } --close $pipe; -+waitpid($pid, 0); - - # Create the target directory in advance so abs_path (which is buggy) - # won't fail. Remove if abs_path is replaced by something better. --- -2.11.0 - diff -Nru sbuild-0.73.0/debian/patches/0005-check-for-modprobe-in-sbuild-createchroot.patch sbuild-0.75.0/debian/patches/0005-check-for-modprobe-in-sbuild-createchroot.patch --- sbuild-0.73.0/debian/patches/0005-check-for-modprobe-in-sbuild-createchroot.patch 2017-02-01 15:03:34.000000000 +0000 +++ sbuild-0.75.0/debian/patches/0005-check-for-modprobe-in-sbuild-createchroot.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From af00d5790b4fa694e46e8bb8e9d547a6ed347c98 Mon Sep 17 00:00:00 2001 -From: Johannes 'josch' Schauer -Date: Sun, 22 Jan 2017 14:51:56 +0100 -Subject: [PATCH 5/5] check for modprobe in sbuild-createchroot - ---- - bin/sbuild-createchroot | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/bin/sbuild-createchroot b/bin/sbuild-createchroot -index 4cd79aa7..2d2bbe4a 100755 ---- a/bin/sbuild-createchroot -+++ b/bin/sbuild-createchroot -@@ -364,9 +364,9 @@ EOF - } else { - # Determine whether system has overlayfs capability - my $uniontype = "none"; -- if (lc("$^O") =~ /linux/) { -- system(qw(/sbin/modprobe overlay)); -- if (open(FILE, "/proc/filesystems")) { -+ if (lc("$^O") =~ /linux/ && -e '/sbin/modprobe') { -+ my $ret = system(qw(/sbin/modprobe overlay)); -+ if ($ret == 0 && open(FILE, "/proc/filesystems")) { - if (grep {/\soverlay$/} ) { - $uniontype = "overlay"; - } --- -2.11.0 - diff -Nru sbuild-0.73.0/debian/patches/series sbuild-0.75.0/debian/patches/series --- sbuild-0.73.0/debian/patches/series 2017-02-01 15:03:30.000000000 +0000 +++ sbuild-0.75.0/debian/patches/series 2018-03-23 05:14:22.000000000 +0000 @@ -1,8 +1,3 @@ -0001-Install-dose-distcheck-and-lintian-for-the-native-ar.patch -0002-remove-DCMD-config-value-which-is-not-used-and-just-.patch -0003-use-dpkg-query-instead-of-grep-status-so-that-depend.patch -0004-suppress-schroot-writing-to-stderr-in-sbuild-createc.patch -0005-check-for-modprobe-in-sbuild-createchroot.patch no-pkg-mangle-deps.patch abs-path-revert.patch utf-8-by-default.patch diff -Nru sbuild-0.73.0/debian/sbuild-debian-developer-setup.install sbuild-0.75.0/debian/sbuild-debian-developer-setup.install --- sbuild-0.73.0/debian/sbuild-debian-developer-setup.install 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.75.0/debian/sbuild-debian-developer-setup.install 2018-03-21 21:24:01.000000000 +0000 @@ -0,0 +1 @@ +usr/bin/sbuild-debian-developer-setup diff -Nru sbuild-0.73.0/debian/sbuild.install sbuild-0.75.0/debian/sbuild.install --- sbuild-0.73.0/debian/sbuild.install 2016-12-23 20:39:09.000000000 +0000 +++ sbuild-0.75.0/debian/sbuild.install 2018-03-22 04:48:26.000000000 +0000 @@ -1,5 +1,16 @@ debian/tmp/etc/sbuild etc -debian/tmp/usr/bin/sbuild* usr/bin +# sbuild*, but not sbuild-debian-developer-setup +debian/tmp/usr/bin/sbuild usr/bin +debian/tmp/usr/bin/sbuild-abort usr/bin +debian/tmp/usr/bin/sbuild-apt usr/bin +debian/tmp/usr/bin/sbuild-checkpackages usr/bin +debian/tmp/usr/bin/sbuild-clean usr/bin +debian/tmp/usr/bin/sbuild-distupgrade usr/bin +debian/tmp/usr/bin/sbuild-hold usr/bin +debian/tmp/usr/bin/sbuild-shell usr/bin +debian/tmp/usr/bin/sbuild-unhold usr/bin +debian/tmp/usr/bin/sbuild-update usr/bin +debian/tmp/usr/bin/sbuild-upgrade usr/bin debian/tmp/usr/sbin/sbuild* usr/sbin debian/tmp/usr/share/doc/sbuild usr/share/doc debian/tmp/usr/share/man/man1/sbuild* usr/share/man/man1 diff -Nru sbuild-0.73.0/lib/Buildd/Daemon.pm sbuild-0.75.0/lib/Buildd/Daemon.pm --- sbuild-0.73.0/lib/Buildd/Daemon.pm 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/lib/Buildd/Daemon.pm 2018-03-21 21:22:44.000000000 +0000 @@ -512,6 +512,7 @@ '--apt-update', '--no-apt-upgrade', '--no-apt-distupgrade', + '--no-run-lintian', '--batch', "--stats-dir=" . $self->get_conf('HOME') . "/stats", "--dist=" . $dist_config->get('DIST_NAME'); @@ -537,15 +538,11 @@ 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'; - } if ($dist_config->get('BUILT_ARCHITECTURE')) { if ($dist_config->get('BUILT_ARCHITECTURE') eq 'all') { push ( @sbuild_args, "--arch-all", "--no-arch-any" ); } else { - push ( @sbuild_args, "--arch=" . $dist_config->get('BUILT_ARCHITECTURE') ); + push ( @sbuild_args, "--no-arch-all", "--arch-any", "--arch=" . $dist_config->get('BUILT_ARCHITECTURE') ); } } push ( @sbuild_args, "--chroot=" . $dist_config->get('SBUILD_CHROOT') ) diff -Nru sbuild-0.73.0/lib/Sbuild/AptitudeResolver.pm sbuild-0.75.0/lib/Sbuild/AptitudeResolver.pm --- sbuild-0.73.0/lib/Sbuild/AptitudeResolver.pm 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/lib/Sbuild/AptitudeResolver.pm 2018-03-21 21:22:44.000000000 +0000 @@ -71,12 +71,12 @@ $self->log_subsubsection("Setup apt archive"); if (!$self->setup_apt_archive($dummy_pkg_name, @pkgs)) { - $self->log_error("Setting up apt archive failed"); + $self->log_error("Setting up apt archive failed\n"); return 0; } if (!$self->update_archive()) { - $self->log_error("Updating apt archive failed"); + $self->log_error("Updating apt archive failed\n"); return 0; } diff -Nru sbuild-0.73.0/lib/Sbuild/AptResolver.pm sbuild-0.75.0/lib/Sbuild/AptResolver.pm --- sbuild-0.73.0/lib/Sbuild/AptResolver.pm 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/lib/Sbuild/AptResolver.pm 2018-03-21 21:22:44.000000000 +0000 @@ -62,12 +62,12 @@ $self->log_subsubsection("Setup apt archive"); if (!$self->setup_apt_archive($dummy_pkg_name, @pkgs)) { - $self->log_error("Setting up apt archive failed"); + $self->log_error("Setting up apt archive failed\n"); return 0; } if (!$self->update_archive()) { - $self->log_error("Updating apt archive failed"); + $self->log_error("Updating apt archive failed\n"); return 0; } diff -Nru sbuild-0.73.0/lib/Sbuild/AspcudResolver.pm sbuild-0.75.0/lib/Sbuild/AspcudResolver.pm --- sbuild-0.73.0/lib/Sbuild/AspcudResolver.pm 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/lib/Sbuild/AspcudResolver.pm 2018-03-21 21:22:44.000000000 +0000 @@ -61,12 +61,12 @@ $self->log_subsubsection("Setup apt archive"); if (!$self->setup_apt_archive($dummy_pkg_name, @pkgs)) { - $self->log_error("Setting up apt archive failed"); + $self->log_error("Setting up apt archive failed\n"); return 0; } if (!$self->update_archive()) { - $self->log_error("Updating apt archive failed"); + $self->log_error("Updating apt archive failed\n"); return 0; } diff -Nru sbuild-0.73.0/lib/Sbuild/Build.pm sbuild-0.75.0/lib/Sbuild/Build.pm --- sbuild-0.73.0/lib/Sbuild/Build.pm 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/lib/Sbuild/Build.pm 2018-03-21 21:22:44.000000000 +0000 @@ -940,11 +940,12 @@ failstage => "run-build-failed-commands"); } } elsif($self->get('Pkg Fail Stage') eq 'install-deps' ) { + my $could_not_explain = undef; + if (defined $self->get_conf('BD_UNINSTALLABLE_EXPLAINER') && $self->get_conf('BD_UNINSTALLABLE_EXPLAINER') ne '') { if (!$self->explain_bd_uninstallable()) { - Sbuild::Exception::Build->throw(error => "Failed to explain bd-uninstallable", - failstage => "explain-bd-uninstallable"); + $could_not_explain = 1; } } @@ -952,6 +953,11 @@ Sbuild::Exception::Build->throw(error => "Failed to execute build-deps-failed-commands", failstage => "run-build-deps-failed-commands"); } + + if( $could_not_explain ) { + Sbuild::Exception::Build->throw(error => "Failed to explain bd-uninstallable", + failstage => "explain-bd-uninstallable"); + } } } @@ -1191,7 +1197,7 @@ my $pdsc = Dpkg::Control->new(type => CTRL_PKG_SRC); $pdsc->set_options(allow_pgp => 1); if (!$pdsc->parse($pipe, "$build_dir/$dsc")) { - $self->log_error("Error parsing $build_dir/$dsc"); + $self->log_error("Error parsing $build_dir/$dsc\n"); return 0; } @@ -1657,7 +1663,7 @@ push @lintian_command, $dsc; } - $resolver->add_dependencies('LINTIAN', 'lintian', "", "", "", "", ""); + $resolver->add_dependencies('LINTIAN', 'lintian:native', "", "", "", "", ""); return 1 unless $resolver->install_core_deps('lintian', 'LINTIAN'); $session->run_command( @@ -1885,7 +1891,7 @@ # restrictions, we don't want to limit ourselves by it. In cases where # apt cannot find a solution, this check is supposed to allow the user # to know that choosing a different resolver might fix the problem. - $resolver->add_dependencies('DOSE3', 'dose-distcheck', "", "", "", "", ""); + $resolver->add_dependencies('DOSE3', 'dose-distcheck:native', "", "", "", "", ""); if (!$resolver->install_core_deps('dose3', 'DOSE3')) { return 0; } @@ -2010,7 +2016,7 @@ PRIORITY => 0, DIR => $dscdir}); if (!$clog) { - $self->log_error("unable to read from dpkg-parsechangelog"); + $self->log_error("unable to read from dpkg-parsechangelog\n"); Sbuild::Exception::Build->throw(error => "unable to read from dpkg-parsechangelog", failstage => "check-unpacked-version"); } @@ -2026,7 +2032,7 @@ $self->log_subsubsection("Check disk space"); chomp(my $current_usage = $session->read_command({ COMMAND => ["du", "-k", "-s", "$dscdir"]})); if ($?) { - $self->log_error("du exited with non-zero exit status $?"); + $self->log_error("du exited with non-zero exit status $?\n"); Sbuild::Exception::Build->throw(error => "du exited with non-zero exit status $?", failstage => "check-space"); } $current_usage =~ /^(\d+)/; @@ -2039,7 +2045,7 @@ } close $pipe; if ($?) { - $self->log_error("df exited with non-zero exit status $?"); + $self->log_error("df exited with non-zero exit status $?\n"); Sbuild::Exception::Build->throw(error => "df exited with non-zero exit status $?", failstage => "check-space"); } if ($free < 2*$current_usage && $self->get_conf('CHECK_SPACE')) { @@ -2057,14 +2063,14 @@ PRIORITY => 0, DIR => $dscdir }); if (!$clogpipe) { - $self->log_error("unable to read from dpkg-parsechangelog"); + $self->log_error("unable to read from dpkg-parsechangelog\n"); Sbuild::Exception::Build->throw(error => "unable to read from dpkg-parsechangelog", failstage => "check-unpacked-version"); } my $clog = Dpkg::Control->new(type => CTRL_CHANGELOG); if (!$clog->parse($clogpipe, "$dscdir/debian/changelog")) { - $self->log_error("unable to parse debian/changelog"); + $self->log_error("unable to parse debian/changelog\n"); Sbuild::Exception::Build->throw(error => "unable to parse debian/changelog", failstage => "check-unpacked-version"); } @@ -2291,7 +2297,7 @@ DIR => $dscdir }); if (!$envcmd) { - $self->log_error("unable to open pipe"); + $self->log_error("unable to open pipe\n"); Sbuild::Exception::Build->throw(error => "unable to open pipe", failstage => "dump-build-env"); } @@ -2317,7 +2323,7 @@ my $pipe = $session->pipe_command($command); if (!$pipe) { - $self->log_error("unable to open pipe"); + $self->log_error("unable to open pipe\n"); Sbuild::Exception::Build->throw(error => "unable to open pipe", failstage => "dpkg-buildpackage"); } @@ -2674,15 +2680,17 @@ my $sum = 0; my $dscdir = $self->get('DSC Dir'); + my $build_dir = $self->get('Build Dir'); + my $pkgbuilddir = "$build_dir/$dscdir"; - # if the source package was not yet unpacked, then DSC Dir is undefined - # and we will not attempt to compute the required space - if (!defined $dscdir) { + # if the source package was not yet unpacked, we will not attempt to compute + # the required space. + unless( defined $dscdir && -d $dscdir) + { return -1; } - my $build_dir = $self->get('Build Dir'); - my $pkgbuilddir = "$build_dir/$dscdir"; + my ($space, $spacenum); # get the required space for the unpacked source package in the chroot diff -Nru sbuild-0.73.0/lib/Sbuild/Conf.pm sbuild-0.75.0/lib/Sbuild/Conf.pm --- sbuild-0.73.0/lib/Sbuild/Conf.pm 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/lib/Sbuild/Conf.pm 2018-03-21 21:22:44.000000000 +0000 @@ -138,7 +138,7 @@ TYPE => 'BOOL', VARNAME => 'build_arch_all', GROUP => 'Build options', - DEFAULT => 0, + DEFAULT => 1, HELP => 'Build architecture: all packages by default.', CLI_OPTIONS => ['--arch-all', '--no-arch-all'] }, @@ -368,14 +368,6 @@ HELP => 'Additional command-line options for dpkg-source', CLI_OPTIONS => ['--dpkg-source-opt', '--dpkg-source-opts'] }, - 'DCMD' => { - TYPE => 'STRING', - VARNAME => 'dcmd', - GROUP => 'Programs', - CHECK => $validate_program, - DEFAULT => 'dcmd', - HELP => 'Path to dcmd binary' - }, 'MD5SUM' => { TYPE => 'STRING', VARNAME => 'md5sum', @@ -1064,16 +1056,6 @@ TYPE => 'STRING', VARNAME => 'lintian', GROUP => 'Build validation', - CHECK => sub { - my $conf = shift; - my $entry = shift; - my $key = $entry->{'NAME'}; - - # Only validate if needed. - if ($conf->get('RUN_LINTIAN')) { - $validate_program->($conf, $entry); - } - }, DEFAULT => 'lintian', HELP => 'Path to lintian binary' }, @@ -1085,7 +1067,7 @@ my $conf = shift; $conf->check('LINTIAN'); }, - DEFAULT => 0, + DEFAULT => 1, HELP => 'Run lintian?', CLI_OPTIONS => ['--run-lintian', '--no-run-lintian'] }, diff -Nru sbuild-0.73.0/lib/Sbuild/ResolverBase.pm sbuild-0.75.0/lib/Sbuild/ResolverBase.pm --- sbuild-0.73.0/lib/Sbuild/ResolverBase.pm 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/lib/Sbuild/ResolverBase.pm 2018-03-21 21:22:44.000000000 +0000 @@ -1596,7 +1596,7 @@ { COMMAND => ['perl', '-e', $packagessourcescmd], USER => "root", DIR => $dummy_archive_dir}); if ($? ne 0) { - $self->log_error("cannot create dummy archive"); + $self->log_error("cannot create dummy archive\n"); return 0; } diff -Nru sbuild-0.73.0/lib/Sbuild.pm sbuild-0.75.0/lib/Sbuild.pm --- sbuild-0.73.0/lib/Sbuild.pm 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/lib/Sbuild.pm 2018-03-21 21:22:44.000000000 +0000 @@ -156,23 +156,26 @@ # set and list saved package list (used by sbuild-checkpackages) sub check_packages ($$) { - my $chroot = shift; + my $session = shift; my $mode = shift; - my $package_checklist = $chroot->get_conf('PACKAGE_CHECKLIST'); - my $chroot_dir = $chroot->get('Location'); + my $package_checklist = $session->get_conf('PACKAGE_CHECKLIST'); + my $chroot_dir = $session->get('Location'); my (@status, @ref, @install, @remove); - if (! open STATUS, "grep-status -F Status -s Package ' installed' '$chroot_dir/var/lib/dpkg/status' | awk '{print \$2}' |" ) { - print STDERR "Can't read dpkg status file in chroot: $!\n"; - return 1; - } - while () { + my $pipe = $session->pipe_command({ + COMMAND => ['dpkg-query', '--show', '--showformat=${Package} ${db:Status-Status}\n'] + }); + while (<$pipe>) { chomp; - push @status, $_; + my @token = split / /, $_; + my $pkgname = shift @token; + my $state = shift @token; + next if $state ne "installed"; + push @status, $pkgname; } - if (! close STATUS) { + if (! close $pipe) { print STDERR "Error reading dpkg status file in chroot: $!\n"; return 1; } diff -Nru sbuild-0.73.0/man/Makefile.am sbuild-0.75.0/man/Makefile.am --- sbuild-0.73.0/man/Makefile.am 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/man/Makefile.am 2018-03-21 21:22:44.000000000 +0000 @@ -35,6 +35,7 @@ sbuild-apt.1 \ sbuild-checkpackages.1 \ sbuild-createchroot.8 \ + sbuild-debian-developer-setup.1 \ sbuild-destroychroot.8 \ sbuild-hold.1 \ sbuild-setup.7 \ diff -Nru sbuild-0.73.0/man/sbuild.1.in sbuild-0.75.0/man/sbuild.1.in --- sbuild-0.73.0/man/sbuild.1.in 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/man/sbuild.1.in 2018-03-21 21:22:44.000000000 +0000 @@ -1175,9 +1175,8 @@ .BR sbuild.conf (5) for a detailed explanation of these configuration variables. .PP -By default, only \fBBUILD_ARCH_ANY\fR is set to true while \fBBUILD_ARCH_ALL\fR -and \fBBUILD_SOURCE\fR are set to false. So by default only architecture -specific binary packages will be built. This behaviour can be changed either by +By default, \fBBUILD_ARCH_ANY\fR and \fBBUILD_ARCH_ALL\fR are set to true while +\fBBUILD_SOURCE\fR is set to false. This behaviour can be changed either by using command line options or by modifying the configuration variables in your \fI~/.sbuildrc\fP. The relevant command line options to change the values of \fBBUILD_ARCH_ANY\fR, \fBBUILD_ARCH_ALL\fR and \fBBUILD_SOURCE\fR are diff -Nru sbuild-0.73.0/man/sbuild-createchroot.8.in sbuild-0.75.0/man/sbuild-createchroot.8.in --- sbuild-0.73.0/man/sbuild-createchroot.8.in 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/man/sbuild-createchroot.8.in 2018-03-21 21:22:44.000000000 +0000 @@ -37,6 +37,7 @@ .RB [ "\-\-no\-deb\-src" ] .RB [ "\-\-alias=\fIalias\fP" ] .RB [ \-\-extra\-repository=\fIspec\fP ] +.RB [ "\-\-command\-prefix=\fIprefix\fP" ] .B SUITE TARGET-DIRECTORY DEBIAN-MIRROR-URI .RB [ SCRIPT ] .PP @@ -206,6 +207,13 @@ build-dependencies. Note that the build chroot must already trust the key of this repository. See the EXAMPLES section for how to combine this option with --chroot-prefix and --alias. +.TP +.BR \-\-command\-prefix=\fIprefix\fP +Set the chroot \fIcommand-prefix\fP option as specified. A common use-case is +to specify eatmydata, thereby preventing all commands executed in the chroot +from syncing data to disk. See +.BR schroot.conf (5) +for more details. .SH TARBALL FILE When creating an sbuild tarball \fIfile\fP, the compression format used to generate the tarball depends on the entension used in \fIfile\fP. Here is a diff -Nru sbuild-0.73.0/man/sbuild-debian-developer-setup.1.in sbuild-0.75.0/man/sbuild-debian-developer-setup.1.in --- sbuild-0.73.0/man/sbuild-debian-developer-setup.1.in 1970-01-01 00:00:00.000000000 +0000 +++ sbuild-0.75.0/man/sbuild-debian-developer-setup.1.in 2018-03-21 21:22:44.000000000 +0000 @@ -0,0 +1,73 @@ +.\" Copyright © 2018 Michael Stapelberg +.\" +.\" 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\-DEBIAN\-DEVELOPER\-SETUP 1 "\*[RELEASE_DATE]" "Version \*[VERSION]" "Debian sbuild" +.SH NAME +sbuild\-debian\-developer\-setup \- set up sbuild so that packages for Debian unstable can be built +.SH SYNOPSIS +.BR sbuild\-debian\-developer\-setup +.RB [ \-h \[or] \-\-help ] +.RB [ \-\-distribution=\fIdistribution\fP ] +.RB [ \-\-suite=\fIsuite\fP ] +.SH DESCRIPTION + +\fBsbuild-debian-developer-setup\fR is a convenience script to set up an sbuild +environment for Debian Developers. + +When run, it adds the current user to the sbuild group, creates an schroot for +building packages for Debian unstable, and creates a cronjob which updates said +schroot daily. + +The script assumes you are on an un-metered internet connection (daily schroot +updates might be costly otherwise). +.SH OPTIONS +.TP +.BR \-h ", " \-\-help +Display this manual. +.TP +.BR \-V ", " \-\-version +Print version information. +.TP +.BR "\-\-distribution=\fIdistribution\fP" +Set up an sbuild chroot for \fIdistribution\fP. Defaults to "debian". +.TP +.BR "\-\-suite=\fIsuite\fP" +Set up an sbuild chroot for \fIsuite\fP. Defaults to "unstable". +.SH EXAMPLES +To set up sbuild and build the hello world Debian package, use: +.PP +\f[CR]% \f[CB]sudo sbuild\-debian\-developer\-setup\fP\fP\[CR] +.br +\f[CR]% \f[CB]newgrp sbuild\[CR] +.br +\f[CR]% \f[CB]sbuild -d unstable hello\[CR] +.br +.SH AUTHORS +.nf +Michael Stapelberg. +.fi +.SH COPYRIGHT +.nf +Copyright \[co] 2018 Michael Stapelberg . +.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.73.0/VERSION sbuild-0.75.0/VERSION --- sbuild-0.73.0/VERSION 2016-12-23 20:29:50.000000000 +0000 +++ sbuild-0.75.0/VERSION 2018-03-21 21:22:44.000000000 +0000 @@ -1,3 +1,3 @@ Package: sbuild -Version: 0.73.0 -Release-Date: 23 Dec 2016 +Version: 0.75.0 +Release-Date: 21 Mar 2018