]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/sourcelist.cc
* apt-pkg/acquire-item.{cc,h}:
[apt.git] / apt-pkg / sourcelist.cc
index 851eefdfe7547c1090172685fd74cd3787fabeae..aaff16316fe68e49479d05de3a47e20f46b4c2ee 100644 (file)
@@ -341,4 +341,26 @@ bool pkgSourceList::ReadSourceDir(string Dir)
 
 }
                                                                        /*}}}*/
 
 }
                                                                        /*}}}*/
+// GetLastModified()                                           /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+time_t pkgSourceList::GetLastModifiedTime()
+{
+   vector<string> List;
+
+   string Main = _config->FindFile("Dir::Etc::sourcelist");
+   string Parts = _config->FindDir("Dir::Etc::sourceparts");
+
+   // go over the parts
+   if (DirectoryExists(Parts) == true)
+      List = GetListOfFilesInDir(Parts, "list", true);
+
+   // calculate the time
+   time_t mtime_sources = GetModificationTime(Main);
+   for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+      mtime_sources = std::max(mtime_sources, GetModificationTime(*I));
+
+   return mtime_sources;
+}
+                                                                       /*}}}*/