summaryrefslogtreecommitdiff
path: root/hscript/script.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-26 02:42:30 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-26 02:42:30 -0500
commit8b00a5779ace2b919f6d9f31fb50d37086a78914 (patch)
treeae07a14086aead37138c494207515e8e2ee914c4 /hscript/script.cc
parent441543b73cffd6c589e4c848113dd126d984e07f (diff)
downloadhorizon-8b00a5779ace2b919f6d9f31fb50d37086a78914.tar.gz
horizon-8b00a5779ace2b919f6d9f31fb50d37086a78914.tar.bz2
horizon-8b00a5779ace2b919f6d9f31fb50d37086a78914.tar.xz
horizon-8b00a5779ace2b919f6d9f31fb50d37086a78914.zip
hscript: Implement (undocumented, untested) 'version' key
Diffstat (limited to 'hscript/script.cc')
-rw-r--r--hscript/script.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/hscript/script.cc b/hscript/script.cc
index a3fb512..8fc15f7 100644
--- a/hscript/script.cc
+++ b/hscript/script.cc
@@ -51,6 +51,7 @@ const std::map<std::string, key_parse_fn> valid_keys = {
{"repository", &Repository::parseFromData},
{"signingkey", &SigningKey::parseFromData},
{"svcenable", &SvcEnable::parseFromData},
+ {"version", &Version::parseFromData},
{"netconfigtype", &NetConfigType::parseFromData},
{"netaddress", &NetAddress::parseFromData},
@@ -122,6 +123,8 @@ bool Script::ScriptPrivate::store_key(const std::string &key_name, Key *obj,
return true;
} else if(key_name == "svcenable") {
return store_svcenable(obj, pos, errors, warnings, opts);
+ } else if(key_name == "version") {
+ return store_version(obj, pos, errors, warnings, opts);
} else if(key_name == "username") {
return store_username(obj, pos, errors, warnings, opts);
} else if(key_name == "useralias") {
@@ -381,6 +384,8 @@ const Keys::Key *Script::getOneValue(std::string name) const {
return this->internal->lang.get();
} else if(name == "keymap") {
return this->internal->keymap.get();
+ } else if(name == "version") {
+ return this->internal->version.get();
} else if(name == "firmware") {
#ifdef NON_LIBRE_FIRMWARE
return this->internal->firmware.get();
@@ -410,6 +415,8 @@ const std::vector<Keys::Key *> Script::getValues(std::string name) const {
for(auto &repo : this->internal->repos) values.push_back(repo.get());
} else if(name == "signing_key") {
for(auto &key : this->internal->repo_keys) values.push_back(key.get());
+ } else if(name == "svcenable") {
+ for(auto &svc : this->internal->svcs_enable) values.push_back(svc.get());
} else if(name == "username" || name == "useralias" || name == "userpw" ||
name == "usericon" || name == "usergroups") {
/* XXX */