summaryrefslogtreecommitdiff
path: root/apt-pkg/sourcelist.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-28 15:19:47 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-28 15:19:47 +0200
commit3671f6810b6306a07f0002b0a808435dad367ab0 (patch)
tree67aa1a70ebf550af64e899348eaddabc07378886 /apt-pkg/sourcelist.cc
parentb20c16833e20da8e367221b32764889cafe5b4c1 (diff)
parent2ec858bc68bc2d79ec020fe24be2d76b7c5b6792 (diff)
merged from lp:~mvo/apt/mvo
Diffstat (limited to 'apt-pkg/sourcelist.cc')
-rw-r--r--apt-pkg/sourcelist.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index 851eefdfe..c96ccfd77 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -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;
+}
+ /*}}}*/