diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-01 10:56:49 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-01 10:56:49 +0200 |
commit | 5e7b0aa9eb884f663c3a87968057d9f540fe0175 (patch) | |
tree | e72934a17f12426239dd700f2b52e53105924044 /apt-pkg/sourcelist.cc | |
parent | 3d27d81fd7d4bd0017a177698e891250893309f0 (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.cc | 8 |
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); |