summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2009-09-15 23:52:04 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2009-09-15 23:52:04 +0200
commit5e312de78360736fa3ef505909ef84da211362ca (patch)
treee2ba262292d5ad06f7f6edcd43c1966aa0904146 /apt-pkg/packagemanager.cc
parent3e9c4f702ed45f6201bae44b628c84db69436b05 (diff)
Add even more config options and try to handle configuration problems
arising if we upgrade essential or predependencies which need to be configured before even unpacking packages depending on them.
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r--apt-pkg/packagemanager.cc37
1 files changed, 25 insertions, 12 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index cc9ce21c7..442143516 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -57,7 +57,10 @@ bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
if (CreateOrderList() == false)
return false;
- if (List->OrderUnpack() == false)
+ bool const ordering =
+ _config->FindB("PackageManager::UnpackAll",true) ?
+ List->OrderUnpack() : List->OrderCritical();
+ if (ordering == false)
return _error->Error("Internal ordering error");
for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
@@ -163,7 +166,7 @@ bool pkgPackageManager::CreateOrderList()
delete List;
List = new pkgOrderList(&Cache);
- bool NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
+ static bool const NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
// Generate the list of affected packages and sort it
for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
@@ -266,13 +269,16 @@ bool pkgPackageManager::ConfigureAll()
if (OList.OrderConfigure() == false)
return false;
-
+
+ std::string const conf = _config->Find("PackageManager::Configure","all");
+ bool const ConfigurePkgs = (conf == "all");
+
// Perform the configuring
for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
{
PkgIterator Pkg(Cache,*I);
- if (Configure(Pkg) == false)
+ if (ConfigurePkgs == true && Configure(Pkg) == false)
return false;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@ -291,16 +297,20 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
if (DepAdd(OList,Pkg) == false)
return false;
-
- if (OList.OrderConfigure() == false)
- return false;
-
+
+ static std::string const conf = _config->Find("PackageManager::Configure","all");
+ static bool const ConfigurePkgs = (conf == "all" || conf == "smart");
+
+ if (ConfigurePkgs == true)
+ if (OList.OrderConfigure() == false)
+ return false;
+
// Perform the configuring
for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
{
PkgIterator Pkg(Cache,*I);
- if (Configure(Pkg) == false)
+ if (ConfigurePkgs == true && Configure(Pkg) == false)
return false;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@ -577,9 +587,12 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
Reset();
if (Debug == true)
- clog << "Begining to order" << endl;
+ clog << "Beginning to order" << endl;
- if (List->OrderUnpack(FileNames) == false)
+ bool const ordering =
+ _config->FindB("PackageManager::UnpackAll",true) ?
+ List->OrderUnpack(FileNames) : List->OrderCritical();
+ if (ordering == false)
{
_error->Error("Internal ordering error");
return Failed;
@@ -632,7 +645,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
return Failed;
DoneSomething = true;
}
-
+
// Final run through the configure phase
if (ConfigureAll() == false)
return Failed;