diff -Nru sbuild-0.78.1/bin/sbuild-createchroot sbuild-0.79.0/bin/sbuild-createchroot --- sbuild-0.78.1/bin/sbuild-createchroot 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/bin/sbuild-createchroot 2020-02-05 16:22:21.000000000 +0000 @@ -24,6 +24,8 @@ use strict; use warnings; +umask 0022; + use English; use Sbuild::AptResolver; @@ -211,6 +213,14 @@ sub add_items ($@); sub makedir ($$); +my %personalities = ( + 'armel:arm64' => 'linux32', + 'armhf:arm64' => 'linux32', + 'i386:amd64' => 'linux32', + 'mipsel:mips64el' => 'linux32', + 'powerpc:ppc64' => 'linux32', +); + my $conf = Sbuild::Conf::new(); Conf::setup($conf); exit 1 if !defined($conf); @@ -607,11 +617,12 @@ # Detect whether personality might be needed. if ($conf->get('ARCH') ne $conf->get('BUILD_ARCH')) { # Take care of the known case(s). - if ($conf->get('BUILD_ARCH') eq 'i386' && - $conf->get('ARCH') eq 'amd64') { - $personality='linux32'; + my $key = $conf->get('BUILD_ARCH') . ':' . $conf->get('ARCH'); + if (exists $personalities{$key}) { + $personality = $personalities{$key}; $personality_message = - "I: Added personality=$personality automatically (i386 on amd64).\n"; + "I: Added personality=$personality automatically " . + "(" . $conf->get('BUILD_ARCH') . " on " . $conf->get('ARCH') . ").\n"; } else { $personality_message = "W: The selected architecture and the current architecture do not match\n" . diff -Nru sbuild-0.78.1/ChangeLog.in sbuild-0.79.0/ChangeLog.in --- sbuild-0.78.1/ChangeLog.in 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/ChangeLog.in 2020-02-05 16:22:21.000000000 +0000 @@ -7,6 +7,21 @@ README file also contains more specific notes regarding building and configuration. + * Major changes in 0.79.0: + + 1) sbuild-createchroot: handle building armel/armhf on arm64, mipsel on + mips64el and powerpc on ppc64 + + 2) avoid using gzip --keep option, gzip in wheezy doesn't have it + + 3) sbuild: add --dpkg-file-suffix option + + 4) sbuild: pass the right .changes file to lintian + + 5) sbuild-createchroot: use umask 0022 + + 6) sbuild: add APT_KEEP_DOWNLOADED_PACKAGES config variable + * Major changes in 0.78.1: None (bugfix release) diff -Nru sbuild-0.78.1/debian/changelog sbuild-0.79.0/debian/changelog --- sbuild-0.78.1/debian/changelog 2019-05-02 23:24:29.000000000 +0000 +++ sbuild-0.79.0/debian/changelog 2020-02-13 20:26:35.000000000 +0000 @@ -1,3 +1,35 @@ +sbuild (0.79.0-1ubuntu1) focal; urgency=low + + * Merge from Debian unstable. 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. + - 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. + - d/t/control: add isolation-machine to the test flags + * Dropped changes, included in Debian: + - d/t/build-procenv: only install the built package if the chroot it was + built in matches the release of the host system + + -- Steve Langasek Thu, 13 Feb 2020 12:26:35 -0800 + +sbuild (0.79.0-1) unstable; urgency=medium + + * Team upload. + * New upstream release. + * remove debian/patches (have been applied upstream) + * add buildd depends on devscripts and recommends on sudo (closes: #920335, + #774856) + * debian/tests/build-procenv: don't install packages from a different distro + (closes: #928366) + * pass the right .changes file to lintian (closes: #934721) + * sbuild-createchroot: use umask 0022 (closes: #921675) + * fix etc/sbuild-debian-developer-setup-update-all (closes: #922148) + * add apt_keep_downloaded_packages option (closes: #933723) + * add option --dpkg-file-suffix + + -- Ivo De Decker Wed, 05 Feb 2020 17:41:38 +0100 + sbuild (0.78.1-2ubuntu1) eoan; urgency=low * Merge from Debian unstable. Remaining changes: diff -Nru sbuild-0.78.1/debian/control sbuild-0.79.0/debian/control --- sbuild-0.78.1/debian/control 2019-04-03 16:12:01.000000000 +0000 +++ sbuild-0.79.0/debian/control 2020-02-05 21:43:14.000000000 +0000 @@ -100,8 +100,10 @@ sbuild (<< ${source:Version}.1~), sbuild (>= ${source:Version}), schroot, + devscripts, ${misc:Depends}, ${perl:Depends} +Recommends: sudo Suggests: wanna-build Replaces: sbuild, ubuntu-dev-tools (<= 0.83) Breaks: ubuntu-dev-tools (<= 0.83) diff -Nru sbuild-0.78.1/debian/patches/fix-disk-space-directory-check.patch sbuild-0.79.0/debian/patches/fix-disk-space-directory-check.patch --- sbuild-0.78.1/debian/patches/fix-disk-space-directory-check.patch 2019-04-03 11:59:20.000000000 +0000 +++ sbuild-0.79.0/debian/patches/fix-disk-space-directory-check.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Description: test $pkgbuilddir inside the chroot instead of $dscdir outside of it -Author: Aurelien Jarno - ---- a/lib/Sbuild/Build.pm -+++ b/lib/Sbuild/Build.pm -@@ -2776,16 +2776,14 @@ sub check_space { - my $sum = 0; - - my $dscdir = $self->get('DSC Dir'); -+ return -1 unless (defined $dscdir); -+ - my $build_dir = $self->get('Build Dir'); - my $pkgbuilddir = "$build_dir/$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; -- } -- -+ return -1 unless ($self->get('Session')->test_directory($pkgbuilddir)); - - my ($space, $spacenum); - diff -Nru sbuild-0.78.1/debian/patches/series sbuild-0.79.0/debian/patches/series --- sbuild-0.78.1/debian/patches/series 2019-05-02 23:24:29.000000000 +0000 +++ sbuild-0.79.0/debian/patches/series 2020-02-13 20:26:35.000000000 +0000 @@ -1,4 +1,2 @@ no-pkg-mangle-deps.patch abs-path-revert.patch -fix-disk-space-directory-check.patch -support-gzip-in-wheezy.patch diff -Nru sbuild-0.78.1/debian/patches/support-gzip-in-wheezy.patch sbuild-0.79.0/debian/patches/support-gzip-in-wheezy.patch --- sbuild-0.78.1/debian/patches/support-gzip-in-wheezy.patch 2019-04-03 11:58:53.000000000 +0000 +++ sbuild-0.79.0/debian/patches/support-gzip-in-wheezy.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -Description: gzip in wheezy lacks --keep option, so avoid using it. -Author: Mike Gabriel - ---- a/lib/Sbuild/ResolverBase.pm -+++ b/lib/Sbuild/ResolverBase.pm -@@ -1445,8 +1445,8 @@ - closedir($dh); - } - --system('gzip', '--keep', '--force', 'Packages') == 0 or die "gzip failed: $?\n"; --system('gzip', '--keep', '--force', 'Sources') == 0 or die "gzip failed: $?\n"; -+system('gzip -c --force Packages > Packages.gz') == 0 or die "gzip failed: $?\n"; -+system('gzip -c --force Sources > Sources.gz' ) == 0 or die "gzip failed: $?\n"; - - my $packages_md5 = hash_file('Packages', 'md5sum'); - my $sources_md5 = hash_file('Sources', 'md5sum'); diff -Nru sbuild-0.78.1/etc/sbuild-debian-developer-setup-update-all sbuild-0.79.0/etc/sbuild-debian-developer-setup-update-all --- sbuild-0.78.1/etc/sbuild-debian-developer-setup-update-all 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/etc/sbuild-debian-developer-setup-update-all 2020-02-05 16:22:21.000000000 +0000 @@ -30,26 +30,26 @@ # # 1. Update all sbuild chroots four times a day (at 00:15/06:15/12:15/18:15): # -# 15 */6 * * * root /usr/share/doc/sbuild/examples/sbuild-update-all +# 15 */6 * * * root /usr/share/doc/sbuild/examples/sbuild-debian-developer-setup-update-all # # 2. Update all sid sbuild chroots daily, and all jessie sbuild chroots weekly, # and log the latter to a separate file: # # PATTERN = sid-*-sbuild -# @daily root /usr/share/doc/sbuild/examples/sbuild-update-all +# @daily root /usr/share/doc/sbuild/examples/sbuild-debian-developer-setup-update-all # # PATTERN = jessie-*-sbuild # LOGFILE = /var/log/wheezy-chroot-update.log -# @weekly root /usr/share/doc/sbuild/examples/sbuild-update-all +# @weekly root /usr/share/doc/sbuild/examples/sbuild-debian-developer-setup-update-all # # The following will NOT work. Both of these jobs are executed at 00:15, so # the second one will refuse to run: # # PATTERN = foo-* -# 15 0 * * * root /usr/share/doc/sbuild/examples/sbuild-update-all +# 15 0 * * * root /usr/share/doc/sbuild/examples/sbuild-debian-developer-setup-update-all # # PATTERN = bar-* -# 15 0 * * * root /usr/share/doc/sbuild/examples/sbuild-update-all +# 15 0 * * * root /usr/share/doc/sbuild/examples/sbuild-debian-developer-setup-update-all # Output of sbuild-update invocations will be written to this file diff -Nru sbuild-0.78.1/lib/Sbuild/Build.pm sbuild-0.79.0/lib/Sbuild/Build.pm --- sbuild-0.78.1/lib/Sbuild/Build.pm 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/lib/Sbuild/Build.pm 2020-02-05 16:22:21.000000000 +0000 @@ -114,6 +114,7 @@ $self->set('Log Stream', undef); $self->set('Summary Stats', {}); $self->set('dpkg-buildpackage pid', undef); + $self->set('Dpkg Version', undef); # DSC, package and version information: $self->set_dsc($dsc); @@ -852,7 +853,8 @@ } $self->check_abort(); - $resolver->dump_build_environment(); + my $dpkg_version = $resolver->dump_build_environment(); + $self->set('Dpkg Version',Dpkg::Version->new($dpkg_version)); $self->check_abort(); if ($self->build()) { @@ -2357,6 +2359,19 @@ push (@{$buildcmd}, "-sa") if ($self->get_conf('BUILD_SOURCE') && $self->get_conf('FORCE_ORIG_SOURCE')); push (@{$buildcmd}, "-r" . $self->get_conf('FAKEROOT')); + if ($self->get_conf('DPKG_FILE_SUFFIX')) { + my $dpkg_version_ok = Dpkg::Version->new("1.18.11"); + if ($self->get('Dpkg Version') >= $dpkg_version_ok) { + my $changes = $self->get_changes(); + push (@{$buildcmd}, "--changes-option=-O../$changes"); + my $buildinfo = $self->get_buildinfo(); + push (@{$buildcmd}, "--buildinfo-option=-O../$buildinfo"); + } else { + $self->log("Ignoring dpkg file suffix: dpkg version too old\n"); + $self->set_conf('DPKG_FILE_SUFFIX',undef); + } + } + if (defined($self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')) && $self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')) { push (@{$buildcmd}, @{$self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')}); @@ -2601,8 +2616,9 @@ } my $sys_build_dir = $self->get_conf('BUILD_DIR'); - if (!open( F2, ">$sys_build_dir/$changes.new" )) { - $self->log("Cannot create $sys_build_dir/$changes.new: $!\n"); + my $F2 = $session->get_write_file_handle("$build_dir/$changes.new"); + if (!$F2) { + $self->log("Cannot create $build_dir/$changes.new\n"); $self->log("Distribution field may be wrong!!!\n"); if ($build_dir) { if(!$session->copy_from_chroot("$build_dir/$changes", ".")) { @@ -2611,14 +2627,21 @@ } } else { $pchanges->output(\*STDOUT); - $pchanges->output(\*F2); + $pchanges->output(\*$F2); + + close( $F2 ); - close( F2 ); - rename("$sys_build_dir/$changes.new", "$sys_build_dir/$changes") - or $self->log("$sys_build_dir/$changes.new could not be " . - "renamed to $sys_build_dir/$changes: $!\n"); - unlink("$build_dir/$changes") - if $build_dir; + $session->rename("$build_dir/$changes.new", "$build_dir/$changes"); + if ($? == 0) { + $self->log("$build_dir/$changes.new could not be " . + "renamed to $build_dir/$changes: $!\n"); + $self->log("Distribution field may be wrong!!!"); + } + if ($build_dir) { + if (!$session->copy_from_chroot("$build_dir/$changes", "$sys_build_dir")) { + $self->log("Could not copy $build_dir/$changes to $sys_build_dir"); + } + } } return $pchanges; @@ -2755,37 +2778,51 @@ return $envlist; } -sub get_changes { +sub get_build_filename { my $self=shift; - my $changes; + my $filetype=shift; + my $changes = $self->get('Package_SVersion'); if ($self->get_conf('BUILD_ARCH_ANY')) { - $changes = $self->get('Package_SVersion') . '_' . $self->get('Host Arch') . '.changes'; + $changes .= '_' . $self->get('Host Arch'); } elsif ($self->get_conf('BUILD_ARCH_ALL')) { - $changes = $self->get('Package_SVersion') . "_all.changes"; + $changes .= "_all"; } elsif ($self->get_conf('BUILD_SOURCE')) { - $changes = $self->get('Package_SVersion') . "_source.changes"; + $changes .= "_source"; } + my $suffix = $self->get_conf('DPKG_FILE_SUFFIX'); + $changes .= $suffix if ($suffix); + + $changes .= '.' . $filetype; + return $changes; } +sub get_changes { + my $self=shift; + return $self->get_build_filename("changes"); +} + +sub get_buildinfo { + my $self=shift; + return $self->get_build_filename("buildinfo"); +} + sub check_space { my $self = shift; my @files = @_; my $sum = 0; my $dscdir = $self->get('DSC Dir'); + return -1 unless (defined $dscdir); + my $build_dir = $self->get('Build Dir'); my $pkgbuilddir = "$build_dir/$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; - } - + return -1 unless ($self->get('Session')->test_directory($pkgbuilddir)); my ($space, $spacenum); diff -Nru sbuild-0.78.1/lib/Sbuild/Conf.pm sbuild-0.79.0/lib/Sbuild/Conf.pm --- sbuild-0.78.1/lib/Sbuild/Conf.pm 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/lib/Sbuild/Conf.pm 2020-02-05 16:22:21.000000000 +0000 @@ -404,6 +404,14 @@ HELP => 'Additional command-line options for dpkg-buildpackage.', CLI_OPTIONS => ['--debbuildopt', '--debbuildopts', '--jobs'] }, + 'DPKG_FILE_SUFFIX' => { + TYPE => 'STRING', + VARNAME => 'dpkg_file_suffix', + GROUP => 'Programs', + DEFAULT => '', + HELP => 'Suffix to add to filename for files generated by dpkg-buildpackage', + CLI_OPTIONS => ['--dpkg-file-suffix'] + }, 'DPKG_SOURCE' => { TYPE => 'STRING', VARNAME => 'dpkg_source', @@ -871,6 +879,13 @@ HELP => 'APT clean. 1 to enable running "apt-get clean" at the start of each build, or 0 to disable.', CLI_OPTIONS => ['--apt-clean', '--no-apt-clean'] }, + 'APT_KEEP_DOWNLOADED_PACKAGES' => { + TYPE => 'BOOL', + VARNAME => 'apt_keep_downloaded_packages', + GROUP => 'Chroot options', + DEFAULT => 0, + HELP => 'Keep downloaded packages in cache by APT. Controls APT::Keep-Downloaded-Packages option used when downloading dependencies. 1 to keep downloaded packages in cache, or 0 to delete them after installation.' + }, 'APT_UPDATE' => { TYPE => 'BOOL', VARNAME => 'apt_update', diff -Nru sbuild-0.78.1/lib/Sbuild/Options.pm sbuild-0.79.0/lib/Sbuild/Options.pm --- sbuild-0.78.1/lib/Sbuild/Options.pm 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/lib/Sbuild/Options.pm 2020-02-05 16:22:21.000000000 +0000 @@ -309,6 +309,9 @@ push(@{$self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')}, $_[1]); }, + "dpkg-file-suffix=s" => sub { + $self->set_conf('DPKG_FILE_SUFFIX', $_[1]); + }, "j|jobs=i" => sub { push(@{$self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')}, '-j'.$_[1]) diff -Nru sbuild-0.78.1/lib/Sbuild/ResolverBase.pm sbuild-0.79.0/lib/Sbuild/ResolverBase.pm --- sbuild-0.78.1/lib/Sbuild/ResolverBase.pm 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/lib/Sbuild/ResolverBase.pm 2020-02-05 16:22:21.000000000 +0000 @@ -115,8 +115,13 @@ print $F qq(APT::AutoRemove::SuggestsImportant "false";\n); print $F qq(APT::AutoRemove::RecommendsImportant "false";\n); print $F qq(Acquire::Languages "none";\n); # do not download translations - # remove packages from /var/cache/apt/archive/*.deb after installation - print $F qq(APT::Keep-Downloaded-Packages "false";\n); + + if ($self->get_conf('APT_KEEP_DOWNLOADED_PACKAGES')) { + print $F qq(APT::Keep-Downloaded-Packages "true";\n); + } else { + # remove packages from /var/cache/apt/archive/*.deb after installation + print $F qq(APT::Keep-Downloaded-Packages "false";\n); + } if ($self->get('Split')) { print $F "Dir \"$chroot_dir\";\n"; @@ -816,6 +821,7 @@ } $self->log("\n"); + return $status->{'dpkg-dev'}->{'Version'}; } sub run_apt { @@ -1445,8 +1451,8 @@ closedir($dh); } -system('gzip', '--keep', '--force', 'Packages') == 0 or die "gzip failed: $?\n"; -system('gzip', '--keep', '--force', 'Sources') == 0 or die "gzip failed: $?\n"; +system('gzip -c --force Packages > Packages.gz') == 0 or die "gzip failed: $?\n"; +system('gzip -c --force Sources > Sources.gz' ) == 0 or die "gzip failed: $?\n"; my $packages_md5 = hash_file('Packages', 'md5sum'); my $sources_md5 = hash_file('Sources', 'md5sum'); diff -Nru sbuild-0.78.1/man/sbuild.1.in sbuild-0.79.0/man/sbuild.1.in --- sbuild-0.78.1/man/sbuild.1.in 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/man/sbuild.1.in 2020-02-05 16:22:21.000000000 +0000 @@ -58,6 +58,7 @@ .RB [ \-\-debbuildopts=\fIoptions\fP ] .RB [ \-\-dpkg-source-opt=\fIoptions\fP ] .RB [ \-\-dpkg-source-opts=\fIoptions\fP ] +.RB [ \-\-dpkg-file-suffix=\fIsuffix\fP ] .RB [ \-p \[or] \-\-purge=\fPpurge-mode\fP ] .RB [ \-\-purge\-build=\fPpurge-mode\fP ] .RB [ \-\-purge\-deps=\fPpurge-mode\fP ] @@ -440,6 +441,13 @@ \fBNOTE:\fR The '\fI-b\fP', '\fI--before-build\fP' and '\fI--after-build\fP' options will always be passed to dpkg-source, respectively. .TP +.BR "\-\-dpkg-file-suffix=\fIsuffix\fP" +Add the suffix to the filename of the changes and buildinfo files generated by +dpkg. +.br +\fBNOTE:\fR This option is ignored if dpkg-dev in the build environment is too +old to support it. At least dpkg-dev 1.18.11 is required. +.TP .BR "\-\-mail\-log\-to=\fIemail-address\fP" Send the build log to the specified email address. This command line option sets the \fBMAILTO\fP configuration variable. See @@ -1589,7 +1597,7 @@ \f[CR]% \f[CB]sbuild \-d unstable bash.dsc\fP\fP .PP Or from within an unpacked source package (the -d parameter is not necessary -here because the distribution is inferred from debian/copyright): +here because the distribution is inferred from debian/changelog): .PP \f[CR]% \f[CB]sbuild\fP\fP .SH ENVIRONMENT VARIABLES diff -Nru sbuild-0.78.1/VERSION sbuild-0.79.0/VERSION --- sbuild-0.78.1/VERSION 2019-02-09 05:54:18.000000000 +0000 +++ sbuild-0.79.0/VERSION 2020-02-05 16:22:21.000000000 +0000 @@ -1,3 +1,3 @@ Package: sbuild -Version: 0.78.1 -Release-Date: 09 February 2019 +Version: 0.79.0 +Release-Date: 05 February 2020