]> git.saurik.com Git - apt.git/commitdiff
apt-pkg/sourcelist.cc: GetListOfFilesInDir() fails if the dir does not exists, so...
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 1 Aug 2011 08:56:49 +0000 (10:56 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 1 Aug 2011 08:56:49 +0000 (10:56 +0200)
apt-pkg/sourcelist.cc

index c96ccfd77e5adf3af1843ac58b7276d6045d62d6..aaff16316fe68e49479d05de3a47e20f46b4c2ee 100644 (file)
@@ -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);