Subject: aptitude: Fails to obey '-o "#clear DPkg::Pre-Install-Pkgs;"'
Date: Wed, 08 Jun 2011 09:51:29 +1200
Package: aptitude
Version: 0.6.3-3.2
Severity: normal
The command line:
apt-get -q -y -o "#clear DPkg::Pre-Install-Pkgs;" install somepkg
still causes dpkg-preconfigure to be used to preconfigure packages, when the line:
DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
is present in /etc/apt/apt.conf.d/70debconf
The equivalent invocation of apt-get successfully inhibits the preconfiguration.
I note that:
apt-config -o "#clear DPkg::Pre-Install-Pkgs;" dump
fails to parse the option and barfs, insisting that the option must contain an "=".
Perhaps this is related?
Cheers,
Nick
-- Package-specific info:
aptitude 0.6.3 compiled at Oct 16 2010 18:18:04
Compiler: g++ 4.4.5
Compiled against:
apt version 4.10.1
NCurses version 5.7
libsigc++ version: 2.2.4.2
Ept support enabled.
Gtk+ support disabled.
Current library versions:
NCurses version: ncurses 5.7.20100313
cwidget version: 0.5.16
Apt version: 4.10.1
linux-vdso.so.1 => (0x00007fff09fff000)
libapt-pkg.so.4.10 => /usr/lib/libapt-pkg.so.4.10 (0x00007f1c28d92000)
libncursesw.so.5 => /lib/libncursesw.so.5 (0x00007f1c28b3f000)
libsigc-2.0.so.0 => /usr/lib/libsigc-2.0.so.0 (0x00007f1c28939000)
libcwidget.so.3 => /usr/lib/libcwidget.so.3 (0x00007f1c2866d000)
libept.so.1 => /usr/lib/libept.so.1 (0x00007f1c28419000)
libxapian.so.22 => /usr/lib/libxapian.so.22 (0x00007f1c28038000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f1c27e21000)
libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007f1c27b8a000)
libboost_iostreams.so.1.42.0 => /usr/lib/libboost_iostreams.so.1.42.0 (0x00007f1c2796e000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f1c27752000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f1c2743e000)
libm.so.6 => /lib/libm.so.6 (0x00007f1c271bb000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f1c26fa5000)
libc.so.6 => /lib/libc.so.6 (0x00007f1c26c44000)
libutil.so.1 => /lib/libutil.so.1 (0x00007f1c26a40000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f1c2683c000)
libuuid.so.1 => /lib/libuuid.so.1 (0x00007f1c26637000)
libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00007f1c26427000)
librt.so.1 => /lib/librt.so.1 (0x00007f1c2621f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1c290ae000)
Terminal: xterm
$DISPLAY is set.
`which aptitude`: /usr/bin/aptitude
aptitude version information:
aptitude linkage:
-- System Information:
Debian Release: 6.0.1
APT prefers stable
APT policy: (990, 'stable'), (500, 'stable-updates')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-xen-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages aptitude depends on:
ii apt [libapt-pkg4.10] 0.8.10.3 Advanced front-end for dpkg
ii libboost-iostreams1.42. 1.42.0-4 Boost.Iostreams Library
ii libc6 2.11.2-10 Embedded GNU C Library: Shared lib
ii libcwidget3 0.5.16-3 high-level terminal interface libr
ii libept1 1.0.4 High-level library for managing De
ii libgcc1 1:4.4.5-8 GCC support library
ii libncursesw5 5.7+20100313-5 shared libraries for terminal hand
ii libsigc++-2.0-0c2a 2.2.4.2-1 type-safe Signal Framework for C++
ii libsqlite3-0 3.7.3-1 SQLite 3 shared library
ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3
ii libxapian22 1.2.3-2 Search engine library
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
Versions of packages aptitude recommends:
ii apt-xapian-index 0.41 maintenance and search tools for a
ii aptitude-doc-en [aptitude-doc 0.6.3-3.2 English manual for aptitude, a ter
ii libparse-debianchangelog-perl 1.1.1-2.1 parse Debian changelogs and output
ii sensible-utils 0.0.4 Utilities for sensible alternative
Versions of packages aptitude suggests:
pn debtags <none> (no description available)
ii tasksel 2.88 Tool for selecting tasks for insta
-- no debconf information
Acknowledgement sent
to Nick Phillips <[email protected]>:
Extra info received and forwarded to list. Copy sent to Daniel Burrows <[email protected]>.
(Wed, 20 Jul 2011 04:27:03 GMT) (full text, mbox, link).
Initial command line described as failing should have started with
"aptitude", not "apt-get"!
I note that it seems apt-get may now also be exhibiting this behaviour;
perhaps it has now been compiled against the same library version that
aptitude already had?
Cheers,
Nick
--
Nick Phillips / +64 3 479 4195 / [email protected]
# these statements are my own, not those of the University of Otago
Acknowledgement sent
to Daniel Hartwig <[email protected]>:
Extra info received and forwarded to list. Copy sent to Daniel Burrows <[email protected]>.
(Sat, 17 Dec 2011 05:12:05 GMT) (full text, mbox, link).
retitle 587671 aptitude: cmdline actions ignoring -o options
usertags 587671 + config next
forcemerge 587671 629590 652234
--
Hello
These are all the same issue caused by the logic in main.cc:
1. load config files
2. set some "state variables" from config/defaults
char *status_fname=NULL;
string package_display_format = aptcfg->Find(PACKAGE
"::CmdLine::Package-Display-Format", "%c%a%M %p# - %d#");
...
string width=aptcfg->Find(PACKAGE "::CmdLine::Package-Display-Width", "");
...
3. process options in order
3a. most options update the state variables
case 'F':
package_display_format=optarg;
version_display_format = optarg;
break;
case 'w':
width=optarg;
break;
3b. some options (and any use of `-o') update the config
case 'o':
...
aptcfg->SetNoUser(key, value);
4. run requested action based on state variables, not config
else if(!strcasecmp(argv[optind], "search"))
return cmdline_search(argc-optind, argv+optind,
status_fname,
package_display_format, width,
sort_policy,
disable_columns,
debug_search);
So the problem is that during this initial phase aptitude has two
inconsistent ideas about it's configuration -- the state variables and
the aptcfg object. Changing most config options via `-o' is never
noticed by the state variables.
I am inclined towards the following course of action:
i. Modify the order of things above so that the state variables are
set *after* processing the command line options, which means
changing the options of 3a. to modify aptcfg instead of these
variables.
This fixes the immediate problem of -o options being ignored.
ii. Investigate how many of these state variables are really needed
and migrate most of them to having each action refer to aptcfg
directly. Some points worth considering:
- the curses ui dynamically updates aptcfg and the state variables
must be updated accordingly (duplicated effort and storage =
error prone; though I assume this is handled by registering
signals)
- there is a lot of passing of the state variables to various
functions, which makes invoking them hairy. Each function knows
which config options it is interested and could *probably* just
extract these from aptcfg as appropriate.
- if there are config options which are parsed in to a data
structure, this can be handled in a similar fashion to apt-pkg's
handling of, e.g., acquire::compressiontypes (see
apt-pkg/aptconfiguration.cc)
Any thoughts on this?
I will look at tackling step i very soon.
Information stored
: Bug#629590; Package aptitude.
(Sat, 17 Dec 2011 06:45:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Daniel Hartwig <[email protected]>:
Extra info received and filed, but not forwarded.
(Sat, 17 Dec 2011 06:45:03 GMT) (full text, mbox, link).
Subject: Re: aptitude: Fails to obey '-o "#clear DPkg::Pre-Install-Pkgs;"'
Date: Sun, 22 Jan 2012 17:19:38 +0800
tags 656844 + patch
block 629590 by 656844
thanks
> The command line:
> apt-get -q -y -o "#clear DPkg::Pre-Install-Pkgs;" install somepkg
I assume you mean "aptitude -q ..." here.
>
> still causes dpkg-preconfigure to be used to preconfigure packages, when the line:
> DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
>
> is present in /etc/apt/apt.conf.d/70debconf
>
>
> The equivalent invocation of apt-get successfully inhibits the preconfiguration.
Which version of apt-get is that? On sid I get:
# apt-get -q -y -o "#clear DPkg::Pre-Install-Pkgs;" install somepkg
E: Option #clear DPkg::Pre-Install-Pkgs;: Configuration item
specification must have an =<val>.
I have submitted a patch to support this in libapt-pkg [1]. Aptitude
should soon make use of the same library to parse its command-line
[2], which will resolve this issue.
Otherwise, it is simple to implement the same patch is aptitude's
current parser.
[1] http://bugs.debian.org/656844
[2] http://anonscm.debian.org/gitweb/?p=aptitude/aptitude.git;a=shortlog;h=refs/heads/wip-cmdline
Acknowledgement sent
to Nick Phillips <[email protected]>:
Extra info received and forwarded to list. Copy sent to Aptitude Development Team <[email protected]>.
(Tue, 07 Aug 2012 00:09:03 GMT) (full text, mbox, link).
Sorry, didn't see this until just now - think I need to update my mail
forwarding!
> Which version of apt-get is that?
No longer sure, but it seems that I noticed it change between June and
July last year (2011) - may have been lenny version that worked and
squeeze that doesn't?
Cheers,
Nick
--
Nick Phillips / +64 3 479 4195 / [email protected]
# these statements are my own, not those of the University of Otago
Acknowledgement sent
to "Manuel A. Fernandez Montecelo" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Aptitude Development Team <[email protected]>.
(Thu, 05 May 2016 10:51:05 GMT) (full text, mbox, link).
Subject: Re: aptitude: Fails to obey '-o "#clear DPkg::Pre-Install-Pkgs;"'
Date: Thu, 5 May 2016 11:48:09 +0100
Control: severity -1 wishlist
Control: tags -1 + moreinfo
Hi Nick,
2011-06-07 22:51 Nick Phillips:
>Package: aptitude
>Version: 0.6.3-3.2
>Severity: normal
>
>The command line:
>apt-get -q -y -o "#clear DPkg::Pre-Install-Pkgs;" install somepkg
>
>still causes dpkg-preconfigure to be used to preconfigure packages, when the line:
>DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
>
>is present in /etc/apt/apt.conf.d/70debconf
>
>
>The equivalent invocation of apt-get successfully inhibits the preconfiguration.
>I note that:
>apt-config -o "#clear DPkg::Pre-Install-Pkgs;" dump
>
>fails to parse the option and barfs, insisting that the option must contain an "=".
>Perhaps this is related?
As discussed in the bug submitted to apt (#656844), probably this never
worked, the syntax in config variables passed with command line and the
syntax in config files is different, and #clear has never been
supported.
From apt.conf:
All of the APT tools take an -o option which allows an arbitrary
configuration directive to be specified on the command line. The
syntax is a full option name (APT::Get::Assume-Yes for instance)
followed by an equals sign then the new value of the option. To
append a new element to a list, add a trailing :: to the name of the
list. (As you might suspect, the scope syntax can't be used on the
command line.)
and DPkg::Pre-Install-Pkgs uses a "scope".
2012-01-22 09:19 Daniel Hartwig:
>
>I have submitted a patch to support this in libapt-pkg [1].
From the discussion in the bug report above, this is unlikely to happen,
at least with that patch.
One suggestion was to implement "--clear-option" instead.
However, if apt-* don't support this yet, I am not sure if aptitude
should, so this needs further consideration.
>Aptitude
>should soon make use of the same library to parse its command-line
>[2], which will resolve this issue.
>
>Otherwise, it is simple to implement the same patch is aptitude's
>current parser.
>
>[1] http://bugs.debian.org/656844
>[2] http://anonscm.debian.org/gitweb/?p=aptitude/aptitude.git;a=shortlog;h=refs/heads/wip-cmdline
This branch never came to be merged, so this doesn't apply now.
Cheers.
--
Manuel A. Fernandez Montecelo <[email protected]>