On Sat, 2 Mar 2013 00:21:29 +0000
Ryan Kuester <rkues...@insymbols.com> wrote:

> To enable use of `apt-get autoremove`, it is necessary that packages
> which are installed to satisfy dependencies (as opposed to those
> packages directly specified, e.g. via a section "packages" list) be
> marked as auto-installed in APT's extended_states database. apt-get
> normally does this, but not when APT::Get::Download-Only is set, as it
> is by multistrap.
> 
> The attached patch causes such packages to be so marked if
> 'markauto' is set to true in the general settings stanza of the
> configuration file, e.g.:

Interesting patch, I think there are problems though. The new function
relies on side-effects of the force_unpack operation. This needs to be
included in the addition to the documentation (that disabling unpack
requires causes the unavoidable disabling of markauto.) The function
call itself should be inside the force_unpack subroutine. (@archives
could be made a local variable at any stage.) Alternatively, mark_auto
needs to rebuild it's own @archives array and keep the two operations
separate, which is probably my preference.

The process also takes a significant amount of time - the start of the
function should use a translatable string as an informational message.
Something like: "Marking automatically installed packages... please
wait" - it could also do with a second message along the lines of
"Found %d packages to mark" and then a "Complete" type message at the
end.

Furthermore, markauto needs to be listed in the dump_config routine so
that --simulate shows if it is enabled (silent if default of disabled).

I'm also not sure about why a new trim function needs to be introduced
instead of using chomp.

my @all = map {
    `LC_ALL=C dpkg -f ${dir}${cachedir}archives/$_ Package`; 
} @archives; 
chomp (@all);

Have you tested this support cross-architecture? Does apt-mark
correctly handle the config_str to prevent pollution of the system
running multistrap? (Please describe if you've
checked /var/lib/apt/extended_states before and after inside the new
chroot and outside it, especially when the chroot is armel on an x86
system etc.)

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

Attachment: pgpPd2QRQopGO.pgp
Description: PGP signature

Reply via email to