diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-11-15 16:47:55 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-11-15 16:47:55 +0000 |
commit | 8b1aa38ee7329f568856d82af20236106e78e2b5 (patch) | |
tree | 3f70f2f7c54e6d3cc97c363b8fe552e6a84fddf4 | |
parent | e0a49dd669ad48e6a1798a406c08527a59390fa2 (diff) |
generate ExtraInfo from defines FULLPKGPATH, PERMIT_PACKAGE_CDROM, PERMIT_PACKAGE_FTP if none is available elsewhere.
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index dbf0e7a803c..4e1e2e22bd8 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.23 2004/10/12 09:34:01 espie Exp $ +# $OpenBSD: pkg_create,v 1.24 2004/11/15 16:47:54 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -389,6 +389,19 @@ if (defined $opt_B) { $base = $ENV{'PKG_PREFIX'}; } +my $fullpkgpath = $defines{'FULLPKGPATH'}; +my $cdrom = $defines{'PERMIT_PACKAGE_CDROM'}; +my $ftp = $defines{'PERMIT_PACKAGE_FTP'}; +if (!defined $plist->{extrainfo} && + defined $fullpkgpath && defined $cdrom && defined $ftp) { + $cdrom = 'yes' if $cdrom =~ m/^yes$/i; + $ftp = 'yes' if $ftp =~ m/^yes$/i; + + OpenBSD::PackingElement::ExtraInfo->add($plist, + $fullpkgpath, $cdrom, $ftp); +} + + $plist->makesum($base); $plist->avert_duplicates(); if (defined $plist->{pkgcfl}) { |