diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-15 01:53:55 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-15 01:53:55 -0500 |
commit | a42230d6351db5f3dab0ce2820006a84495200e3 (patch) | |
tree | e948274d07aba705c17815317905eb4e5c9773cc | |
parent | 3b6a0426891303b3225cd914dae5f9ee345a1f14 (diff) | |
download | horizon-a42230d6351db5f3dab0ce2820006a84495200e3.tar.gz horizon-a42230d6351db5f3dab0ce2820006a84495200e3.tar.bz2 horizon-a42230d6351db5f3dab0ce2820006a84495200e3.tar.xz horizon-a42230d6351db5f3dab0ce2820006a84495200e3.zip |
script: More efficiently call apk
-rw-r--r-- | hscript/script_e.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hscript/script_e.cc b/hscript/script_e.cc index 8bb9196..acaffda 100644 --- a/hscript/script_e.cc +++ b/hscript/script_e.cc @@ -481,10 +481,13 @@ bool Script::execute() const { return false; } - std::vector<std::string> params = {"--root", targetDirectory(), "add"}; + std::vector<std::string> params(this->internal->packages.size() + 3); + params[0] = "--root"; + params[1] = targetDirectory(); + params[2] = "add"; std::copy(this->internal->packages.begin(), this->internal->packages.end(), - params.end()); + params.begin() + 3); if(run_command("/sbin/apk", params) != 0) { EXECUTE_FAILURE("pkginstall"); |