summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-02-17 22:09:25 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-02-17 22:09:25 +0100
commit762d7367f5f74f877ec75986e19fc9d46eef5164 (patch)
treec5ce3f772f278f752ea8c08c2281c9a0b89bddaf /apt-pkg/deb
parentac83edae692c6c7dda7e41e3b27f5cbff0473629 (diff)
parent07f2526e45f9978201817237745727db6177c29a (diff)
merged from debian-sid
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/debindexfile.cc30
-rw-r--r--apt-pkg/deb/deblistparser.cc3
-rw-r--r--apt-pkg/deb/dpkgpm.cc7
3 files changed, 35 insertions, 5 deletions
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index ed7633803..be8175e31 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -306,9 +306,19 @@ pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const
struct stat St;
if (stat(File.FileName(),&St) != 0)
+ {
+ if (_config->FindB("Debug::pkgCacheGen", false))
+ std::clog << "PackagesIndex::FindInCache - stat failed on " << File.FileName() << std::endl;
return pkgCache::PkgFileIterator(Cache);
+ }
if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime)
+ {
+ if (_config->FindB("Debug::pkgCacheGen", false))
+ std::clog << "PackagesIndex::FindInCache - size (" << St.st_size << " <> " << File->Size
+ << ") or mtime (" << St.st_mtime << " <> " << File->mtime
+ << ") doesn't match for " << File.FileName() << std::endl;
return pkgCache::PkgFileIterator(Cache);
+ }
return File;
}
@@ -472,9 +482,19 @@ pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) con
struct stat St;
if (stat(File.FileName(),&St) != 0)
+ {
+ if (_config->FindB("Debug::pkgCacheGen", false))
+ std::clog << "TranslationIndex::FindInCache - stat failed on " << File.FileName() << std::endl;
return pkgCache::PkgFileIterator(Cache);
+ }
if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime)
+ {
+ if (_config->FindB("Debug::pkgCacheGen", false))
+ std::clog << "TranslationIndex::FindInCache - size (" << St.st_size << " <> " << File->Size
+ << ") or mtime (" << St.st_mtime << " <> " << File->mtime
+ << ") doesn't match for " << File.FileName() << std::endl;
return pkgCache::PkgFileIterator(Cache);
+ }
return File;
}
return File;
@@ -541,9 +561,19 @@ pkgCache::PkgFileIterator debStatusIndex::FindInCache(pkgCache &Cache) const
struct stat St;
if (stat(File.FileName(),&St) != 0)
+ {
+ if (_config->FindB("Debug::pkgCacheGen", false))
+ std::clog << "StatusIndex::FindInCache - stat failed on " << File.FileName() << std::endl;
return pkgCache::PkgFileIterator(Cache);
+ }
if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime)
+ {
+ if (_config->FindB("Debug::pkgCacheGen", false))
+ std::clog << "StatusIndex::FindInCache - size (" << St.st_size << " <> " << File->Size
+ << ") or mtime (" << St.st_mtime << " <> " << File->mtime
+ << ") doesn't match for " << File.FileName() << std::endl;
return pkgCache::PkgFileIterator(Cache);
+ }
return File;
}
return File;
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 517b771a5..25b0953e0 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -16,10 +16,9 @@
#include <apt-pkg/strutl.h>
#include <apt-pkg/crc-16.h>
#include <apt-pkg/md5.h>
+#include <apt-pkg/macros.h>
#include <ctype.h>
-
-#include <system.h>
/*}}}*/
static debListParser::WordList PrioList[] = {{"important",pkgCache::State::Important},
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 88098c379..9d144a227 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -580,10 +580,11 @@ bool pkgDPkgPM::OpenLog()
if (!logfile_name.empty())
{
term_out = fopen(logfile_name.c_str(),"a");
+ if (term_out == NULL)
+ return _error->WarningE(_("Could not open file '%s'"), logfile_name.c_str());
+
chmod(logfile_name.c_str(), 0600);
- fprintf(term_out, "\n\nLog started: ");
- fprintf(term_out, "%s", timestr);
- fprintf(term_out, "\n");
+ fprintf(term_out, "\nLog started: %s\n", timestr);
}
// write