]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Add defines into source code to support configuration time parameters
authorOndrej Kozina <okozina@redhat.com>
Wed, 22 Aug 2012 14:15:01 +0000 (16:15 +0200)
committerArvin Schnell <aschnell@suse.de>
Wed, 22 Aug 2012 14:48:20 +0000 (16:48 +0200)
Add defines into related source files

snapper/Filesystem.cc
snapper/Filesystem.h

index 1dac1684a03ddb45f2f4d81872600468508bede4..2aabfded08729057f32e7dd51a0c18bb7496cf09 100644 (file)
@@ -34,6 +34,7 @@
 #include "snapper/SystemCmd.h"
 #include "snapper/SnapperDefines.h"
 #include "snapper/Regex.h"
+#include "config.h"
 
 
 namespace snapper
@@ -68,7 +69,17 @@ namespace snapper
     {
        typedef Filesystem* (*func_t)(const string& fstype, const string& subvolume);
 
-       static const func_t funcs[] = { &Btrfs::create, &Ext4::create, &Lvm::create, NULL };
+       static const func_t funcs[] = {
+#ifdef ENABLE_BTRFS
+               &Btrfs::create,
+#endif
+#ifdef ENABLE_EXT4
+               &Ext4::create,
+#endif
+#ifdef ENABLE_LVM
+               &Lvm::create,
+#endif
+       NULL };
 
        for (const func_t* func = funcs; *func != NULL; ++func)
        {
@@ -82,6 +93,7 @@ namespace snapper
     }
 
 
+#ifdef ENABLE_BTRFS
     Filesystem*
     Btrfs::create(const string& fstype, const string& subvolume)
     {
@@ -178,8 +190,10 @@ namespace snapper
     {
        return checkDir(snapshotDir(num));
     }
+    // ENABLE_BTRFS
+#endif
 
-
+#ifdef ENABLE_EXT4
     Filesystem*
     Ext4::create(const string& fstype, const string& subvolume)
     {
@@ -374,8 +388,10 @@ namespace snapper
     {
        return checkNormalFile(snapshotFile(num));
     }
+    // ENABLE_EXT4
+#endif
 
-
+#ifdef ENABLE_LVM
     Filesystem*
     Lvm::create(const string& fstype, const string& subvolume)
     {
@@ -562,5 +578,7 @@ namespace snapper
        return "/dev/mapper/" + boost::replace_all_copy(vg_name, "-", "--") + "-" +
            boost::replace_all_copy(snapshotLvName(num), "-", "--");
     }
+    // ENABLE_LVM
+#endif
 
 }
index 6383b4f3f3a058affd76cb4ab23503504442b987..7e5a6ef68e5d68be4f356cf1938f8cbfa4740b57 100644 (file)
@@ -27,6 +27,7 @@
 #include <string>
 #include <vector>
 
+#include "config.h"
 
 namespace snapper
 {
@@ -70,7 +71,7 @@ namespace snapper
 
     };
 
-
+#ifdef ENABLE_BTRFS
     class Btrfs : public Filesystem
     {
     public:
@@ -97,8 +98,9 @@ namespace snapper
        virtual bool checkSnapshot(unsigned int num) const;
 
     };
+#endif
 
-
+#ifdef ENABLE_EXT4
     class Ext4 : public Filesystem
     {
     public:
@@ -130,8 +132,9 @@ namespace snapper
        vector<string> mount_options;
 
     };
+#endif
 
-
+#ifdef ENABLE_LVM
     class Lvm : public Filesystem
     {
     public:
@@ -172,6 +175,7 @@ namespace snapper
        vector<string> mount_options;
 
     };
+#endif
 
 }