summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-05-15 08:15:46 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-05-15 08:15:46 +0000
commit906973cb29a4a8086c5424254493e9a7343c43b0 (patch)
tree43f1d3312943b54df5b178fe45d39f24d23c2234 /usr.sbin/pkg_add/OpenBSD
parente41cef7768685b4965c1c720f0bcb4a6f29767d3 (diff)
less hackish test for LIB*VERSION: after building the element,
redo a check based on the non-subst version, so we can: - actually parse the library name - check we depend upon the right variable
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCreate.pm24
1 files changed, 19 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
index 0086a4f876b..ba6bc8d199b 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.64 2012/05/07 15:56:18 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.65 2012/05/15 08:15:45 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -291,6 +291,10 @@ sub discover_directories
{
}
+sub check_version
+{
+}
+
package OpenBSD::PackingElement::RcScript;
sub archive
{
@@ -575,6 +579,19 @@ sub avert_duplicates_and_other_checks
}
+package OpenBSD::PackingElement::Library;
+sub check_version
+{
+ my ($self, $state, $unsubst) = @_;
+ if (my @l = $self->parse($self->name)) {
+ if (!$unsubst =~ m/\$\{LIB$l[0]_VERSION\}/) {
+ $state->error("Incorrectly versioned shared library: #1", $unsubst);
+ }
+ } else {
+ $state->error("Invalid shared library #1", $unsubst);
+ }
+}
+
# put together file and filename, in order to handle fragments simply
package MyFile;
sub new
@@ -885,10 +902,6 @@ sub read_fragments
if (m/^(\@comment\s+\$(?:Open)BSD\$)$/o) {
$_ = '@comment $'.'OpenBSD: '.basename($file->name).',v$';
}
- if (m/^\@lib\s+(.*)$/o &&
- OpenBSD::PackingElement::Lib->parse($1)) {
- $state->error("shared library without SHARED_LIBS: #1", $_);
- }
if (m/^(\!)?\%\%(.*)\%\%$/) {
if (my $f2 = $self->handle_fragment($state, $file, $1, $2, $_, $cont)) {
push(@$stack, $file);
@@ -903,6 +916,7 @@ sub read_fragments
# XXX some things, like @comment no checksum, don't produce an object
my $o = &$cont($s);
if (defined $o) {
+ $o->check_version($state, $s);
$self->annotate($o, $_, $file);
}
}