From c098234adce846c70b52c3e6c1a6edba2793e880 Mon Sep 17 00:00:00 2001 From: Denis Zalevskiy Date: Mon, 11 May 2015 15:24:23 +0300 Subject: [PATCH] [unit] pass unit name to the unit script. Contributes to MER#980 Signed-off-by: Denis Zalevskiy --- src/unit.cpp | 2 ++ src/vault.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/unit.cpp b/src/unit.cpp index 9a3f51f..a096b9a 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -35,6 +35,8 @@ QVariantMap options_info , {"required", true}, {"has_param", true}})} , {"home-dir", map({{"short", "H"}, {"long", "home-dir"} , {"required", true}, {"has_param", true}})} + , {"name", map({{"short", "n"}, {"long", "name"} + , {"required", true}, {"has_param", true}})} , {"action", map({{"short", "a"}, {"long", "action"} , {"required", true}, {"has_param", true}})}}; diff --git a/src/vault.cpp b/src/vault.cpp index de6ca44..446d212 100644 --- a/src/vault.cpp +++ b/src/vault.cpp @@ -635,6 +635,7 @@ struct Unit error::raise({{"msg", "Should be executable"}, {"script", script}}); } QStringList args = { "--action", action, + "--name", m_unit, "--dir", QDir(m_data).absolutePath(), "--bin-dir", QDir(m_blobs).absolutePath(), "--home-dir", m_home };