[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#542699: MarkUpgrade always marks a package as explicitly installed



Package: python-apt
Version: 0.7.12.1
Severity: important

The apt.Package.markUpgrade() methods marks a package as not
automatically
installed:

>>> import apt
>>> c = apt.Cache()
>>> p = c["mobile-broadband-provider-info"]
>>> c._depcache.IsAutoInstalled(p._pkg)
1
>>> p.markUpgrade()
>>> c._depcache.IsAutoInstalled(p._pkg)
0

Instead it should keep the current state. A common use case for the
markUpgrade
call is an user on low bandwith who only upgrades in small sub sets.

Cheers,

Sebastian


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-1-686 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-apt depends on:
ii  apt [libapt-pkg-libc6.9-6-4.8 0.7.22.2   Advanced front-end for dpkg
ii  apt-utils [libapt-inst-libc6. 0.7.22.2   APT utility programs
ii  libc6                         2.9-23     GNU C Library: Shared
libraries
ii  libgcc1                       1:4.4.1-1  GCC support library
ii  libstdc++6                    4.4.1-1    The GNU Standard C++
Library v3
ii  lsb-release                   3.2-23     Linux Standard Base version
report
ii  python                        2.5.4-2    An interactive high-level
object-o
ii  python-central                0.6.11     register and build utility
for Pyt

Versions of packages python-apt recommends:
ii  iso-codes                     3.10.2-1   ISO language, territory,
currency,
ii  libjs-jquery                  1.3.3-1    JavaScript library for
dynamic web

Versions of packages python-apt suggests:
pn  python-apt-dbg                <none>     (no description available)
ii  python-gtk2                   2.14.1-3   Python bindings for the GTK
+ widge
ii  python-vte                    1:0.20.5-1 Python bindings for the VTE
widget

-- no debconf information
=== modified file 'apt/package.py'
--- apt/package.py	2009-08-03 13:59:35 +0000
+++ apt/package.py	2009-08-20 20:28:51 +0000
@@ -1158,7 +1158,8 @@
     def mark_upgrade(self):
         """Mark a package for upgrade."""
         if self.is_upgradable:
-            self.mark_install()
+            auto = self._pcache._depcache.IsAutoInstalled(self._pkg)
+            self.mark_install(from_user=auto)
         else:
             # FIXME: we may want to throw a exception here
             sys.stderr.write(("MarkUpgrade() called on a non-upgrable pkg: "

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Reply to: