summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 21:44:00 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 21:44:00 -0500
commitecc61543b5212526338c4c5bc362936add3e34f3 (patch)
tree30210a527d85ce00c1e8f9dfab6ab713cf1a5fc6
parentdecc6e87d9ab84aac5a000937d7e19f2fcefd911 (diff)
downloadhorizon-ecc61543b5212526338c4c5bc362936add3e34f3.tar.gz
horizon-ecc61543b5212526338c4c5bc362936add3e34f3.tar.bz2
horizon-ecc61543b5212526338c4c5bc362936add3e34f3.tar.xz
horizon-ecc61543b5212526338c4c5bc362936add3e34f3.zip
hscript: Handle pkgs with + char and add test (thanks @sroracle)
-rw-r--r--hscript/meta.cc2
-rw-r--r--hscript/script.cc1
-rw-r--r--tests/fixtures/0022-all-kinds-of-atoms.installfile2
3 files changed, 3 insertions, 2 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc
index 48125dc..1087ac5 100644
--- a/hscript/meta.cc
+++ b/hscript/meta.cc
@@ -42,7 +42,7 @@ bool Hostname::execute() const {
Key *PkgInstall::parseFromData(const std::string data, int lineno, int *errors,
int *warnings) {
- std::regex valid_pkg("[0-9A-Za-z_.-]*((>?<|[<>]?=|[~>])[0-9A-Za-z-_.]+)?");
+ std::regex valid_pkg("[0-9A-Za-z+_.-]*((>?<|[<>]?=|[~>])[0-9A-Za-z-_.]+)?");
std::string next_pkg;
std::istringstream stream(data);
std::set<std::string> all_pkgs;
diff --git a/hscript/script.cc b/hscript/script.cc
index 2d93a51..69afb30 100644
--- a/hscript/script.cc
+++ b/hscript/script.cc
@@ -126,6 +126,7 @@ struct Script::ScriptPrivate {
output_warning("installfile:" + std::to_string(lineno),
"package '" + pkg + "' has already been specified",
"", opts.test(Pretty));
+ continue;
}
packages.insert(pkg);
}
diff --git a/tests/fixtures/0022-all-kinds-of-atoms.installfile b/tests/fixtures/0022-all-kinds-of-atoms.installfile
index 65e53b7..0588a0e 100644
--- a/tests/fixtures/0022-all-kinds-of-atoms.installfile
+++ b/tests/fixtures/0022-all-kinds-of-atoms.installfile
@@ -1,5 +1,5 @@
network true
hostname test.machine
-pkginstall adelie-base musl>1.1.23-r5 konsole=19.12.0-r0 libxxf86vm>=1.1.4-r2 openssh-server<7.9_p1-r4 help2man-doc=1.47.10-r0 perl-encode-jisx0213>0.04-r0 font-adobe-100dpi polkit-qt-1=0.113.0-r0 libssl1.0=1.0.2t-r0
+pkginstall adelie-base musl>1.1.23-r5 konsole=19.12.0-r0 libxxf86vm>=1.1.4-r2 openssh-server<7.9_p1-r4 help2man-doc=1.47.10-r0 perl-encode-jisx0213>0.04-r0 font-adobe-100dpi polkit-qt-1=0.113.0-r0 libssl1.0=1.0.2t-r0 gtk+2.0
rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
mount /dev/sda1 /