diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-04-02 21:38:46 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-04-02 21:38:46 -0500 |
commit | 1e869fafaef57bba1bb10c283968492c04452ff8 (patch) | |
tree | acdf22ae9bf167542a207af104a8a35488a7e880 /hscript | |
parent | 988817625a3acca49205c6f15fff743e2789c8ca (diff) | |
download | horizon-1e869fafaef57bba1bb10c283968492c04452ff8.tar.gz horizon-1e869fafaef57bba1bb10c283968492c04452ff8.tar.bz2 horizon-1e869fafaef57bba1bb10c283968492c04452ff8.tar.xz horizon-1e869fafaef57bba1bb10c283968492c04452ff8.zip |
hscript: Handle existing /etc/localtime in target
This can occur if you re-use an intermediate directory for images.
Diffstat (limited to 'hscript')
-rw-r--r-- | hscript/meta.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc index e419cde..9b0eb83 100644 --- a/hscript/meta.cc +++ b/hscript/meta.cc @@ -519,6 +519,8 @@ bool Timezone::execute() const { std::string target_lt = script->targetDirectory() + "/etc/localtime"; error_code ec; if(fs::exists(target_zi, ec)) { + if(fs::exists(target_lt, ec)) fs::remove(target_lt, ec); + fs::create_symlink(zi_path, target_lt, ec); if(ec) { output_error("installfile:" + std::to_string(this->lineno()), |