summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Zini <enrico@enricozini.org>2013-10-24 20:55:26 +0200
committerEnrico Zini <enrico@enricozini.org>2013-10-24 20:55:26 +0200
commitd9d95d9dab004609b86f39d2da101ca58e595471 (patch)
treee5ff2e9df043e0cb7eb31b828a5e77e833f193d3
parent8893ce8bf6048f553d8cbdcad86c1b4e9b05f3c0 (diff)
downloadlibept-d9d95d9dab004609b86f39d2da101ca58e595471.tar.gz
Fixes a case of sizeof(struct stat) disagreeing between libwibble and libept on some architectures.
-rw-r--r--CMakeLists.txt2
-rw-r--r--debian/changelog7
-rw-r--r--ept/apt/apt.cc10
-rw-r--r--ept/axi/axi.cc6
-rw-r--r--ept/debtags/debtags.cc5
-rw-r--r--ept/debtags/maint/path.cc8
-rw-r--r--ept/debtags/maint/path.h2
-rw-r--r--ept/debtags/vocabulary.cc1
-rw-r--r--ept/popcon/maint/path.cc8
-rw-r--r--ept/popcon/maint/path.h2
10 files changed, 19 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index efd2e70..f60ddc9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ include( FindDoxygen )
add_custom_target( unit )
-set( EPT_VERSION "1.0.11" )
+set( EPT_VERSION "1.0.12" )
# Get the soversion from libapt-pkg to include in our own
execute_process(
diff --git a/debian/changelog b/debian/changelog
index a4179a8..5aaf37b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libept (1.0.12) unstable; urgency=low
+
+ * Fixes a case of sizeof(struct stat) disagreeing between libwibble and
+ libept on some architectures.
+
+ -- Enrico Zini <enrico@debian.org> Thu, 24 Oct 2013 20:55:21 +0200
+
libept (1.0.11) unstable; urgency=low
* Added explicit template instantiation with the symbols aptitude needs.
diff --git a/ept/apt/apt.cc b/ept/apt/apt.cc
index 2d625fb..f3552f9 100644
--- a/ept/apt/apt.cc
+++ b/ept/apt/apt.cc
@@ -31,7 +31,6 @@
#include <apt-pkg/cachefile.h>
#include <wibble/sys/fs.h>
-#include <sys/stat.h>
#include <vector>
#include <algorithm>
@@ -47,13 +46,8 @@ static time_t aptTimestamp()
{
namespace wfs = wibble::sys::fs;
- std::auto_ptr<struct stat> st = wfs::stat(
- _config->FindFile( "Dir::Cache::pkgcache" ) );
- time_t t1 = st.get() == NULL ? 0 : st->st_mtime;
-
- std::auto_ptr<struct stat> st1 = wfs::stat(
- _config->FindFile( "Dir::State::status" ) );
- time_t t2 = st1.get() == NULL ? 0 : st1->st_mtime;
+ time_t t1 = wfs::timestamp(_config->FindFile("Dir::Cache::pkgcache"), 0);
+ time_t t2 = wfs::timestamp(_config->FindFile("Dir::State::status"), 0);
return t1 > t2 ? t1 : t2;
}
diff --git a/ept/axi/axi.cc b/ept/axi/axi.cc
index a9b3203..020d079 100644
--- a/ept/axi/axi.cc
+++ b/ept/axi/axi.cc
@@ -51,11 +51,7 @@ std::string path_db()
time_t timestamp()
{
string tsfile = str::joinpath(m_index_dir, "update-timestamp");
- std::auto_ptr<struct stat> st = sys::fs::stat(tsfile);
- if (st.get())
- return st->st_mtime;
- else
- return 0;
+ return sys::fs::timestamp(tsfile, 0);
}
diff --git a/ept/debtags/debtags.cc b/ept/debtags/debtags.cc
index 068330f..a889ae3 100644
--- a/ept/debtags/debtags.cc
+++ b/ept/debtags/debtags.cc
@@ -39,10 +39,9 @@
#include <sstream>
#include <sys/wait.h> // WIFEXITED WEXITSTATUS
-#include <sys/types.h> // getpwuid, stat, mkdir, getuid
-#include <sys/stat.h> // stat, mkdir
+#include <sys/types.h> // getpwuid, getuid
#include <pwd.h> // getpwuid
-#include <unistd.h> // stat, getuid
+#include <unistd.h> // getuid
using namespace std;
diff --git a/ept/debtags/maint/path.cc b/ept/debtags/maint/path.cc
index 8fdae9a..bb08682 100644
--- a/ept/debtags/maint/path.cc
+++ b/ept/debtags/maint/path.cc
@@ -28,10 +28,9 @@
#include <wibble/sys/fs.h>
#include <wibble/string.h>
-#include <sys/types.h> // getpwuid, stat, mkdir, getuid
-#include <sys/stat.h> // stat, mkdir
+#include <sys/types.h> // getpwuid, getuid
#include <pwd.h> // getpwuid
-#include <unistd.h> // stat, getuid
+#include <unistd.h> // getuid
using namespace wibble;
@@ -65,8 +64,7 @@ int Path::access( const std::string &s, int m ) {
}
time_t Path::timestamp( const std::string& file ) {
- std::auto_ptr<struct stat> st = wibble::sys::fs::stat(file);
- return st.get() == NULL ? 0 : st->st_mtime;
+ return sys::fs::timestamp(file, 0);
}
void Path::setDebtagsSourceDir( const std::string &s )
diff --git a/ept/debtags/maint/path.h b/ept/debtags/maint/path.h
index 0127829..2c7f95e 100644
--- a/ept/debtags/maint/path.h
+++ b/ept/debtags/maint/path.h
@@ -23,8 +23,6 @@
#include <string>
-struct stat;
-
#ifndef EPT_DEBTAGS_PATH_H
#define EPT_DEBTAGS_PATH_H
diff --git a/ept/debtags/vocabulary.cc b/ept/debtags/vocabulary.cc
index 1f85d12..5c84ea4 100644
--- a/ept/debtags/vocabulary.cc
+++ b/ept/debtags/vocabulary.cc
@@ -30,7 +30,6 @@
#include <sstream>
#include <sys/types.h>
-#include <sys/stat.h>
#include <unistd.h>
using namespace std;
diff --git a/ept/popcon/maint/path.cc b/ept/popcon/maint/path.cc
index acb5029..aef6314 100644
--- a/ept/popcon/maint/path.cc
+++ b/ept/popcon/maint/path.cc
@@ -28,10 +28,9 @@
#include <wibble/sys/fs.h>
#include <wibble/string.h>
-#include <sys/types.h> // getpwuid, stat, mkdir, getuid
-#include <sys/stat.h> // stat, mkdir
+#include <sys/types.h> // getpwuid, getuid
#include <pwd.h> // getpwuid
-#include <unistd.h> // stat, getuid
+#include <unistd.h> // getuid
using namespace wibble;
@@ -65,8 +64,7 @@ int Path::access( const std::string &s, int m ) {
}
time_t Path::timestamp( const std::string& file ) {
- std::auto_ptr<struct stat> st = wibble::sys::fs::stat(file);
- return st.get() == NULL ? 0 : st->st_mtime;
+ return sys::fs::timestamp(file, 0);
}
void Path::setPopconSourceDir( const std::string &s )
diff --git a/ept/popcon/maint/path.h b/ept/popcon/maint/path.h
index 5b4306c..cb4c31d 100644
--- a/ept/popcon/maint/path.h
+++ b/ept/popcon/maint/path.h
@@ -26,8 +26,6 @@
#include <string>
-struct stat;
-
namespace ept {
namespace popcon {