From 7753e4684e2b80abbed296b90f47be12b4fce8fc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Sep 2010 14:10:26 +0200 Subject: rename the newly public CheckDirectory method to CreateAPTDirectoryIfNeeded to give a better indication what this method will do if called. --- apt-pkg/deb/dpkgpm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index d3c432ce1..395c3fb1a 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -641,7 +641,7 @@ void pkgDPkgPM::WriteHistoryTag(string const &tag, string value) bool pkgDPkgPM::OpenLog() { string const logdir = _config->FindDir("Dir::Log"); - if(CheckDirectory(logdir, logdir) == false) + if(CreateAPTDirectoryIfNeeded(logdir, logdir) == false) // FIXME: use a better string after freeze return _error->Error(_("Directory '%s' missing"), logdir.c_str()); -- cgit v1.2.3 From 5ed56f934dd204cc3a1d757ccf5eac23f8374736 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 14 Sep 2010 18:57:46 +0200 Subject: * apt-pkg/policy.cc: - support 100-pinning in Release file with ButAutomaticUpgrades as requested by the backports crew (Closes: #596097) * apt-pkg/deb/deblistparser.cc: - overrule NotAutomatic in case of ButAutomaticUpgrades --- apt-pkg/deb/deblistparser.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apt-pkg/deb') 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(); } -- cgit v1.2.3 From 5473df3fec08eaea6e84b98551cc247e87f4b6df Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 13 Oct 2010 12:45:47 +0200 Subject: * apt-pkg/deb/debindexfile.cc: - Use FileFd::Size() instead of stat()ing the sources/binary/translations indexes directly, so that we have transparent handling of gzipped indexes. --- apt-pkg/deb/debindexfile.cc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'apt-pkg/deb') 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 /*{{{*/ -- cgit v1.2.3