]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- coding style 566/head
authorArvin Schnell <aschnell@suse.de>
Fri, 18 Sep 2020 14:36:10 +0000 (16:36 +0200)
committerArvin Schnell <aschnell@suse.de>
Fri, 18 Sep 2020 14:37:02 +0000 (16:37 +0200)
client/installation-helper.cc
client/utils/Range.h
configure.ac
snapper/Snapper.cc
snapper/SnapperDefines.h

index 735755c04a171d6a458cb827a6b631796135ea15..66567b4c707d824cb2318545079383e03c855b6d 100644 (file)
@@ -73,9 +73,9 @@ step1(const string& device, const string& description, const string& cleanup,
 
     try
     {
-       SysconfigFile config(CONFIGTEMPLATEDIR "/" "default");
+       SysconfigFile config(CONFIG_TEMPLATE_DIR "/" "default");
 
-       config.setName(tmp_mount.getFullname() + CONFIGSDIR "/" "root");
+       config.setName(tmp_mount.getFullname() + CONFIGS_DIR "/" "root");
 
        config.setValue(KEY_SUBVOLUME, "/");
        config.setValue(KEY_FSTYPE, "btrfs");
@@ -195,7 +195,7 @@ step4()
 
     try
     {
-       SysconfigFile sysconfig(SYSCONFIGFILE);
+       SysconfigFile sysconfig(SYSCONFIG_FILE);
        sysconfig.setValue("SNAPPER_CONFIGS", { "root" });
     }
     catch (const FileNotFoundException& e)
index 300a426f64167de9be859fc156e0648d110bf4a7..55f5c60a513edc9184337c0c249da9a4b11fc646 100644 (file)
@@ -20,6 +20,9 @@
  */
 
 
+#ifndef SNAPPER_RANGE_H
+#define SNAPPER_RANGE_H
+
 #include <ostream>
 
 using std::istream;
@@ -49,3 +52,6 @@ private:
     size_t min;
     size_t max;
 };
+
+
+#endif
index 0c3b58f4ead0d0791b32c6f6376bc9da0e854cc5..1191266774b2a0d6846c974506960207094f285c 100644 (file)
@@ -85,7 +85,7 @@ AC_ARG_WITH([conf], AC_HELP_STRING([--with-conf], [Use a custom sysconfig direct
 
 AS_IF([test "x$with_conf" != xno], [SYSCONFIG="${with_conf}"])
 
-CPPFLAGS="${CPPFLAGS} -DCONFDIR='\"${SYSCONFIG}\"'"
+CPPFLAGS="${CPPFLAGS} -DCONF_DIR='\"${SYSCONFIG}\"'"
 
 
 AC_ARG_ENABLE([btrfs], AC_HELP_STRING([--disable-btrfs],[Disable Btrfs internal snapshots support]),
index 3366773b43e79b0a456043ffd1ef8fce60d4615f..6b9f51a2454c332d203a42ed3cf470e65b4bf780 100644 (file)
@@ -59,7 +59,7 @@ namespace snapper
 
 
     ConfigInfo::ConfigInfo(const string& config_name, const string& root_prefix)
-       : SysconfigFile(prepend_root_prefix(root_prefix, CONFIGSDIR "/" + config_name)),
+       : SysconfigFile(prepend_root_prefix(root_prefix, CONFIGS_DIR "/" + config_name)),
          config_name(config_name), subvolume("/")
     {
        if (!getValue(KEY_SUBVOLUME, subvolume))
@@ -156,7 +156,7 @@ namespace snapper
     void
     Snapper::loadIgnorePatterns()
     {
-       const list<string> files = glob(FILTERSDIR "/*.txt", GLOB_NOSORT);
+       const list<string> files = glob(FILTERS_DIR "/*.txt", GLOB_NOSORT);
        for (list<string>::const_iterator it = files.begin(); it != files.end(); ++it)
        {
            try
@@ -275,7 +275,7 @@ namespace snapper
 
        try
        {
-           SysconfigFile sysconfig(prepend_root_prefix(root_prefix, SYSCONFIGFILE));
+           SysconfigFile sysconfig(prepend_root_prefix(root_prefix, SYSCONFIG_FILE));
            vector<string> config_names;
            sysconfig.getValue("SNAPPER_CONFIGS", config_names);
 
@@ -333,7 +333,7 @@ namespace snapper
            }
        }
 
-       if (access(string(CONFIGTEMPLATEDIR "/" + template_name).c_str(), R_OK) != 0)
+       if (access(string(CONFIG_TEMPLATE_DIR "/" + template_name).c_str(), R_OK) != 0)
        {
            SN_THROW(CreateConfigFailedException("cannot access template config"));
        }
@@ -354,7 +354,7 @@ namespace snapper
 
        try
        {
-           SysconfigFile sysconfig(SYSCONFIGFILE);
+           SysconfigFile sysconfig(SYSCONFIG_FILE);
            vector<string> config_names;
            sysconfig.getValue("SNAPPER_CONFIGS", config_names);
            if (find(config_names.begin(), config_names.end(), config_name) != config_names.end())
@@ -372,9 +372,9 @@ namespace snapper
 
        try
        {
-           SysconfigFile config(CONFIGTEMPLATEDIR "/" + template_name);
+           SysconfigFile config(CONFIG_TEMPLATE_DIR "/" + template_name);
 
-           config.setName(CONFIGSDIR "/" + config_name);
+           config.setName(CONFIGS_DIR "/" + config_name);
 
            config.setValue(KEY_SUBVOLUME, subvolume);
            config.setValue(KEY_FSTYPE, filesystem->fstype());
@@ -392,14 +392,14 @@ namespace snapper
        {
            SN_CAUGHT(e);
 
-           SysconfigFile sysconfig(SYSCONFIGFILE);
+           SysconfigFile sysconfig(SYSCONFIG_FILE);
            vector<string> config_names;
            sysconfig.getValue("SNAPPER_CONFIGS", config_names);
            config_names.erase(remove(config_names.begin(), config_names.end(), config_name),
                               config_names.end());
            sysconfig.setValue("SNAPPER_CONFIGS", config_names);
 
-           SystemCmd cmd(RMBIN " " + quote(CONFIGSDIR "/" + config_name));
+           SystemCmd cmd(RMBIN " " + quote(CONFIGS_DIR "/" + config_name));
 
            SN_RETHROW(e);
        }
@@ -449,7 +449,7 @@ namespace snapper
            SN_THROW(DeleteConfigFailedException("deleting snapshot failed"));
        }
 
-       SystemCmd cmd1(RMBIN " " + quote(CONFIGSDIR "/" + config_name));
+       SystemCmd cmd1(RMBIN " " + quote(CONFIGS_DIR "/" + config_name));
        if (cmd1.retcode() != 0)
        {
            SN_THROW(DeleteConfigFailedException("deleting config-file failed"));
@@ -457,7 +457,7 @@ namespace snapper
 
        try
        {
-           SysconfigFile sysconfig(SYSCONFIGFILE);
+           SysconfigFile sysconfig(SYSCONFIG_FILE);
            vector<string> config_names;
            sysconfig.getValue("SNAPPER_CONFIGS", config_names);
            config_names.erase(remove(config_names.begin(), config_names.end(), config_name),
index 8490894c9ba6332cb132722f5a677e69e8158ccc..133331214519ba2f0b7d432894a194180f2f071b 100644 (file)
 
 // path definitions
 
-#define SYSCONFIGFILE CONFDIR "/snapper"
+#define SYSCONFIG_FILE CONF_DIR "/snapper"
 
-#define CONFIGSDIR "/etc/snapper/configs"
-#define CONFIGTEMPLATEDIR "/etc/snapper/config-templates"
+#define CONFIGS_DIR "/etc/snapper/configs"
+#define CONFIG_TEMPLATE_DIR "/etc/snapper/config-templates"
 
-#define FILTERSDIR "/etc/snapper/filters"
+#define FILTERS_DIR "/etc/snapper/filters"
 
 
 // keys from the config files