From 094059e2383b8369f3f8dc48a4d120e1fab388bd Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Tue, 5 Jan 2010 19:38:22 +0000 Subject: refuse invalid version specs. fix other error messages (missing \n) --- usr.sbin/pkg_add/pkg_create | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index cd75700938d..fffbfd259fc 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.129 2010/01/01 16:12:21 espie Exp $ +# $OpenBSD: pkg_create,v 1.130 2010/01/05 19:38:21 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -299,6 +299,17 @@ sub makesum_plist } } +package OpenBSD::PackingElement::Dependency; +sub avert_duplicates_and_other_checks +{ + my ($self, $allfiles) = @_; + if (!$self->spec->is_valid) { + print STDERR "Error in packing-list: invalid dependency: $self->{pattern}\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 @@ -448,7 +459,7 @@ sub add_description } if (defined $comment) { if ($subst->empty('MAINTAINER')) { - Warn "no MAINTAINER"; + Warn "no MAINTAINER\n"; } else { print $fh "\n", $subst->do('Maintainer: ${MAINTAINER}'), "\n"; } @@ -625,7 +636,7 @@ if ($regen_package) { OpenBSD::PackingElement::ExtraInfo->add($plist, $fullpkgpath, $cdrom, $ftp); } else { - Warn "Package without FULLPKGPATH"; + Warn "Package without FULLPKGPATH\n"; } for my $contentsfile (@contents) { read_fragments($plist, $contentsfile) or -- cgit v1.2.3