Control: tag -1 + pending

Hi Ilias,

On Sun, 20 Nov 2016 18:37:12 +0200 Ilias Tsitsimpis <i.tsitsim...@gmail.com> 
wrote:
> On Thu, Nov 10, 2016 at 03:22AM, Johannes Schauer wrote:
> > I would say that this is a feature instead of a bug. Imagine it were the 
> > other
> > way round and sbuild would run "apt-get update" even if --no-apt-update was
> > specified, then I would get another bug report "sbuild runs apt-get update 
> > even
> > though --no-apt-update was given".
> 
> I believe these are two different things. In my understanding,
> `--no-apt-update' means do not update sbuild's default archive. The
> patch I provided does exactly that. It updates the extra repository, but
> not the default one (this is also what used to happen before).
> 
> > With what justification would you still run "apt-get update" even if
> > --no-apt-update was passed? I would've said that a user who uses
> > --extra-repositories just must not use --no-apt-update. Maybe sbuild should
> > even print a warning if they attempt to do so.
> 
> I believe that there is value in using both `--no-apt-update' and
> `--extra-repositories', especially when the extra repository is a local
> archive. In fact, that is the case with one of the tools used within the
> Debian Haskell Group (pkg-haskell-tools[1]), and the reason I am
> reporting this.
> 
> It seems to me that what is missing here, is a way to tell sbuild to
> not update the default archive, but also use the ones provided with
> `--extra-repositories'. pkg-haskell-tools uses the `--no-apt-update'
> flag to achieve this, but maybe this is not the right way to do this.
> 
> What do you think?

lets look at this from a different angle. If the user uses
--extra-repositories, then there is probably no reason why the user would ever
want sbuild *not* to update from this repository. It thus would make sense to
assume that passing --extra-repositories is an implicit request from the user
to update that repository or otherwise it would not be used - independent from
any other command line option.

I applied attached patch to my local git. If you want, you can make sure that
it fixes your issue.

Thanks!

cheers, josch
From c2d04d77d4c7daf2987a5d737b470fe7cea5200a Mon Sep 17 00:00:00 2001
From: Johannes 'josch' Schauer <jo...@mister-muffin.de>
Date: Thu, 22 Dec 2016 08:32:56 +0100
Subject: [PATCH] Unconditionally update repositories given via
 --extra-repository (closes: #842281)

---
 lib/Sbuild/Conf.pm         |  2 +-
 lib/Sbuild/ResolverBase.pm |  4 +++-
 man/sbuild.1.in            | 10 +++++++++-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/Sbuild/Conf.pm b/lib/Sbuild/Conf.pm
index 5322a00..b50d008 100644
--- a/lib/Sbuild/Conf.pm
+++ b/lib/Sbuild/Conf.pm
@@ -838,7 +838,7 @@ $environment_filter = [map /^FOOBAR$/ ? () : $_, Dpkg::Build::Info::get_build_en
 	    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.',
+	    HELP => 'APT update.  1 to enable running "apt-get update" at the start of each build, or 0 to disable. This option has no effect on updating the internal sbuild apt repository, the repository for extra packages (see EXTRA_PACKAGES) and the repositories given via EXTRA_REPOSITORIES. These are always updated. Thus, this option only influences updates of the default repositories of the chroot.',
 	    CLI_OPTIONS => ['--apt-update', '--no-apt-update']
 	},
 	'APT_UPDATE_ARCHIVE_ONLY'		=> {
diff --git a/lib/Sbuild/ResolverBase.pm b/lib/Sbuild/ResolverBase.pm
index ab08365..ab0a1f0 100644
--- a/lib/Sbuild/ResolverBase.pm
+++ b/lib/Sbuild/ResolverBase.pm
@@ -580,7 +580,9 @@ sub update_archive {
 	# available to it. (Note that the tempting optimization to run
 	# apt-get update -o pkgCacheFile::Generate=0 is broken before
 	# 872ed75 in apt 0.9.1.)
-	for my $list_file ($self->get('Dummy archive list file'), $self->get('Extra packages archive list file')) {
+	for my $list_file ($self->get('Dummy archive list file'),
+			   $self->get('Extra packages archive list file'),
+			   $self->get('Extra repositories archive list file')) {
 	    if (!$session->test_regular_file_readable($list_file)) {
 		next;
 	    }
diff --git a/man/sbuild.1.in b/man/sbuild.1.in
index 67302db..67e7573 100644
--- a/man/sbuild.1.in
+++ b/man/sbuild.1.in
@@ -308,6 +308,10 @@ for more information.
 .BR "\-\-no\-apt\-update"
 Run (or do not run) apt-get update in the chroot before executing the build,
 overriding the default setting.
+This option has no effect on updating the internal sbuild apt repository, the
+repository for extra packages (see --extra-package) and the repositories given
+via --extra-repository. These are always updated. Thus, this option only
+influences updates of the default repositories of the chroot.
 This command line option sets the \fBAPT_UPDATE\fP configuration variable. See
 .BR sbuild.conf (5)
 for more information.
@@ -773,7 +777,11 @@ for more information.
 .TP
 .BR \-\-chroot\-update\-failed\-commands=\fIstring\fP
 Run these commands after any of 'apt-get update', 'apt-get upgrade' or 'apt-get
-dist-upgrade' failed. The environment is intact, and the failure can be
+dist-upgrade' failed.
+This hook is not run for updates of the internal sbuild apt repository, the
+repository for extra packages (see --extra-package) and the repositories given
+via --extra-repository.
+The environment is intact, and the failure can be
 investigated. Especially %SBUILD_SHELL is useful here. This option can be used
 multiple times to add multiple commands. Certain percent escapes are supported.
 To write a literal percent sign, escape it with another percent sign.See the
-- 
2.9.3

Attachment: signature.asc
Description: signature

Reply via email to