From: Arvin Schnell Date: Fri, 12 Sep 2014 09:43:18 +0000 (+0200) Subject: - display compile flags also in client X-Git-Tag: v0.2.4~1^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=95da16792c883bcbbd470f38bfdcf74f13602f6b;p=thirdparty%2Fsnapper.git - display compile flags also in client --- diff --git a/client/snapper.cc b/client/snapper.cc index d9925a04..4ef5eb3f 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -1588,7 +1588,8 @@ main(int argc, char** argv) if ((opt = opts.find("version")) != opts.end()) { - cout << "snapper " << VERSION << endl; + cout << "snapper " << Snapper::compileVersion() << endl; + cout << "flags " << Snapper::compileFlags() << endl; exit(EXIT_SUCCESS); } diff --git a/server/Client.cc b/server/Client.cc index d5ee8205..4b0c9b6a 100644 --- a/server/Client.cc +++ b/server/Client.cc @@ -1367,25 +1367,8 @@ Client::debug(DBus::Connection& conn, DBus::Message& msg) const } hoho << "compile options:"; - hoho << " VERSION " VERSION; -#ifdef ENABLE_BTRFS - hoho << " ENABLE_BTRFS"; -#endif -#ifdef ENABLE_LVM - hoho << " ENABLE_LVM"; -#endif -#ifdef ENABLE_EXT4 - hoho << " ENABLE_EXT4"; -#endif -#ifdef ENABLE_XATTRS - hoho << " ENABLE_XATTRS"; -#endif -#ifdef ENABLE_ROLLBACK - hoho << " ENABLE_ROLLBACK"; -#endif -#ifdef HAVE_LIBBTRFS - hoho << " HAVE_LIBBTRFS"; -#endif + hoho << " version " + string(Snapper::compileVersion()); + hoho << " flags " + string(Snapper::compileFlags()); hoho.close_array(); diff --git a/snapper/Snapper.cc b/snapper/Snapper.cc index a4e217ec..56b4698b 100644 --- a/snapper/Snapper.cc +++ b/snapper/Snapper.cc @@ -728,4 +728,50 @@ namespace snapper return !best_match.empty(); } + + const char* + Snapper::compileVersion() + { + return VERSION; + } + + + const char* + Snapper::compileFlags() + { + return + +#ifndef ENABLE_BTRFS + "no-" +#endif + "btrfs," + +#ifndef ENABLE_LVM + "no-" +#endif + "lvm," + +#ifndef ENABLE_EXT4 + "no-" +#endif + "ext4," + +#ifndef ENABLE_XATTRS + "no-" +#endif + "xattrs," + +#ifndef ENABLE_ROLLBACK + "no-" +#endif + "rollback," + +#ifndef ENABLE_BTRFS_QUOTA + "no-" +#endif + "btrfs-quota" + + ; + } + } diff --git a/snapper/Snapper.h b/snapper/Snapper.h index c556234a..e7d9f2c2 100644 --- a/snapper/Snapper.h +++ b/snapper/Snapper.h @@ -170,6 +170,9 @@ namespace snapper void syncAcl() const; + static const char* compileVersion(); + static const char* compileFlags(); + private: void filter1(list& tmp, time_t min_age);