summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-08-01 12:27:10 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-08-01 12:27:10 +0100
commit17182c0c66630c2fcba938edb5b27668f7495854 (patch)
treedf930bd62821bca7bfcc3c7f8579bdfed103f66a /apt-pkg/packagemanager.cc
parent1cecd4376cebdd0225ee91707b7630bc35959474 (diff)
Only stop on SigInt if the system state is right (still needs more testing).
More inprovements to the package manager to prevent packages from being configured twice.
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r--apt-pkg/packagemanager.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 8bcf3d884..324b7ffba 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -286,6 +286,10 @@ bool pkgPackageManager::ConfigureAll()
for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
{
PkgIterator Pkg(Cache,*I);
+
+ /* Check if the package has been configured, this can happen if SmartConfigure
+ calls its self */
+ if (List->IsFlag(Pkg,pkgOrderList::Configured)) continue;
if (ConfigurePkgs == true && SmartConfigure(Pkg) == false) {
_error->Error("Internal error, packages left unconfigured. %s",Pkg.Name());
@@ -415,6 +419,9 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
static std::string const conf = _config->Find("PackageManager::Configure","all");
static bool const ConfigurePkgs = (conf == "all" || conf == "smart");
+ if (List->IsFlag(Pkg,pkgOrderList::Configured))
+ return _error->Error("Internal configure error on '%s'. ",Pkg.Name(),1);
+
if (ConfigurePkgs == true && Configure(Pkg) == false)
return false;
@@ -577,6 +584,11 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
if (Cache[Pkg].InstallVer != *I ||
(Cache[Pkg].Keep() == true && Pkg.State() == PkgIterator::NeedsNothing))
continue;
+
+ if (List->IsFlag(Pkg,pkgOrderList::Configured)) {
+ Bad = false;
+ continue;
+ }
if (Debug)
clog << "Trying to SmartConfigure " << Pkg.Name() << endl;