From: Arvin Schnell Date: Mon, 16 Feb 2015 14:12:56 +0000 (+0100) Subject: - allow to set description for inital subvolume X-Git-Tag: v0.2.6~1^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cc96dd5d9c3662798f3ef448018c8929089ddb2;p=thirdparty%2Fsnapper.git - allow to set description for inital subvolume --- diff --git a/client/installation-helper.cc b/client/installation-helper.cc index fff26a48..a878741e 100644 --- a/client/installation-helper.cc +++ b/client/installation-helper.cc @@ -44,7 +44,7 @@ using namespace std; void -step1(const string& device) +step1(const string& device, const string& description) { // step runs in inst-sys @@ -88,6 +88,7 @@ step1(const string& device) SCD scd; scd.read_only = false; + scd.description = description; Snapshots::iterator snapshot = snapper.createSingleSnapshot(scd); @@ -181,6 +182,7 @@ main(int argc, char** argv) { "device", required_argument, 0, 0 }, { "root-prefix", required_argument, 0, 0 }, { "default-subvolume-name", required_argument, 0, 0 }, + { "description", required_argument, 0, 0 }, { 0, 0, 0, 0 } }; @@ -188,6 +190,7 @@ main(int argc, char** argv) string device; string root_prefix = "/"; string default_subvolume_name; + string description; GetOpts getopts; @@ -209,8 +212,11 @@ main(int argc, char** argv) if ((opt = opts.find("default-subvolume-name")) != opts.end()) default_subvolume_name = opt->second; + if ((opt = opts.find("description")) != opts.end()) + description = opt->second; + if (step == "1") - step1(device); + step1(device, description); else if (step == "2") step2(device, root_prefix, default_subvolume_name); else if (step == "3")