]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/sourcelist.cc
* apt-pkg/contrib/fileutl.{cc,h}:
[apt.git] / apt-pkg / sourcelist.cc
index 851eefdfe7547c1090172685fd74cd3787fabeae..c96ccfd77e5adf3af1843ac58b7276d6045d62d6 100644 (file)
@@ -341,4 +341,22 @@ bool pkgSourceList::ReadSourceDir(string Dir)
 
 }
                                                                        /*}}}*/
+// GetLastModified()                                           /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+time_t pkgSourceList::GetLastModifiedTime()
+{
+   // go over the parts
+   string Main = _config->FindFile("Dir::Etc::sourcelist");
+   string Parts = _config->FindDir("Dir::Etc::sourceparts");
+   vector<string> const 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;
+}
+                                                                       /*}}}*/