#include "snapper/SystemCmd.h"
#include "snapper/SnapperDefines.h"
#include "snapper/Regex.h"
+#include "config.h"
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)
{
}
+#ifdef ENABLE_BTRFS
Filesystem*
Btrfs::create(const string& fstype, const string& subvolume)
{
{
return checkDir(snapshotDir(num));
}
+ // ENABLE_BTRFS
+#endif
-
+#ifdef ENABLE_EXT4
Filesystem*
Ext4::create(const string& fstype, const string& subvolume)
{
{
return checkNormalFile(snapshotFile(num));
}
+ // ENABLE_EXT4
+#endif
-
+#ifdef ENABLE_LVM
Filesystem*
Lvm::create(const string& fstype, const string& subvolume)
{
return "/dev/mapper/" + boost::replace_all_copy(vg_name, "-", "--") + "-" +
boost::replace_all_copy(snapshotLvName(num), "-", "--");
}
+ // ENABLE_LVM
+#endif
}
#include <string>
#include <vector>
+#include "config.h"
namespace snapper
{
};
-
+#ifdef ENABLE_BTRFS
class Btrfs : public Filesystem
{
public:
virtual bool checkSnapshot(unsigned int num) const;
};
+#endif
-
+#ifdef ENABLE_EXT4
class Ext4 : public Filesystem
{
public:
vector<string> mount_options;
};
+#endif
-
+#ifdef ENABLE_LVM
class Lvm : public Filesystem
{
public:
vector<string> mount_options;
};
+#endif
}