summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-01-10 11:47:49 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-01-10 11:47:49 +0000
commitd5a816d14f95c2f81cd34915066af4443a28acc1 (patch)
tree329a9be6f4f232afe829ed46faceb95c37039b49 /usr.sbin/pkg_add
parent78291f1048230dcfa48703a2516ce19ac6443f34 (diff)
if we make pkg_create more stringent, then we cannot create bogus
packing-lists. Add check for libspec, and REGRESSION_TESTING
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/pkg_create19
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create
index fffbfd259fc..d398c15623d 100644
--- a/usr.sbin/pkg_add/pkg_create
+++ b/usr.sbin/pkg_add/pkg_create
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_create,v 1.130 2010/01/05 19:38:21 espie Exp $
+# $OpenBSD: pkg_create,v 1.131 2010/01/10 11:47:48 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -310,6 +310,20 @@ sub avert_duplicates_and_other_checks
$self->SUPER::avert_duplicates_and_other_checks($allfiles);
}
+package OpenBSD::PackingElement::Wantlib;
+sub avert_duplicates_and_other_checks
+{
+ my ($self, $allfiles) = @_;
+ require OpenBSD::SharedLibs;
+
+ if (!defined OpenBSD::SharedLibs::parse_spec($self->name)) {
+ print STDERR "Error in packing-list: invalid wantlib: ",
+ $self->name, "\n";
+ $main::errors++;
+ }
+ $self->SUPER::avert_duplicates_and_other_checks($allfiles);
+}
+
# put together file and filename, in order to handle fragments simply
package MyFile;
sub new
@@ -685,9 +699,10 @@ if ($plist->{deprecated}) {
$plist->avert_duplicates_and_other_checks({});
-if ($errors) {
+if ($errors && $subst->empty('REGRESSION_TESTING')) {
exit 1;
}
+$errors = 0;
if (defined $cert) {
my $sig = OpenBSD::PackingElement::DigitalSignature->new_x509;