diff options
author | 2006-12-01 16:17:03 +0000 | |
---|---|---|
committer | 2006-12-01 16:17:03 +0000 | |
commit | 45207f76c83e219835be2d43d893b9775ac77a39 (patch) | |
tree | c55feca618dadb67a4c6ffdcfc7ca07b5da6a5ec | |
parent | rangecheck ttl on IP_TTL, collected dust in my tree (diff) | |
download | wireguard-openbsd-45207f76c83e219835be2d43d893b9775ac77a39.tar.xz wireguard-openbsd-45207f76c83e219835be2d43d893b9775ac77a39.zip |
Fixes parsing of variables/delimiters, so that we classify like pkgconfig.
Augment the Requires parser to deal correctly with comparisons.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgConfig.pm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgConfig.pm b/usr.sbin/pkg_add/OpenBSD/PkgConfig.pm index 8cc5b0d4a98..7bbafd55b66 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgConfig.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgConfig.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PkgConfig.pm,v 1.6 2006/11/30 13:18:22 espie Exp $ +# $OpenBSD: PkgConfig.pm,v 1.7 2006/12/01 16:17:03 espie Exp $ # # Copyright (c) 2006 Marc Espie <espie@openbsd.org> # @@ -23,13 +23,22 @@ package OpenBSD::PkgConfig; # specific properties may have specific needs. my $parse = { - Requires => sub { [split /[,\s]\s*/, shift ] } + Requires => sub { + [split qr{ + (?<![<=>]) # not preceded by <=> + [,\s]+ # delimiter + (?![<=>]) # not followed by <=> + }x, shift ] } }; + my $write = { Libs => sub { " ".__PACKAGE__->compress(shift) } }; +$parse->{'Requires.private'} = $parse->{Requires}; +$write->{'Libs.private'} = $write->{Libs}; + sub new { my $class = shift; @@ -83,11 +92,11 @@ sub read_fh chomp; next if m/^\s*$/; next if m/^\#/; - if (m/^(.*?)\=\s*(.*)$/) { + if (m/^([\w.]*)\=\s*(.*)$/) { $cfg->add_variable($1, $2); - } elsif (m/^(.*?)\:\s+(.*)$/) { + } elsif (m/^([\w.]*)\:\s+(.*)$/) { $cfg->add_property($1, $2); - } elsif (m/^(.*?)\:\s*$/) { + } elsif (m/^([\w.]*)\:\s*$/) { $cfg->add_property($1); } else { die "Incorrect cfg file $name"; |