Ok, so I found the problem.

Commit 1652a2e019b5cd50537f0d77425637ce44c9be44 (which introduced this issue)
added check for --no-apt-update to ResolverBase.pm:update_archive().
However, there's a parameter $apt_update passed to that function already.
This function is only called from install_deps() method (overloaded for
different resolvers), which always passes this $apt_update from the upper
layer.

And there are just 3 callers of install_deps():

lib/Sbuild/Build.pm:            if (!$resolver->install_deps(0, 'main', 
'MAIN')) {
lib/Sbuild/Build.pm:                    $resolver->uninstall_deps();
lib/Sbuild/Build.pm:    return 1 unless $resolver->install_deps(1, 'lintian', 
'LINTIAN');
lib/Sbuild/Build.pm:            if (!$resolver->install_deps(0, 'dose3', 
'DOSE3')) {
lib/Sbuild/Build.pm:                    if (!$resolver->install_deps(0, 
'fakeroot', 'FAKEROOT')) {

This is the first parameter - $apt_update.

As we can see, only one place - where we prepare for lintian -
alls install_deps() with apt_update being true.

Reverting 1652a2e019b5cd50 and making $apt_update=0 for lintian's
install_deps() makes everything working again -- provided we
don't clean apt caches, obviously.

But now, I don't see why we have this $apt_update parameter in the
first place - now it is always 0.  I don't know what was its intended
usage.

It looks like the real fix would be

1. revert 1652a2e019b5cd50.
2. drop first parameter from install_deps() and remove quite some code
3. when --no-apt-update is given, always turn on --no-apt-distclean
   (and mention this in the docs).

But since I don't understand the intention for $apt_update, I'm not
sure I should be doing #2.

Thanks,

/mjt

Reply via email to