]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- display compile flags also in client 111/head
authorArvin Schnell <aschnell@suse.de>
Fri, 12 Sep 2014 09:43:18 +0000 (11:43 +0200)
committerArvin Schnell <aschnell@suse.de>
Fri, 12 Sep 2014 09:43:18 +0000 (11:43 +0200)
client/snapper.cc
server/Client.cc
snapper/Snapper.cc
snapper/Snapper.h

index d9925a0407a4b0e4ee3bac6d9334eb9532c99cbd..4ef5eb3f35da461482e4331b1b7608ee23f7ed42 100644 (file)
@@ -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);
     }
 
index d5ee82054a97e92888633d5cb0e8b1ea14b575c1..4b0c9b6ab2e9aac35c8e3621b54a76384778c029 100644 (file)
@@ -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();
 
index a4e217ec60cb0799fc14e3ec2df35c5c8c7be354..56b4698bab54cb07fcddc9dcaa932b0a2ec0c3c9 100644 (file)
@@ -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"
+
+           ;
+    }
+
 }
index c556234ae1df9e7797afc9fd624adca078550a7b..e7d9f2c289c534acb3b8bd714f784fbe686ba09d 100644 (file)
@@ -170,6 +170,9 @@ namespace snapper
 
        void syncAcl() const;
 
+       static const char* compileVersion();
+       static const char* compileFlags();
+
     private:
 
        void filter1(list<Snapshots::iterator>& tmp, time_t min_age);