diff options
Diffstat (limited to 'hscript/script_i.hh')
-rw-r--r-- | hscript/script_i.hh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hscript/script_i.hh b/hscript/script_i.hh index a94a0d7..b91e60f 100644 --- a/hscript/script_i.hh +++ b/hscript/script_i.hh @@ -72,6 +72,9 @@ struct Script::ScriptPrivate { /*! APK repository keys */ std::vector< std::unique_ptr<SigningKey> > repo_keys; + /*! Services to enable */ + std::vector< std::unique_ptr<SvcEnable> > svcs_enable; + /*! User account information */ std::map< std::string, std::unique_ptr<UserDetail> > accounts; @@ -232,6 +235,22 @@ struct Script::ScriptPrivate { return true; } + bool store_svcenable(Key *obj, int line, int *, int *warn, ScriptOptions) { + std::unique_ptr<SvcEnable> svc(dynamic_cast<SvcEnable *>(obj)); + for(const auto &s : svcs_enable) { + if(s->value() == svc->value()) { + if(warn) *warn += 1; + output_warning("installfile:" + std::to_string(line), + "svcenable: service already enabled", + s->value()); + return true; + } + } + + svcs_enable.push_back(std::move(svc)); + return true; + } + bool store_username(Key *obj, int line, int *errors, int *, ScriptOptions) { if(accounts.size() >= 255) { if(errors) *errors += 1; |