summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli_shell_api.cpp8
-rw-r--r--src/cstore/cstore.cpp11
-rw-r--r--src/cstore/unionfs/cstore-unionfs.cpp18
-rw-r--r--src/cstore/unionfs/cstore-unionfs.hpp3
4 files changed, 28 insertions, 12 deletions
diff --git a/src/cli_shell_api.cpp b/src/cli_shell_api.cpp
index aa8eafd..8a38a63 100644
--- a/src/cli_shell_api.cpp
+++ b/src/cli_shell_api.cpp
@@ -686,7 +686,7 @@ static OpT ops[] = {
OP(cfReturnValue, -1, NULL, 2, "Must specify config file and path", false),
OP(cfReturnValues, -1, NULL, 2, "Must specify config file and path", false),
- {NULL, -1, NULL, -1, NULL, NULL, false}
+ {NULL, -1, NULL, -1, NULL, false, NULL}
};
#define OP_exact_args ops[op_idx].op_exact_args
#define OP_min_args ops[op_idx].op_min_args
@@ -716,6 +716,12 @@ struct option options[] = {
int
main(int argc, char **argv)
{
+ fprintf(stderr, "DEBUG %s", argv[0]);
+ for (int i = 1; i < argc; i++) {
+ fprintf(stderr, " '%s'", argv[i]); // DEBUG
+ }
+ fprintf(stderr, "\n"); // DEBUG
+
// handle options first
int c = 0;
while ((c = getopt_long(argc, argv, "", options, NULL)) != -1) {
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);