Package: libsbuild-perl Version: 0.65.2-1 Severity: normal Tags: patch Hi, thanks for sbuild!
I noticed that packages in a repository given via --extra-repository that are preinstalled into the base chroot aren't upgraded to. For example I was trying to test building with GCC5 from a PPA of doko's and yet it wasn't being used during the build. It seems like these repos are added quite late on, just before installing the actual build-deps and *after* the initial upgrade/dist-upgrade. This means that build-deps are satisfied from this repo but things already in the chroot are left as they were. Attached is a patch to simply dist-upgrade after doing the later update. Do you think this makes sense? Note that (AFAICT) sbuild has carefully only updated its indices for the extra repository and its internal one, so this should avoid accidentally dist-upgrading from the main archive again if we get a race condition with a mirror pulse or similar. Note that I only tested the apt resolver and just assume the aptitude one is the same, sorry... Cheers, -- Iain Lane [ i...@orangesquash.org.uk ] Debian Developer [ la...@debian.org ] Ubuntu Developer [ la...@ubuntu.com ]
>From d417858acbc6474dd96c4dd8250f541b9db18044 Mon Sep 17 00:00:00 2001 From: Iain Lane <la...@debian.org> Date: Fri, 10 Jul 2015 15:45:53 +0100 Subject: [PATCH] lib/Sbuild/Apt{,itude}Resolver.pm: dist-upgrade after enabling the internal sources dist-upgrade after enabling our internal sources. This ensures that packages in a repo passed in via --extra-repository are used for the build if they are installed in the base chroot and not pulled in via build-deps (e.g. gcc). Previously there was no dist-upgrade after enabling the extra repo. --- lib/Sbuild/AptResolver.pm | 4 +++- lib/Sbuild/AptitudeResolver.pm | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Sbuild/AptResolver.pm b/lib/Sbuild/AptResolver.pm index 7485cda..c9d1796 100644 --- a/lib/Sbuild/AptResolver.pm +++ b/lib/Sbuild/AptResolver.pm @@ -62,7 +62,9 @@ sub install_deps { # Call functions to setup an archive to install dummy package. return 0 unless ($self->setup_apt_archive($dummy_pkg_name, @pkgs)); return 0 unless (!$self->update_archive()); - + # Upgrade the base chroot with packages from our dummy archive, which + # includes any extra repositories. + return 0 unless (!$self->distupgrade()); $self->log_subsection("Install $name build dependencies (apt-based resolver)"); diff --git a/lib/Sbuild/AptitudeResolver.pm b/lib/Sbuild/AptitudeResolver.pm index 4030382..cfba708 100644 --- a/lib/Sbuild/AptitudeResolver.pm +++ b/lib/Sbuild/AptitudeResolver.pm @@ -64,6 +64,9 @@ sub install_deps { # Call functions to setup an archive to install dummy package. return 0 unless ($self->setup_apt_archive($dummy_pkg_name, @pkgs)); return 0 unless (!$self->update_archive()); + # Upgrade the base chroot with packages from our dummy archive, which + # includes any extra repositories. + return 0 unless (!$self->distupgrade()); $self->log_subsection("Install $name build dependencies (aptitude-based resolver)"); -- 2.1.4