Просмотр исходного кода

Removed some debug stuff, corrected the VerifyConfigure calls to VerifyAndConfigure

Christopher Baines лет назад: 15
Родитель
Сommit
4e9ccfb2ff

+ 4 - 9
apt-pkg/packagemanager.cc

@@ -278,7 +278,7 @@ bool pkgPackageManager::ConfigureAll()
    {
       PkgIterator Pkg(Cache,*I);
 
-      if (ConfigurePkgs == true && VerifyConfigure(Pkg,OList) == false)
+      if (ConfigurePkgs == true && VerifyAndConfigure(Pkg,OList) == false)
 	 return false;
       
       List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@ -313,7 +313,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
    {
       PkgIterator Pkg(Cache,*I);
       
-      if (ConfigurePkgs == true && VerifyConfigure(Pkg,OList) == false)
+      if (ConfigurePkgs == true && VerifyAndConfigure(Pkg,OList) == false)
 	 return false;
       
       List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@ -346,9 +346,6 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
    configured*/
 bool pkgPackageManager::VerifyConfigure(PkgIterator Pkg, pkgOrderList &OList)
 {
-   if (Debug == true)
-      clog << "VerifyConfigure " << Pkg.Name() << endl;
-
    // If this is true at the end, then the package should not be configured
    bool error=true;
    // This holds the the OR status of the previous dependancy  
@@ -419,7 +416,7 @@ bool pkgPackageManager::VerifyConfigure(PkgIterator Pkg, pkgOrderList &OList)
    configures it  */
 bool pkgPackageManager::VerifyAndConfigure(PkgIterator Pkg, pkgOrderList &OList)
 {
-   if (VerifyConfigure(Pkg, OList))
+   if (VerifyConfigure(Pkg, OList)) 
       return Configure(Pkg);
    else
       return false;
@@ -472,15 +469,13 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
 	    PkgIterator Pkg = Ver.ParentPkg();
 
 	    // See if the current version is ok
-	    if (Pkg.CurrentVer() == Ver && List->IsNow(Pkg) == true && 
+	    if (Pkg.CurrentVer() == Ver && List->IsFlag(Pkg,pkgOrderList::Configured) == true && 
 		Pkg.State() == PkgIterator::NeedsNothing)
 	    {
 	       Bad = false;
 	       continue;
 	    }
 	    
-	    std::clog << OutputInDepth(Depth) << Pkg.Name() << " NeedsNothing " << (Pkg.State() == PkgIterator::NeedsNothing) << " Unpacked " << List->IsFlag(Pkg,pkgOrderList::UnPacked) << std::endl;
-	    
 	    // Not the install version 
 	    if (Cache[Pkg].InstallVer != *I || 
 		(Cache[Pkg].Keep() == true && Pkg.State() == PkgIterator::NeedsNothing))

+ 17 - 0
test/integration/test-package-reinstallation

@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+insertinstalledpackage 'libc-bin' 'i386' '2.13-8' 'Replaces: libc6'
+insertpackage 'unstable' 'libc-bin' 'i386' '2.13-8' 'Replaces: libc6'
+insertinstalledpackage 'libc6' 'i386' '2.13-8' 'Depends: libc-bin (= 2.13-8)'
+insertpackage 'unstable' 'libc6' 'i386' '2.13-8' 'Depends: libc-bin (= 2.13-8)'
+insertinstalledpackage 'apt' 'i386' '0.8.15' 'Depends: libc6'
+
+setupaptarchive
+
+aptget install --reinstall libc6 libc-bin -s -o Debug::pkgPackageManager=1

+ 46 - 0
test/integration/test-provides-gone-with-upgrade

@@ -0,0 +1,46 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+insertinstalledpackage 'apt' 'i386' '0.8.14' 'Provides: libapt-pkg4.10'
+insertpackage 'unstable' 'apt' 'i386' '0.8.15' 'Depends: libapt-pkg4.10'
+insertpackage 'unstable' 'libapt-pkg4.10' 'i386' '0.8.15' 'Breaks: apt (<< 0.8.15)
+Replaces: apt (<< 0.8.15)'
+
+setupaptarchive
+
+#testequal 'Reading package lists...
+#Building dependency tree...
+#The following NEW packages will be installed:
+#  libapt-pkg4.10
+#The following packages will be upgraded:
+#  apt
+#1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+#Inst libapt-pkg4.10 (0.8.15 unstable [i386]) [libapt-pkg4.10:i386 on apt:i386] []
+#Conf libapt-pkg4.10:i386 broken
+# Breaks:apt:i386
+# []
+#Inst apt [0.8.14] (0.8.15 unstable [i386])
+#Conf apt (0.8.15 unstable [i386])
+#E: Conf Broken libapt-pkg4.10:i386' 
+aptget dist-upgrade -s -o Debug::pkgPackageManager=1
+# the solution by dpkg will be to deconfigure apt with the configuration of libapt-pkg4.10
+
+exit 0
+
+#FIXME: a good result would be this instead, but it requires that APT can delay his immediate configuration…
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  libapt-pkg4.10
+The following packages will be upgraded:
+  apt
+1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libapt-pkg4.10 (0.8.15 unstable [i386])
+Conf libapt-pkg4.10 (0.8.15 unstable [i386])
+Inst apt [0.8.14] (0.8.15 unstable [i386])
+Conf apt (0.8.15 unstable [i386])' aptget dist-upgrade -s