diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-08 21:21:01 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-08 21:21:01 -0500 |
commit | 1591ee360fec1863ddf7ed536689e043bb03710e (patch) | |
tree | b3ad9b34be1f074ddc4a498721acf92ce9ec5d3b /hscript | |
parent | 7c1efb0e68e7decd2d5276e7ff02f65bde9bbf9a (diff) | |
download | horizon-1591ee360fec1863ddf7ed536689e043bb03710e.tar.gz horizon-1591ee360fec1863ddf7ed536689e043bb03710e.tar.bz2 horizon-1591ee360fec1863ddf7ed536689e043bb03710e.tar.xz horizon-1591ee360fec1863ddf7ed536689e043bb03710e.zip |
hscript: Correctly increment warnings on dup pkg warning
Diffstat (limited to 'hscript')
-rw-r--r-- | hscript/script.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hscript/script.cc b/hscript/script.cc index 709fbaf..2d93a51 100644 --- a/hscript/script.cc +++ b/hscript/script.cc @@ -122,12 +122,14 @@ struct Script::ScriptPrivate { Keys::PkgInstall *install = dynamic_cast<Keys::PkgInstall *>(key_obj); for(auto &pkg : install->packages()) { if(opts.test(StrictMode) && packages.find(pkg) != packages.end()) { + if(warnings) *warnings += 1; output_warning("installfile:" + std::to_string(lineno), "package '" + pkg + "' has already been specified", "", opts.test(Pretty)); } packages.insert(pkg); } + delete install; return true; } else if(key_name == "rootpw") { /*! TODO: implement */ |