summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-05-25 15:55:05 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-05-25 15:55:05 +0200
commitff371080d8672b94ef289f1162704e74959b4ddf (patch)
treeef1009f20f84b4d53a8f837f02411c7789b89fc4 /apt-pkg
parent921a3ce01c2595e9df9ff20bdd259e14733dcb16 (diff)
parent642ebc1a04c9c7915474c57f1143a9389ee6636a (diff)
merged lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc3
-rw-r--r--apt-pkg/contrib/mmap.cc4
-rw-r--r--apt-pkg/deb/dpkgpm.cc9
-rw-r--r--apt-pkg/depcache.cc21
-rw-r--r--apt-pkg/init.cc4
-rw-r--r--apt-pkg/packagemanager.h16
-rw-r--r--apt-pkg/policy.cc4
-rw-r--r--apt-pkg/sourcelist.cc8
8 files changed, 44 insertions, 25 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 88cac7f7f..c035b9163 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1685,7 +1685,6 @@ string pkgAcqFile::Custom600Headers()
{
if (IsIndexFile)
return "\nIndex-File: true";
- else
- return string();
+ return "";
}
/*}}}*/
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index b3f29032c..d233e51bc 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -392,8 +392,8 @@ unsigned long DynamicMMap::WriteString(const char *String,
the nearly impossible 4 to grow it before it finally give up: Never say never. */
bool DynamicMMap::Grow() {
if (Limit != 0 && WorkSpace >= Limit)
- return _error->Error(_("The size of a MMap has already reached the defined limit of %lu bytes,"
- "abort the try to grow the MMap."), Limit);
+ return _error->Error(_("Unable to increase the size of the MMap as the "
+ "limit of %lu bytes is already reached."), Limit);
unsigned long const newSize = WorkSpace + 1024*1024;
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index ca8faa8a5..8318fe37f 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -50,6 +50,7 @@ namespace
std::make_pair("configure", N_("Configuring %s")),
std::make_pair("remove", N_("Removing %s")),
std::make_pair("purge", N_("Completely removing %s")),
+ std::make_pair("disappear", N_("Noting disappearance of %s")),
std::make_pair("trigproc", N_("Running post-installation trigger %s"))
};
@@ -419,7 +420,8 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line)
'processing: install: pkg'
'processing: configure: pkg'
'processing: remove: pkg'
- 'processing: purge: pkg' - but for apt is it a ignored "unknown" action
+ 'processing: purge: pkg'
+ 'processing: disappear: pkg'
'processing: trigproc: trigger'
*/
@@ -466,6 +468,9 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line)
write(OutStatusFd, status.str().c_str(), status.str().size());
if (Debug == true)
std::clog << "send: '" << status.str() << "'" << endl;
+
+ if (strncmp(action, "disappear", strlen("disappear")) == 0)
+ disappearedPkgs.insert(string(pkg_or_trigger));
return;
}
@@ -911,6 +916,8 @@ bool pkgDPkgPM::Go(int OutStatusFd)
{
if((*I).Pkg.end() == true)
continue;
+ if (I->Op == Item::Configure && disappearedPkgs.find(I->Pkg.Name()) != disappearedPkgs.end())
+ continue;
Args[n++] = I->Pkg.Name();
Size += strlen(Args[n-1]);
}
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 4d1a08eb6..411ae5f62 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -804,17 +804,18 @@ void pkgDepCache::Update(OpProgress *Prog)
/* FIXME: recheck breaks proper progress reporting as we don't know
how many packages we need to recheck. To lower the effect
a bit we increase with a kill, but we should do something more clever… */
- for(std::set<unsigned long>::const_iterator p = recheck.begin();
- p != recheck.end(); ++p) {
- if (Prog != 0 && Done%20 == 0)
- Prog->Progress(Done);
- PkgIterator P = PkgIterator(*Cache, Cache->PkgP + *p);
- if (RemovePseudoInstalledPkg(P, recheck) == true) {
- ++killed;
- ++Done;
+ while(recheck.empty() == false)
+ for (std::set<unsigned long>::const_iterator p = recheck.begin();
+ p != recheck.end(); ++p) {
+ if (Prog != 0 && Done%20 == 0)
+ Prog->Progress(Done);
+ PkgIterator P = PkgIterator(*Cache, Cache->PkgP + *p);
+ if (RemovePseudoInstalledPkg(P, recheck) == true) {
+ ++killed;
+ ++Done;
+ }
+ recheck.erase(p);
}
- recheck.erase(p);
- }
/* Okay, we have killed a great amount of pseudopackages -
we have killed so many that we have now arch "all" packages
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index 6310aff11..60281deb3 100644
--- a/apt-pkg/init.cc
+++ b/apt-pkg/init.cc
@@ -94,10 +94,10 @@ bool pkgInitConfig(Configuration &Cnf)
// Read the configuration parts dir
string Parts = Cnf.FindDir("Dir::Etc::parts");
- if (FileExists(Parts) == true)
+ if (DirectoryExists(Parts) == true)
Res &= ReadConfigDir(Cnf,Parts);
else
- _error->WarningE("FileExists",_("Unable to read %s"),Parts.c_str());
+ _error->WarningE("DirectoryExists",_("Unable to read %s"),Parts.c_str());
// Read the main config file
string FName = Cnf.FindFile("Dir::Etc::main");
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index af1476b7a..efd2cfac6 100644
--- a/apt-pkg/packagemanager.h
+++ b/apt-pkg/packagemanager.h
@@ -28,6 +28,7 @@
#include <iostream>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/depcache.h>
+#include <set>
using std::string;
@@ -47,7 +48,15 @@ class pkgPackageManager : protected pkgCache::Namespace
pkgDepCache &Cache;
pkgOrderList *List;
bool Debug;
-
+
+ /** \brief saves packages dpkg let disappear
+
+ This way APT can retreat from trying to configure these
+ packages later on and a frontend can choose to display a
+ notice to inform the user about these disappears.
+ */
+ std::set<std::string> disappearedPkgs;
+
bool DepAdd(pkgOrderList &Order,PkgIterator P,int Depth = 0);
void ImmediateAdd(PkgIterator P, bool UseInstallVer, unsigned const int &Depth = 0);
virtual OrderResult OrderInstall();
@@ -93,7 +102,10 @@ class pkgPackageManager : protected pkgCache::Namespace
// stuff that needs to be done after the fork
OrderResult DoInstallPostFork(int statusFd=-1);
bool FixMissing();
-
+
+ /** \brief returns all packages dpkg let disappear */
+ inline std::set<std::string> GetDisappearedPackages() { return disappearedPkgs; };
+
pkgPackageManager(pkgDepCache *Cache);
virtual ~pkgPackageManager();
};
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 479cf3935..922efb0dd 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -291,9 +291,9 @@ bool ReadPinDir(pkgPolicy &Plcy,string Dir)
if (Dir.empty() == true)
Dir = _config->FindDir("Dir::Etc::PreferencesParts");
- if (FileExists(Dir) == false)
+ if (DirectoryExists(Dir) == false)
{
- _error->WarningE("FileExists",_("Unable to read %s"),Dir.c_str());
+ _error->WarningE("DirectoryExists",_("Unable to read %s"),Dir.c_str());
return true;
}
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index e13472fa6..c3ec9865a 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -199,15 +199,15 @@ bool pkgSourceList::ReadMainList()
if (FileExists(Main) == true)
Res &= ReadAppend(Main);
- else if (FileExists(Parts) == false)
+ else if (DirectoryExists(Parts) == false)
// Only warn if there are no sources.list.d.
- _error->WarningE("FileExists",_("Unable to read %s"),Main.c_str());
+ _error->WarningE("DirectoryExists", _("Unable to read %s"), Parts.c_str());
- if (FileExists(Parts) == true)
+ if (DirectoryExists(Parts) == true)
Res &= ReadSourceDir(Parts);
else if (FileExists(Main) == false)
// Only warn if there is no sources.list file.
- _error->WarningE("FileExists",_("Unable to read %s"),Parts.c_str());
+ _error->WarningE("FileExists", _("Unable to read %s"), Main.c_str());
return Res;
}