if ((opt = opts.find("version")) != opts.end())
{
- cout << "snapper " << VERSION << endl;
+ cout << "snapper " << Snapper::compileVersion() << endl;
+ cout << "flags " << Snapper::compileFlags() << endl;
exit(EXIT_SUCCESS);
}
}
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();
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"
+
+ ;
+ }
+
}
void syncAcl() const;
+ static const char* compileVersion();
+ static const char* compileFlags();
+
private:
void filter1(list<Snapshots::iterator>& tmp, time_t min_age);