diff options
author | Thomas Jepp <tom@tomjepp.co.uk> | 2015-11-23 17:12:18 +0000 |
---|---|---|
committer | Thomas Jepp <tom@tomjepp.co.uk> | 2015-11-23 17:12:18 +0000 |
commit | ae41f9478892be200ecc45e2d831712136aac058 (patch) | |
tree | c7284934ddf657f72c1cc29fff877cbbb5657c79 /src/cstore | |
parent | 2fef9b9461cec9487f0df6648d8395b3475cb08e (diff) | |
download | vyatta-cfg-ae41f9478892be200ecc45e2d831712136aac058.tar.gz vyatta-cfg-ae41f9478892be200ecc45e2d831712136aac058.zip |
Build fixes for updated libraries on Jessie.
Diffstat (limited to 'src/cstore')
-rw-r--r-- | src/cstore/cstore.cpp | 11 | ||||
-rw-r--r-- | src/cstore/unionfs/cstore-unionfs.cpp | 18 | ||||
-rw-r--r-- | src/cstore/unionfs/cstore-unionfs.hpp | 3 |
3 files changed, 21 insertions, 11 deletions
diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp index 43abebd..485dcdb 100644 --- a/src/cstore/cstore.cpp +++ b/src/cstore/cstore.cpp @@ -28,6 +28,7 @@ // for debian's version comparison algorithm #define APT_COMPATIBILITY 986 #include <apt-pkg/version.h> +#include <apt-pkg/debversion.h> #include <cli_cstore.h> #include <cstore/cstore.hpp> @@ -2023,7 +2024,14 @@ Cstore::assert_internal(bool cond, const char *fmt, ...) bool Cstore::sort_func_deb_version(string a, string b) { - return (pkgVersionCompare(a, b) < 0); + debVersioningSystem debVersioning; + + const char* A = a.c_str(); + const char* B = b.c_str(); + const char* Aend = A + a.length(); + const char* Bend = B + b.length(); + + return debVersioning.DoCmpVersion(A, Aend, B, Bend) > 0; } void @@ -2987,6 +2995,7 @@ Cstore::vexit_internal(const char *fmt, va_list alist) char buf[256]; vsnprintf(buf, 256, fmt, alist); output_internal("%s\n", buf); + fprintf(stderr, "DEBUG vexit_internal: %s\n", buf); // DEBUG if (Perl_get_context()) { /* we're in a perl context. do a croak to provide more information. * note that the message should not end in "\n", or the croak message diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp index dccb626..1324d79 100644 --- a/src/cstore/unionfs/cstore-unionfs.cpp +++ b/src/cstore/unionfs/cstore-unionfs.cpp @@ -393,7 +393,7 @@ UnionfsCstore::setupSession() try { b_fs::directory_iterator di(work_base.path_cstr()); for (; di != b_fs::directory_iterator(); ++di) { - old_config = di->path().file_string().c_str(); + old_config = di->path().c_str(); if (path_is_directory(old_config)) { directories.push_back(old_config); } @@ -1211,12 +1211,12 @@ UnionfsCstore::unmark_deactivated_descendants() vector<b_fs::path> markers; b_fs::recursive_directory_iterator di(get_work_path().path_cstr()); for (; di != b_fs::recursive_directory_iterator(); ++di) { - if (!path_is_regular(di->path().file_string().c_str()) + if (!path_is_regular(di->path().c_str()) || di->path().filename() != C_MARKER_DEACTIVATE) { // not marker continue; } - const char *ppath = di->path().parent_path().file_string().c_str(); + const char *ppath = di->path().parent_path().c_str(); if (strcmp(ppath, get_work_path().path_cstr()) == 0) { // don't unmark the node itself continue; @@ -1279,7 +1279,7 @@ UnionfsCstore::unmark_changed_with_descendants() vector<b_fs::path> markers; b_fs::recursive_directory_iterator di(get_work_path().path_cstr()); for (; di != b_fs::recursive_directory_iterator(); ++di) { - if (!path_is_regular(di->path().file_string().c_str()) + if (!path_is_regular(di->path().c_str()) || di->path().filename() != C_MARKER_CHANGED) { // not marker continue; @@ -1338,7 +1338,7 @@ UnionfsCstore::discard_changes(unsigned long long& num_removed) // iterate through all entries in change root b_fs::directory_iterator di(change_root.path_cstr()); for (; di != b_fs::directory_iterator(); ++di) { - if (path_is_directory(di->path().file_string().c_str())) { + if (path_is_directory(di->path().c_str())) { directories.push_back(di->path()); } else { files.push_back(di->path()); @@ -1471,10 +1471,10 @@ UnionfsCstore::check_dir_entries(const FsPath& root, vector<string> *cnodes, try { b_fs::directory_iterator di(root.path_cstr()); for (; di != b_fs::directory_iterator(); ++di) { - string cname = di->path().filename(); + string cname = di->path().filename().c_str(); if (filter_nodes) { // must be directory - if (!path_is_directory(di->path().file_string().c_str())) { + if (!path_is_directory(di->path().c_str())) { continue; } // name cannot start with "." @@ -1573,14 +1573,14 @@ UnionfsCstore::recursive_copy_dir(const FsPath& src, const FsPath& dst, b_fs::recursive_directory_iterator di(src_str); for (; di != b_fs::recursive_directory_iterator(); ++di) { - const char *oname = di->path().file_string().c_str(); + const char *oname = di->path().c_str(); string nname = oname; nname.replace(0, src_str.length(), dst_str); if (path_is_directory(oname)) { b_fs::create_directory(nname); } else { if (filter_dot_entries) { - string of = di->path().filename(); + string of = di->path().filename().c_str(); if (!of.empty() && of.at(0) == '.') { // filter dot files (with exceptions) if (of != C_COMMENT_FILE) { diff --git a/src/cstore/unionfs/cstore-unionfs.hpp b/src/cstore/unionfs/cstore-unionfs.hpp index fa504ab..95c2b63 100644 --- a/src/cstore/unionfs/cstore-unionfs.hpp +++ b/src/cstore/unionfs/cstore-unionfs.hpp @@ -291,7 +291,8 @@ private: // boost fs operations wrappers bool b_fs_get_file_status(const char *path, b_fs::file_status& fs) { b_s::error_code ec; - fs = b_fs::detail::status_api(path, ec); + b_s::error_code* p_ec = &ec; + fs = b_fs::detail::status(path, p_ec); return (!ec); }; bool path_exists(const char *path); |