]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/depcache.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 11 Feb 2011 16:47:50 +0000 (17:47 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 11 Feb 2011 16:47:50 +0000 (17:47 +0100)
  - mark a package which was requested to be installed on commandline
    always as manual regardless if it is already marked or not as the
    marker could be lost later by the removal of rdepends (Closes: #612557)

apt-pkg/depcache.cc
debian/changelog
test/integration/status-bug-612557-garbage-upgrade [new file with mode: 0644]
test/integration/test-bug-612557-garbage-upgrade [new file with mode: 0755]

index 7c09d3a38fe4b6965feac4fa194aa43fa5e998cb..0c5b7773290371ef299ec4de91b615d1e867daea 100644 (file)
@@ -1257,9 +1257,8 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
 
    if(FromUser)
      {
-       // Set it to manual if it's a new install or cancelling the
-       // removal of a garbage package.
-       if(P.Status == 2 || (!Pkg.CurrentVer().end() && !P.Marked))
+       // Set it to manual if it's a new install or already installed
+       if(P.Status == 2 || Pkg->CurrentVer != 0)
         P.Flags &= ~Flag::Auto;
      }
    else
index bb2e9d63c5a9fbc17e1b1a3f56e3caa5d85efac7..2da3afa383c286cd2e706626042972374c7d58b2 100644 (file)
@@ -3,8 +3,12 @@ apt (0.8.12) unstable; urgency=low
   [ David Kalnischkies ]
   * cmdline/apt-get.cc:
     - add --install-suggests option (Closes: #473089)
+  * apt-pkg/depcache.cc:
+    - mark a package which was requested to be installed on commandline
+      always as manual regardless if it is already marked or not as the
+      marker could be lost later by the removal of rdepends (Closes: #612557)
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 09 Feb 2011 22:56:27 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 11 Feb 2011 17:44:49 +0100
 
 apt (0.8.11.1) unstable; urgency=low
 
diff --git a/test/integration/status-bug-612557-garbage-upgrade b/test/integration/status-bug-612557-garbage-upgrade
new file mode 100644 (file)
index 0000000..7403d8c
--- /dev/null
@@ -0,0 +1,34 @@
+Package: python-uno
+Status: install ok installed
+Priority: optional
+Section: python
+Installed-Size: 2032
+Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org>
+Architecture: i386
+Source: openoffice.org
+Version: 1:3.2.1-11+squeeze2
+Description: Python-UNO bridge
+
+Package: openoffice.org-common
+Status: install ok installed
+Priority: optional
+Section: editors
+Installed-Size: 48356
+Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org>
+Architecture: all
+Source: openoffice.org
+Version: 1:3.2.1-11+squeeze2
+Description: office productivity suite -- arch-independent files
+
+Package: openoffice.org-emailmerge
+Status: install ok installed
+Priority: optional
+Section: editors
+Installed-Size: 1652
+Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org>
+Architecture: all
+Source: openoffice.org
+Version: 1:3.2.1-11+squeeze2
+Replaces: python-uno (<< 1:2.4.1-5)
+Pre-Depends: python-uno, openoffice.org-common
+Description: office productivity suite -- email mail merge
diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade
new file mode 100755 (executable)
index 0000000..e2ffe61
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+set -e
+
+local TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'unrelated' 'all' '1:3.3.0-2'
+insertpackage 'unstable' 'python-uno' 'all' '1:3.3.0-2' 'Depends: libreoffice-common'
+insertpackage 'unstable' 'libreoffice-common' 'all' '1:3.3.0-2' 'Conflicts: openoffice.org-common'
+
+setupaptarchive
+
+touch rootdir/var/lib/apt/extended_states
+aptmark markauto python-uno ure uno-libs3 openoffice.org-common openoffice.org-style-galaxy
+#aptmark unmarkauto openoffice.org-emailmerge
+testmarkedauto python-uno ure uno-libs3 openoffice.org-common openoffice.org-style-galaxy
+
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following extra packages will be installed:
+  libreoffice-common
+The following packages will be REMOVED:
+  openoffice.org-common openoffice.org-emailmerge
+The following NEW packages will be installed:
+  libreoffice-common
+The following packages will be upgraded:
+  python-uno
+1 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
+After this operation, 53.2 MB disk space will be freed.
+E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno
+
+aptmark markauto openoffice.org-emailmerge
+testmarkedauto python-uno ure uno-libs3 openoffice.org-common openoffice.org-style-galaxy openoffice.org-emailmerge
+
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following extra packages will be installed:
+  libreoffice-common
+The following packages will be REMOVED:
+  openoffice.org-common openoffice.org-emailmerge
+The following NEW packages will be installed:
+  libreoffice-common
+The following packages will be upgraded:
+  python-uno
+1 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
+After this operation, 53.2 MB disk space will be freed.
+E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno
+
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages will be REMOVED:
+  openoffice.org-common openoffice.org-emailmerge python-uno
+0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
+After this operation, 53.3 MB disk space will be freed.
+E: Trivial Only specified but this is not a trivial operation.' aptget autoremove --trivial-only