From: Arvin Schnell Date: Fri, 23 Nov 2012 14:19:52 +0000 (+0100) Subject: - consistent naming of defines X-Git-Tag: v0.1.3~64 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=c59df283de81f5f7e6ddca7faedd2edd70ee0fdf;p=thirdparty%2Fsnapper.git - consistent naming of defines --- diff --git a/snapper/Filesystem.cc b/snapper/Filesystem.cc index 84a835e2..baf05341 100644 --- a/snapper/Filesystem.cc +++ b/snapper/Filesystem.cc @@ -658,14 +658,14 @@ namespace snapper Lvm::Lvm(const string& subvolume, const string& mount_type) : Filesystem(subvolume), mount_type(mount_type) { - if (access(LVCREATE, X_OK) != 0) + if (access(LVCREATEBIN, X_OK) != 0) { - throw ProgramNotInstalledException(LVCREATE " not installed"); + throw ProgramNotInstalledException(LVCREATEBIN " not installed"); } - if (access(LVS, X_OK) != 0) + if (access(LVSBIN, X_OK) != 0) { - throw ProgramNotInstalledException(LVS " not installed"); + throw ProgramNotInstalledException(LVSBIN " not installed"); } bool found = false; @@ -789,7 +789,7 @@ namespace snapper #endif } - SystemCmd cmd(LVCREATE " --snapshot --name " + quote(snapshotLvName(num)) + " " + + SystemCmd cmd(LVCREATEBIN " --snapshot --name " + quote(snapshotLvName(num)) + " " + quote(vg_name + "/" + lv_name)); if (cmd.retcode() != 0) throw CreateSnapshotFailedException(); @@ -807,7 +807,7 @@ namespace snapper void Lvm::deleteSnapshot(unsigned int num) const { - SystemCmd cmd(LVREMOVE " --force " + quote(vg_name + "/" + snapshotLvName(num))); + SystemCmd cmd(LVREMOVEBIN " --force " + quote(vg_name + "/" + snapshotLvName(num))); if (cmd.retcode() != 0) throw DeleteSnapshotFailedException(); @@ -880,17 +880,16 @@ namespace snapper vg_name = boost::replace_all_copy(rx.cap(1), "--", "-"); lv_name = boost::replace_all_copy(rx.cap(2), "--", "-"); - SystemCmd cmd(LVS " -o segtype --noheadings " + quote(vg_name + "/" + lv_name)); + SystemCmd cmd(LVSBIN " -o segtype --noheadings " + quote(vg_name + "/" + lv_name)); if (cmd.retcode() != 0) { y2err("could not detect segment type infromation from: " << vg_name << "/" << lv_name); return false; } - string str = cmd.getLine(0); - boost::trim(str); + string segtype = boost::trim_copy(cmd.getLine(0)); - if (str.compare("thin")) { + if (segtype.compare("thin")) { y2err(vg_name << "/" << lv_name << " is not a LVM thin volume"); return false; } diff --git a/snapper/SnapperDefines.h b/snapper/SnapperDefines.h index 97a578d3..eb26eb50 100644 --- a/snapper/SnapperDefines.h +++ b/snapper/SnapperDefines.h @@ -39,9 +39,9 @@ #define DIFFBIN "/usr/bin/diff" #define CHATTRBIN "/usr/bin/chattr" -#define LVCREATE "/sbin/lvcreate" -#define LVREMOVE "/sbin/lvremove" -#define LVS "/sbin/lvs" +#define LVCREATEBIN "/sbin/lvcreate" +#define LVREMOVEBIN "/sbin/lvremove" +#define LVSBIN "/sbin/lvs" #endif