summaryrefslogtreecommitdiff
path: root/hscript/meta.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-13 04:02:18 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-13 04:02:18 -0500
commit7a09ff3f1d271258f81d9d1f6505c22daa605eed (patch)
treeb5e6b8aef45cee1eb57931535e4427256dd11d08 /hscript/meta.cc
parent865571068d0e7327a41c42ae46202c95b3f116a9 (diff)
downloadhorizon-7a09ff3f1d271258f81d9d1f6505c22daa605eed.tar.gz
horizon-7a09ff3f1d271258f81d9d1f6505c22daa605eed.tar.bz2
horizon-7a09ff3f1d271258f81d9d1f6505c22daa605eed.tar.xz
horizon-7a09ff3f1d271258f81d9d1f6505c22daa605eed.zip
hscript, tools: Support shell writing in Simulator
Diffstat (limited to 'hscript/meta.cc')
-rw-r--r--hscript/meta.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc
index dc29b0c..4fef42a 100644
--- a/hscript/meta.cc
+++ b/hscript/meta.cc
@@ -89,6 +89,7 @@ bool Hostname::execute(ScriptOptions opts) const {
if(opts.test(Simulate)) {
output_info("installfile:" + std::to_string(this->lineno()),
"hostname: set hostname to '" + actual + "'");
+ std::cout << "hostname " << actual << std::endl;
} else {
if(sethostname(actual.c_str(), actual.size()) == -1) {
output_error("installfile:" + std::to_string(this->lineno()),
@@ -102,6 +103,8 @@ bool Hostname::execute(ScriptOptions opts) const {
if(opts.test(Simulate)) {
output_info("installfile:" + std::to_string(this->lineno()),
"hostname: write '" + actual + "' to /etc/hostname");
+ std::cout << "printf '%s' " << actual << " > /target/etc/hostname"
+ << std::endl;
} else {
std::ofstream hostname_f("/target/etc/hostname");
if(!hostname_f) {
@@ -165,6 +168,8 @@ bool Repository::execute(ScriptOptions opts) const {
output_info("installfile:" + std::to_string(this->lineno()),
"repository: write '" + this->value() +
"' to /etc/apk/repositories");
+ std::cout << "echo '" << this->value() <<
+ "' >> /target/etc/apk/repositories" << std::endl;
} else {
std::ofstream repo_f("/target/etc/apk/repositories",
std::ios_base::ate);