summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-10-14 14:49:47 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-10-14 14:49:47 +0200
commit58d0598ad6f1c514bf7d89fdea676a697f0d9388 (patch)
treeeade3a15056c5dd70ac0da1953186065c7441c7b /apt-pkg/deb
parent2c53e7d1a82e2bfe44151ac9d1ac2043fca09efa (diff)
parent44dc669e08353716da835608ea54563b4c8c32bb (diff)
merged from the debian-sid branch
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/debindexfile.cc22
-rw-r--r--apt-pkg/deb/deblistparser.cc6
-rw-r--r--apt-pkg/deb/debsystem.cc4
3 files changed, 21 insertions, 11 deletions
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index ba5b3f266..a89a2574f 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -149,10 +149,11 @@ bool debSourcesIndex::Exists() const
/* */
unsigned long debSourcesIndex::Size() const
{
- struct stat S;
- if (stat(IndexFile("Sources").c_str(),&S) != 0)
+ FileFd f = FileFd (IndexFile("Sources"), FileFd::ReadOnlyGzip);
+
+ if (f.Failed())
return 0;
- return S.st_size;
+ return f.Size();
}
/*}}}*/
@@ -268,10 +269,11 @@ bool debPackagesIndex::Exists() const
/* This is really only used for progress reporting. */
unsigned long debPackagesIndex::Size() const
{
- struct stat S;
- if (stat(IndexFile("Packages").c_str(),&S) != 0)
+ FileFd f = FileFd (IndexFile("Packages"), FileFd::ReadOnlyGzip);
+
+ if (f.Failed())
return 0;
- return S.st_size;
+ return f.Size();
}
/*}}}*/
// PackagesIndex::Merge - Load the index file into a cache /*{{{*/
@@ -458,10 +460,12 @@ bool debTranslationsIndex::Exists() const
/* This is really only used for progress reporting. */
unsigned long debTranslationsIndex::Size() const
{
- struct stat S;
- if (stat(IndexFile(Language).c_str(),&S) != 0)
+ FileFd f = FileFd (IndexFile(Language), FileFd::ReadOnlyGzip);
+
+ if (f.Failed())
return 0;
- return S.st_size;
+
+ return f.Size();
}
/*}}}*/
// TranslationsIndex::Merge - Load the index file into a cache /*{{{*/
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 5fb737970..da8b0271b 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -815,6 +815,12 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
if (Section.FindFlag("NotAutomatic",FileI->Flags,
pkgCache::Flag::NotAutomatic) == false)
_error->Warning("Bad NotAutomatic flag");
+ if (Section.FindFlag("ButAutomaticUpgrades",FileI->Flags,
+ pkgCache::Flag::ButAutomaticUpgrades) == false)
+ _error->Warning("Bad ButAutomaticUpgrades flag");
+ // overrule the NotAutomatic setting if needed as they are both present for compatibility
+ else if ((FileI->Flags & pkgCache::Flag::ButAutomaticUpgrades) == pkgCache::Flag::ButAutomaticUpgrades)
+ FileI->Flags &= ~pkgCache::Flag::NotAutomatic;
return !_error->PendingError();
}
diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc
index ab08a8f4d..8619822df 100644
--- a/apt-pkg/deb/debsystem.cc
+++ b/apt-pkg/deb/debsystem.cc
@@ -164,8 +164,8 @@ bool debSystem::Initialize(Configuration &Cnf)
/* These really should be jammed into a generic 'Local Database' engine
which is yet to be determined. The functions in pkgcachegen should
be the only users of these */
- Cnf.CndSet("Dir::State::extended_states", Cnf.FindDir("Dir::State").append("extended_states"));
- Cnf.CndSet("Dir::State::status", Cnf.FindDir("Dir", "/").append("var/lib/dpkg/status"));
+ Cnf.CndSet("Dir::State::extended_states", "extended_states");
+ Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
if (StatusFile) {