oops, $pkg can be more than a pkgname. We have the right information
authorespie <espie@openbsd.org>
Tue, 28 Jun 2016 17:35:34 +0000 (17:35 +0000)
committerespie <espie@openbsd.org>
Tue, 28 Jun 2016 17:35:34 +0000 (17:35 +0000)
in the plist, so use it instead.

usr.sbin/pkg_add/OpenBSD/PkgInfo.pm

index f36ec2e..3d4a9bc 100644 (file)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl
 # ex:ts=8 sw=4:
-# $OpenBSD: PkgInfo.pm,v 1.39 2016/06/28 15:38:36 espie Exp $
+# $OpenBSD: PkgInfo.pm,v 1.40 2016/06/28 17:35:34 espie Exp $
 #
 # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
 #
@@ -417,7 +417,7 @@ sub print_info
        my $plist;
        if ($state->opt('z')) {
                $plist = $handle->plist(\&OpenBSD::PackingList::ExtraInfoOnly);
-               my $name = OpenBSD::PackageName->new_from_string($pkg);
+               my $name = OpenBSD::PackageName->new_from_string($plist->pkgname);
                my $stem = $name->{stem};
                my $compose = $stem."--".join('-', sort keys %{$name->{flavors}});
                if ($plist->has('is-branch')) {