diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-28 15:16:18 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-28 15:16:18 +0200 |
commit | 2ec858bc68bc2d79ec020fe24be2d76b7c5b6792 (patch) | |
tree | 55698335b63621824aa82f8272315fa47eac05cc /apt-pkg/sourcelist.cc | |
parent | cca2efe60edfae106380a55ee4fb561aa570f2c9 (diff) |
* apt-pkg/contrib/fileutl.{cc,h}:
- add GetModificationTime() helper
* apt-pkg/pkgcachegen.cc:
- regenerate the cache if the sources.list changes to ensure
that changes in the ordering there will be honored by apt
* apt-pkg/sourcelist.{cc,h}:
- add pkgSourceList::GetLastModifiedTime() helper
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; +} + /*}}}*/ |