Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
relaxed unit script path resolving. Fixes MER#964
Initial idea was to require unit script path passed during registration to be
always full or relative path. But sometimes it'd be handy to rely on script
presence in the PATH, so let such units to be registered

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
  • Loading branch information
Denis Zalevskiy committed Jul 20, 2015
1 parent 4b3086e commit a759a24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/vault_config.cpp
Expand Up @@ -58,7 +58,14 @@ bool Unit::update(const QVariantMap &data)
if (!src.contains("name") || !src.contains("script")) {
error::raise({{"msg", "Unit description should contain name and script"}});
}
src["script"] = os::path::canonical(src.value("script").toString());
auto script = str(src["script"]);
auto script_path = os::path::canonical(script);
if (!script_path.isEmpty()) {
debug::debug("Full script path:", script_path);
script = script_path;
}
debug::info("Script:", script);
src["script"] = script;
}
for (auto i = src.begin(); i != src.end(); ++i) {
if (!m_data.contains(i.key()) || i.value() != m_data.value(i.key())) {
Expand Down

0 comments on commit a759a24

Please sign in to comment.