1 : // -*- C++ -*-
2 : #include <ept/core/apt.h>
3 : #include <wibble/sys/fs.h>
4 :
5 : namespace wfs = wibble::sys::fs;
6 :
7 : namespace ept {
8 : namespace core {
9 45 : time_t aptTimestamp()
10 : {
11 : std::auto_ptr<struct stat> st = wfs::stat(
12 45 : _config->FindFile( "Dir::Cache::pkgcache" ) );
13 45 : time_t t1 = st.get() == NULL ? 0 : st->st_mtime;
14 :
15 : std::auto_ptr<struct stat> st1 = wfs::stat(
16 45 : _config->FindFile( "Dir::State::status" ) );
17 45 : time_t t2 = st1.get() == NULL ? 0 : st1->st_mtime;
18 :
19 45 : return t1 > t2 ? t1 : t2;
20 : }
21 :
22 : }
23 6 : }
|