From a1e0fe6665fbc0d50827b414bc5ba804cf66525e Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 17 Nov 2021 10:59:13 +0000 Subject: [PATCH] forbid non-sensical empty parts explicitly forbid % to be in packages-specs, so that people don't get confused about it. --- usr.sbin/pkg_add/OpenBSD/PkgSpec.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm index 6d25b611778..42a17cadc4a 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PkgSpec.pm,v 1.48 2021/11/16 15:56:44 espie Exp $ +# $OpenBSD: PkgSpec.pm,v 1.49 2021/11/17 10:59:13 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -197,13 +197,13 @@ sub parse # let's try really hard to find the stem and the flavors unless ($p =~ m/^ - (.*?) # stem part + ([^%]+?) # stem part \- ( - (?:\>|\>\=|\<\=|\<|\=)?\d[^-]* # optional op + version + (?:\>|\>\=|\<\=|\<|\=)?\d[^-%]* # optional op + version |\* # or any version ) - (?:\-(.*))? # optional flavor part + (?:\-([^%]+))? # optional flavor part $/x) { return undef; } -- 2.20.1