I am not C++ coder but src/cmdline/cmdline_do_action.cc line 299 is where
problem comes from.
Please read on.
When I set a lower priority version in hold using =, I expect that
settig to live future package install actions unless specifically requested to
be removed. Aptitude menu suggest so.
"=": Hold a package in its current version to prevent upgrades.
":": Keep a package at its current version. Unlike hold, this
will not prevent future upgrades.
But "Actions" -> "Cancel pending actions" reset this frag too. (The same goes to
keep-all for command line. It resets "State: installed [held]" to "State: installed".)
This menu entry is frequently used to revert suggested "dependencies" upon
starting interactive session or "aptitude install".
The logic to should be exactly as keep-all documented:
Cancels all scheduled actions on all packages; any packages whose sticky
state indicates an installation, removal, or upgrade will have this sticky
state cleared.
So it should clear sticky state only if sticky state is not set to "hold (=)"
like flag. This is important since this situation is quite annoying and makes
"hold (=)" comletely useless.
I tracked down to src/cmdline/cmdline_do_action.cc . There:
----------
// If keep-all is the argument, we expect no patterns and keep all
// packages back.
if(!strcasecmp(argv[0], "keep-all"))
{
if(argc != 1)
{
cerr << _("Unexpected pattern argument following \"keep-all\"") << endl;
return -1;
}
for(pkgCache::PkgIterator i=(*apt_cache_file)->PkgBegin();
!i.end(); ++i)
(*apt_cache_file)->mark_keep(i, false, false, NULL);
}
----------
This seems to unconditonally reset mark_keep. From cmdline_action.cc, this
data structure is about hold etc.
case cmdline_hold:
(*apt_cache_file)->mark_keep(pkg, false, true, NULL);
So it seems adding some check of current state before zapping state to (i, false, false, NULL).
I am not C++ coder so I will not make patch but cmdline_do_action.cc line 299 is where problem comes from.
Also, as I checked, User help screen has following
The "action" flag is one of the following:
h - hold
p - purge
d - delete (remove)
B - broken
i - install
r - reinstall
u - upgrade
F - the available upgrade has been forbidden via "F"
I do not know if we also have to check for "F" and "r". "F" seems to be option
set by user which is expected to live long if not specifically requested, I say
it should not be reset by keep-all.
"r" seems to be the same as hold by ":", they could be skipped by keep-all too. (I
should say, I do not care too much on this.)
So, please consider these points when fixing this bug. Also updating
documentation to note on hold etc. should help user.
Osamu
FYI:
I was winderting why my "h - hold" (set by =) is getting killed sometime after
when I do some package install with a combination aptitud recommended as the
first choice. I think I finally tracked down where this strange thing was
happening.
-- Package-specific info:
aptitude 0.6.1.5 compiled at Mar 12 2010 18:48:34
Compiler: g++ 4.4.3
Compiled against:
apt version 4.8.0
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.8.0
linux-vdso.so.1 => (0x00007fff771ff000)
libapt-pkg-libc6.9-6.so.4.8 => /usr/lib/libapt-pkg-libc6.9-6.so.4.8 (0x00007f44256a8000)
libncursesw.so.5 => /lib/libncursesw.so.5 (0x00007f4425455000)
liblog4cxx.so.10 => /usr/lib/liblog4cxx.so.10 (0x00007f4425067000)
libsigc-2.0.so.0 => /usr/lib/libsigc-2.0.so.0 (0x00007f4424e62000)
libcwidget.so.3 => /usr/lib/libcwidget.so.3 (0x00007f4424b96000)
libept.so.0 => /usr/lib/libept.so.0 (0x00007f442491e000)
libxapian.so.15 => /usr/lib/libxapian.so.15 (0x00007f44245cd000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f44243b6000)
libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007f4424125000)
libboost_iostreams.so.1.40.0 => /usr/lib/libboost_iostreams.so.1.40.0 (0x00007f4423f1a000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f4423cfe000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f44239e9000)
libm.so.6 => /lib/libm.so.6 (0x00007f4423767000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f4423551000)
libc.so.6 => /lib/libc.so.6 (0x00007f44231fc000)
libutil.so.1 => /lib/libutil.so.1 (0x00007f4422ff9000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f4422df5000)
libaprutil-1.so.0 => /usr/lib/libaprutil-1.so.0 (0x00007f4422bd1000)
libdb-4.8.so => /usr/lib/libdb-4.8.so (0x00007f4422857000)
libapr-1.so.0 => /usr/lib/libapr-1.so.0 (0x00007f442261f000)
libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00007f442240e000)
librt.so.1 => /lib/librt.so.1 (0x00007f4422206000)
/lib64/ld-linux-x86-64.so.2 (0x00007f442598c000)
libuuid.so.1 => /lib/libuuid.so.1 (0x00007f4422001000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f4421dca000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f4421ba2000)
Terminal: xterm
$DISPLAY is set.
`which aptitude`: /usr/bin/aptitude
aptitude version information:
aptitude linkage:
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages aptitude depends on:
ii apt [libapt-pkg-libc6.9 0.7.25.3 Advanced front-end for dpkg
ii libboost-iostreams1.40. 1.40.0-6+b1 Boost.Iostreams Library
ii libc6 2.10.2-6 Embedded GNU C Library: Shared lib
ii libcwidget3 0.5.16-3 high-level terminal interface libr
ii libept0 0.5.30 High-level library for managing De
ii libgcc1 1:4.4.3-5 GCC support library
ii liblog4cxx10 0.10.0-1.1 A logging library for C++
ii libncursesw5 5.7+20100313-1 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.6.23-1 SQLite 3 shared library
ii libstdc++6 4.4.3-5 The GNU Standard C++ Library v3
ii libxapian15 1.0.18-1 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.26 maintenance tools for a Xapian ind
ii aptitude-doc-en [aptitude-doc 0.6.1.5-3 English manual for aptitude, a ter
ii aptitude-doc-ja [aptitude-doc 0.6.1.5-3 Japanese manual for aptitude, a te
ii libparse-debianchangelog-perl 1.1.1-2 parse Debian changelogs and output
ii sensible-utils 0.0.2 Utilities for sensible alternative
Versions of packages aptitude suggests:
ii debtags 1.7.9+b2 Enables support for package tags
ii tasksel 2.81 Tool for selecting tasks for insta
-- no debconf information
--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org