From 1a72468ec371be3492e5dc14a7c0fb725c7bb4c8 Mon Sep 17 00:00:00 2001 From: espie Date: Mon, 30 Dec 2013 09:14:49 +0000 Subject: [PATCH] @vendor annotation --- usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 8 +++++++- usr.sbin/pkg_add/OpenBSD/PackingList.pm | 4 ++-- usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 14 +++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index f4e99dc11a0..3258adb7542 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.213 2013/10/15 20:23:51 schwarze Exp $ +# $OpenBSD: PackingElement.pm,v 1.214 2013/12/30 09:14:49 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -1752,6 +1752,12 @@ sub check return; } +package OpenBSD::PackingElement::Vendor; +our @ISA=qw(OpenBSD::PackingElement::Unique); +sub keyword() { 'vendor' } +__PACKAGE__->register_with_factory; +sub category() { "vendor" } + package OpenBSD::PackingElement::DigitalSignature; our @ISA=qw(OpenBSD::PackingElement::Unique); sub keyword() { 'digital-signature' } diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm index 7a09540e4a7..1afa73eb313 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingList.pm,v 1.122 2013/12/25 14:38:15 espie Exp $ +# $OpenBSD: PackingList.pm,v 1.123 2013/12/30 09:14:49 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -438,7 +438,7 @@ sub match_pkgpath } our @unique_categories = - (qw(name url digital-signature no-default-conflict manual-installation always-update explicit-update extrainfo localbase arch)); + (qw(name url vendor digital-signature no-default-conflict manual-installation always-update explicit-update extrainfo localbase arch)); our @list_categories = (qw(conflict pkgpath incompatibility ask-update updateset depend diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index aa977de2bca..9e4443e843a 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.74 2013/12/29 13:40:54 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.75 2013/12/30 09:14:49 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -1082,6 +1082,16 @@ sub create_archive return OpenBSD::Ustar->new($fh, $state, $dir); } +sub setup_vendor +{ + my ($self, $plist, $state) = @_; + my $vendor = $state->{subst}->value('VENDOR'); + if (!defined $vendor) { + return; + } + OpenBSD::PackingElement::Vendor->add($plist, $vendor); +} + sub sign_existing_package { my ($self, $state, $pkg) = @_; @@ -1091,6 +1101,7 @@ sub sign_existing_package my $plist = OpenBSD::PackingList->fromfile($dir.CONTENTS); $plist->set_infodir($dir); $self->add_signature($plist, $state); + $self->setup_vendor($plist, $state); $plist->save; my $tmp = OpenBSD::Temp::permanent_file($output, "pkg"); my $wrarc = $self->create_archive($state, $tmp, "."); @@ -1134,6 +1145,7 @@ sub add_extra_info my ($self, $plist, $state) = @_; my $subst = $state->{subst}; + $self->setup_vendor($plist, $state); my $fullpkgpath = $subst->value('FULLPKGPATH'); my $cdrom = $subst->value('PERMIT_PACKAGE_CDROM') || $subst->value('CDROM');; -- 2.20.1