HCoop
/
ntk
/
apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add even more config options and try to handle configuration problems
[ntk/apt.git]
/
apt-pkg
/
packagemanager.cc
diff --git
a/apt-pkg/packagemanager.cc
b/apt-pkg/packagemanager.cc
index
304d1c6
..
4421435
100644
(file)
--- a/
apt-pkg/packagemanager.cc
+++ b/
apt-pkg/packagemanager.cc
@@
-26,7
+26,7
@@
#include <apti18n.h>
#include <iostream>
#include <fcntl.h>
#include <apti18n.h>
#include <iostream>
#include <fcntl.h>
-
+ /*}}}*/
using namespace std;
// PM::PackageManager - Constructor /*{{{*/
using namespace std;
// PM::PackageManager - Constructor /*{{{*/
@@
-57,7
+57,10
@@
bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
if (CreateOrderList() == false)
return false;
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++)
return _error->Error("Internal ordering error");
for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
@@
-117,7
+120,6
@@
bool pkgPackageManager::FixMissing()
return Resolve.ResolveByKeep() == true && Cache.BrokenCount() == 0;
}
/*}}}*/
return Resolve.ResolveByKeep() == true && Cache.BrokenCount() == 0;
}
/*}}}*/
-
// PM::ImmediateAdd - Add the immediate flag recursivly /*{{{*/
// ---------------------------------------------------------------------
/* This adds the immediate flag to the pkg and recursively to the
// PM::ImmediateAdd - Add the immediate flag recursivly /*{{{*/
// ---------------------------------------------------------------------
/* This adds the immediate flag to the pkg and recursively to the
@@
-152,7
+154,6
@@
void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer)
return;
}
/*}}}*/
return;
}
/*}}}*/
-
// PM::CreateOrderList - Create the ordering class /*{{{*/
// ---------------------------------------------------------------------
/* This populates the ordering list with all the packages that are
// PM::CreateOrderList - Create the ordering class /*{{{*/
// ---------------------------------------------------------------------
/* This populates the ordering list with all the packages that are
@@
-165,7
+166,7
@@
bool pkgPackageManager::CreateOrderList()
delete List;
List = new pkgOrderList(&Cache);
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++)
// Generate the list of affected packages and sort it
for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
@@
-268,13
+269,16
@@
bool pkgPackageManager::ConfigureAll()
if (OList.OrderConfigure() == false)
return false;
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);
// Perform the configuring
for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
{
PkgIterator Pkg(Cache,*I);
- if (Configure(Pkg) == false)
+ if (Configure
Pkgs == true && Configure
(Pkg) == false)
return false;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
return false;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@
-293,16
+297,20
@@
bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
if (DepAdd(OList,Pkg) == false)
return false;
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);
// Perform the configuring
for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
{
PkgIterator Pkg(Cache,*I);
- if (Configure(Pkg) == false)
+ if (Configure
Pkgs == true && Configure
(Pkg) == false)
return false;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
return false;
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@
-579,9
+587,12
@@
pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
Reset();
if (Debug == true)
Reset();
if (Debug == true)
- clog << "Begining to order" << endl;
+ clog << "Begin
n
ing 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;
{
_error->Error("Internal ordering error");
return Failed;
@@
-634,7
+645,7
@@
pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
return Failed;
DoneSomething = true;
}
return Failed;
DoneSomething = true;
}
-
+
// Final run through the configure phase
if (ConfigureAll() == false)
return Failed;
// Final run through the configure phase
if (ConfigureAll() == false)
return Failed;