From 7a09ff3f1d271258f81d9d1f6505c22daa605eed Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 13 Oct 2019 04:02:18 -0500 Subject: hscript, tools: Support shell writing in Simulator --- hscript/meta.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hscript') 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); -- cgit v1.2.3-70-g09d2