summaryrefslogtreecommitdiff
path: root/apt-pkg/sourcelist.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-29 13:42:15 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-29 13:42:15 +0200
commit1aab53cbb6b72bb5fb7853396dbbe9d4c8217230 (patch)
tree05ae903e889a8380dee1335c6d03e7699c82b0e8 /apt-pkg/sourcelist.cc
parentf448075d89fedde182e6c2a59c89808e403b7f66 (diff)
parent64dda04bd949ab73ca77732fcc5149cc7c2a5557 (diff)
merged from the lp:~mvo/apt/mvo branch
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;
+}
+ /*}}}*/