From 48ed179795846b794c2a786b42bc2f7b6f3cecdd Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 13 Oct 2019 04:02:41 -0500 Subject: hscript: Implement Mount::execute simulation --- hscript/disk.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/hscript/disk.cc b/hscript/disk.cc index d30778d..665e209 100644 --- a/hscript/disk.cc +++ b/hscript/disk.cc @@ -75,6 +75,21 @@ bool Mount::validate(ScriptOptions options) const { return(access(this->device().c_str(), F_OK)); } -bool Mount::execute(ScriptOptions) const { - return false; +bool Mount::execute(ScriptOptions options) const { + const std::string actual_mount = "/target" + this->mountpoint(); + + if(options.test(Simulate)) { + output_info("installfile:" + std::to_string(this->lineno()), + "mount: mounting " + this->device() + " on " + + this->mountpoint()); + std::cout << "mount "; + if(!this->options().empty()) { + std::cout << "-o " << this->options() << " "; + } + std::cout << this->device() << " " << actual_mount << std::endl; + return true; + } + + /* mount */ + return true; } -- cgit v1.2.3-60-g2f50