summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm25
-rw-r--r--usr.sbin/pkg_add/pkg_create20
2 files changed, 15 insertions, 30 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 2592731fa09..ea14dd9d647 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.27 2004/10/11 14:11:42 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.28 2004/10/11 14:25:28 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -28,7 +28,8 @@ sub new
bless {state =>
{default_owner=>'root',
default_group=>'bin',
- default_mode=> 0444} }, $class;
+ default_mode=> 0444,
+ cwd=>'.'} }, $class;
}
sub read
@@ -126,24 +127,8 @@ sub write
{
my ($self, $fh) = @_;
- if (defined $self->{cvstags}) {
- for my $item (@{$self->{cvstags}}) {
- $item->write($fh);
- }
- }
- for my $unique_item (qw(name no-default-conflict manual-installation extrainfo arch)) {
- $self->{$unique_item}->write($fh) if defined $self->{$unique_item};
- }
- for my $listname (qw(modules pkgcfl conflict pkgdep newdepend libdepend groups users items)) {
- if (defined $self->{$listname}) {
- for my $item (@{$self->{$listname}}) {
- $item->write($fh);
- }
- }
- }
- for my $special (OpenBSD::PackageInfo::info_names()) {
- $self->{$special}->write($fh) if defined $self->{$special};
- }
+ $self->visit('write', $fh);
+
}
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create
index a31369c573c..06920785eb1 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.21 2004/10/11 10:30:33 espie Exp $
+# $OpenBSD: pkg_create,v 1.22 2004/10/11 14:25:28 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -285,6 +285,15 @@ if (defined $opt_d) {
print "Creating package $ARGV[0]\n" if $opt_v;
my $plist = new OpenBSD::PackingList;
+my @extra_files = ();
+for my $special (info_names()) {
+ next unless -f $dir.$special;
+ push(@extra_files, $special);
+ my $f = OpenBSD::PackingElement::File->add($plist, $special);
+ $f->{ignore} = 1;
+ $f->{md5} = OpenBSD::md5::fromfile($dir.$special);
+}
+
if (defined $opt_p) {
OpenBSD::PackingElement::Cwd->add($plist, $opt_p);
} else {
@@ -392,15 +401,6 @@ if (defined $opt_U) {
copy_subst($opt_U, $dir.UNDISPLAY);
}
-my @extra_files = ();
-OpenBSD::PackingElement::Cwd->add($plist, '.');
-for my $special (info_names()) {
- next unless -f $dir.$special;
- push(@extra_files, $special);
- my $f = OpenBSD::PackingElement::File->add($plist, $special);
- $f->{ignore} = 1;
- $f->{md5} = OpenBSD::md5::fromfile($dir.$special);
-}
if (!defined $plist->{name}) {
print STDERR "Can't write unnamed packing list\n";