diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-01 13:57:28 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-01 13:57:28 +0200 |
commit | 7ca05341380434ae9e557d16d1ae88d133f0490c (patch) | |
tree | 80727cee5057edf257ab28da947643c5fbbe6f10 /apt-pkg/sourcelist.cc | |
parent | fc15861a405a0b0483bb8989e6a43215a86dba55 (diff) | |
parent | 77de0e831a12aedde05ff6bff8fb07dcbb4074ad (diff) |
merged from lp:~mvo/apt/mvo
Diffstat (limited to 'apt-pkg/sourcelist.cc')
-rw-r--r-- | apt-pkg/sourcelist.cc | 18 |
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; +} + /*}}}*/ |