diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-12-19 17:14:27 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-12-19 17:14:27 -0600 |
commit | 2495654ac0b1d9a4002f8d385d10d2afec784dda (patch) | |
tree | da8b25a9bbaa3ab3bc2901398db4a0a3ec74481c /hscript/script_i.hh | |
parent | 3744e909df78cefebb083e401f6f6378f27d1b1a (diff) | |
download | horizon-2495654ac0b1d9a4002f8d385d10d2afec784dda.tar.gz horizon-2495654ac0b1d9a4002f8d385d10d2afec784dda.tar.bz2 horizon-2495654ac0b1d9a4002f8d385d10d2afec784dda.tar.xz horizon-2495654ac0b1d9a4002f8d385d10d2afec784dda.zip |
hscript: Add 'arch' key implementation and related tests
Diffstat (limited to 'hscript/script_i.hh')
-rw-r--r-- | hscript/script_i.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hscript/script_i.hh b/hscript/script_i.hh index cb7da13..9d854eb 100644 --- a/hscript/script_i.hh +++ b/hscript/script_i.hh @@ -46,6 +46,8 @@ struct Script::ScriptPrivate { std::set<std::string> packages; /*! The root shadow line. */ std::unique_ptr<RootPassphrase> rootpw; + /*! The system CPU architecture. */ + std::unique_ptr<Arch> arch; /*! The system language. */ std::unique_ptr<Language> lang; /*! The system keymap. */ @@ -148,6 +150,16 @@ struct Script::ScriptPrivate { return true; } + bool store_arch(Key* obj, int line, int *errors, int *, ScriptOptions) { + if(arch) { + DUPLICATE_ERROR(arch, "arch", arch->value()) + return false; + } + std::unique_ptr<Arch> a(dynamic_cast<Arch *>(obj)); + arch = std::move(a); + return true; + } + bool store_rootpw(Key* obj, int line, int *errors, int *, ScriptOptions) { if(rootpw) { DUPLICATE_ERROR(rootpw, "rootpw", "an encrypted passphrase") |