summaryrefslogtreecommitdiff
path: root/apt-pkg/sourcelist.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-08-01 10:56:49 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-08-01 10:56:49 +0200
commit5e7b0aa9eb884f663c3a87968057d9f540fe0175 (patch)
treee72934a17f12426239dd700f2b52e53105924044 /apt-pkg/sourcelist.cc
parent3d27d81fd7d4bd0017a177698e891250893309f0 (diff)
apt-pkg/sourcelist.cc: GetListOfFilesInDir() fails if the dir does not exists, so test before using that
Diffstat (limited to 'apt-pkg/sourcelist.cc')
-rw-r--r--apt-pkg/sourcelist.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index c96ccfd77..aaff16316 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -346,10 +346,14 @@ bool pkgSourceList::ReadSourceDir(string Dir)
/* */
time_t pkgSourceList::GetLastModifiedTime()
{
- // go over the parts
+ vector<string> List;
+
string Main = _config->FindFile("Dir::Etc::sourcelist");
string Parts = _config->FindDir("Dir::Etc::sourceparts");
- vector<string> const List = GetListOfFilesInDir(Parts, "list", true);
+
+ // go over the parts
+ if (DirectoryExists(Parts) == true)
+ List = GetListOfFilesInDir(Parts, "list", true);
// calculate the time
time_t mtime_sources = GetModificationTime(Main);