On 2009-03-02 17:48 +0100, John A Martin wrote:

> Package: aptitude
> Version: 0.4.11.11-1
> Severity: important
>
> It appears that 'hold' fails to cause the packages given on the command
> line to be ignored by future safe-upgrade.

That's probably the same issue as #466228¹.

> athene:/home/jam# aptitude -P safe-upgradeReading package lists... Done
> Building dependency tree       
> Reading state information... Done
> Reading extended state information       
> Initializing package states... Done
> Reading task descriptions... Done  
> The following packages have been kept back:
>   foomatic-db{a} java-gcj-compat{a} java-gcj-compat-headless{a} 
>   openclipart-openoffice.org openclipart-png{a} openoffice.org 
>   openoffice.org-base{a} openoffice.org-base-core{a} openoffice.org-calc{a} 
>   openoffice.org-common{a} openoffice.org-core{a} openoffice.org-draw{a} 
>   openoffice.org-evolution openoffice.org-filter-binfilter{a} 
>   openoffice.org-gnome openoffice.org-gtk{a} openoffice.org-help-en-us 
>   openoffice.org-impress{a} openoffice.org-math{a} 
>   openoffice.org-officebean{a} openoffice.org-style-andromeda 
>   openoffice.org-style-crystal{a} openoffice.org-style-tango{a} 
>   openoffice.org-writer{a} python-uno{a} shared-mime-info{a} 
> The following packages will be upgraded:
>   nvidia-kernel-2.6.26-1-686 nvidia-kernel-source 
> 2 packages upgraded, 0 newly installed, 0 to remove and 27 not upgraded.

Here is a patch that Daniel Burrows sent to the debian-user list some
time ago².  It works for me and seems to be part of aptitude 0.5.

diff -r aabbcab08cd3 src/cmdline/cmdline_upgrade.cc
--- a/src/cmdline/cmdline_upgrade.cc	Sat Aug 09 09:58:13 2008 -0700
+++ b/src/cmdline/cmdline_upgrade.cc	Sat Aug 09 16:41:07 2008 -0700
@@ -112,7 +112,10 @@
 	// Reset all the package states.
 	for(pkgCache::PkgIterator i=(*apt_cache_file)->PkgBegin();
 	    !i.end(); ++i)
-	  (*apt_cache_file)->mark_keep(i, false, false, NULL);
+	  {
+	    bool held = (*apt_cache_file)->get_ext_state(i).selection_state == pkgCache::State::Hold;
+	    (*apt_cache_file)->mark_keep(i, false, held, NULL);
+	  }
       }
 
       // Use the apt 'upgrade' algorithm as a fallback against, e.g.,
¹ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466228
² http://lists.debian.org/debian-user/2008/08/msg00692.html


Sven

Reply via email to