diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-02 16:34:09 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-02 16:34:09 -0500 |
commit | 21ef748c92c10d10d670cd89655ff0b022069b60 (patch) | |
tree | 3efd32bf2be77236f7b02d7ccfbc77c6f41752a8 /hscript/script.cc | |
parent | 9f422751407f2d100080a0075f8b2293b5a080bd (diff) | |
download | horizon-21ef748c92c10d10d670cd89655ff0b022069b60.tar.gz horizon-21ef748c92c10d10d670cd89655ff0b022069b60.tar.bz2 horizon-21ef748c92c10d10d670cd89655ff0b022069b60.tar.xz horizon-21ef748c92c10d10d670cd89655ff0b022069b60.zip |
hscript: More logging and dir creation
Diffstat (limited to 'hscript/script.cc')
-rw-r--r-- | hscript/script.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hscript/script.cc b/hscript/script.cc index 841c546..6eebae8 100644 --- a/hscript/script.cc +++ b/hscript/script.cc @@ -1224,11 +1224,29 @@ bool Script::execute() const { /**************** PRE PACKAGE METADATA ****************/ output_step_start("pre-metadata"); + + /* REQ: Runner.Execute.hostname */ if(!this->internal->hostname->execute(opts)) { EXECUTE_FAILURE("pre-metadata"); return false; } + /* REQ: Runner.Execute.repository */ + if(opts.test(Simulate)) { + std::cout << "mkdir -p /target/etc/apk" << std::endl; + } +#ifdef HAS_INSTALL_ENV + else { + if(!fs::exists("/target/etc/apk", ec)) { + fs::create_directory("/target/etc/apk", ec); + if(ec) { + output_error("internal", "failed to initialise APK"); + EXECUTE_FAILURE("pre-metadata"); + return false; + } + } + } +#endif /* HAS_INSTALL_ENV */ for(auto &repo : this->internal->repos) { if(!repo->execute(opts)) { EXECUTE_FAILURE("pre-metadata"); @@ -1324,6 +1342,7 @@ bool Script::execute() const { } if(opts.test(Simulate)) { + std::cout << "mkdir -p /target/etc/conf.d" << std::endl; std::cout << "cat >>/target/etc/conf.d/net <<- NETCONF_EOF" << std::endl << conf.str() << std::endl << "NETCONF_EOF" << std::endl; @@ -1389,6 +1408,14 @@ bool Script::execute() const { /**************** PKGDB ****************/ output_step_start("pkgdb"); + /* REQ: Runner.Execute.signingkey */ + for(auto &key : this->internal->repo_keys) { + if(!key->execute(opts)) { + EXECUTE_FAILURE("pkgdb"); + return false; + } + } + /* REQ: Runner.Execute.pkginstall.APKDB */ output_info("internal", "initialising APK"); if(opts.test(Simulate)) { |