summaryrefslogtreecommitdiff
path: root/hscript
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 21:21:01 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 21:21:01 -0500
commit1591ee360fec1863ddf7ed536689e043bb03710e (patch)
treeb3ad9b34be1f074ddc4a498721acf92ce9ec5d3b /hscript
parent7c1efb0e68e7decd2d5276e7ff02f65bde9bbf9a (diff)
downloadhorizon-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.cc2
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 */