diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-05-29 09:53:58 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-05-29 09:53:58 -0500 |
commit | 38a34471c532a3034bac52692eb2261c05e3d730 (patch) | |
tree | be71bfbcfc25bd7080a5ce700173ec92d3261786 /hscript/meta.cc | |
parent | 073961cfff9e249d92c240eabcf5d24a7b4a7bab (diff) | |
download | horizon-38a34471c532a3034bac52692eb2261c05e3d730.tar.gz horizon-38a34471c532a3034bac52692eb2261c05e3d730.tar.bz2 horizon-38a34471c532a3034bac52692eb2261c05e3d730.tar.xz horizon-38a34471c532a3034bac52692eb2261c05e3d730.zip |
hscript: Timezone: Always remove existing localtime
Otherwise, if the target doesn't have tzdata installed, an existing
/etc/localtime file won't be removed and we can hit an error.
Diffstat (limited to 'hscript/meta.cc')
-rw-r--r-- | hscript/meta.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc index dc17290..ff39d4a 100644 --- a/hscript/meta.cc +++ b/hscript/meta.cc @@ -491,9 +491,9 @@ bool Timezone::execute() const { std::string target_zi = script->targetDirectory() + zi_path; 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); + if(fs::exists(target_lt, ec)) fs::remove(target_lt, ec); + if(fs::exists(target_zi, ec)) { fs::create_symlink(zi_path, target_lt, ec); if(ec) { output_error(pos, "timezone: failed to create symbolic link", |