diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-07-05 09:27:06 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-07-05 09:27:06 +0000 |
commit | ea813441e6def33d7556e3ea99bdb3d93743ea2a (patch) | |
tree | 8fc4df18ae14185922e61043e90fee19736808f6 | |
parent | d04e4cd61a32488b4789ef9cf55ffdc5c29852fd (diff) |
Still deduce a pkg-name even if there is no .tgz in the pkg-name specified
on the command-line. Problem noticed by Brad Webb.
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index d5b60a391fa..c46e4f800e0 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.8 2004/01/31 17:56:13 espie Exp $ +# $OpenBSD: pkg_create,v 1.9 2004/07/05 09:27:05 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -190,9 +190,9 @@ if (defined $opt_p) { die "Prefix required"; } -if ($ARGV[0] =~ m|([^/]+)\.tgz$|) { +if ($ARGV[0] =~ m|([^/]+)(?:\.tgz)?$|) { OpenBSD::PackingElement::Name->add($plist, $1); -} +} if (defined $opt_P) { for my $e (split(/\s+/, $opt_P)) { @@ -204,6 +204,7 @@ if (defined $opt_C) { for my $e (split(/\s+/, $opt_C)) { OpenBSD::PackingElement::PkgConflict->add($plist, $e); } + } if (defined $opt_A) { |