diff options
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index 9f22bf60364..eaf9a86511b 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.10 2004/07/05 19:43:05 espie Exp $ +# $OpenBSD: pkg_create,v 1.11 2004/07/06 17:35:08 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -82,35 +82,27 @@ sub archive_cmd sub compute_checksum { - my ($self, $base, $stash) = @_; + my ($self, $base) = @_; my $fname = $self->fullname(); if (-l "$base/$fname") { - my $value = readlink "$base/$fname"; - $self->make_symlink($value); return if $base eq '/' or $base eq ''; + my $value = readlink "$base/$fname"; if ($value =~ m/^\Q$base/) { print STDERR "Error in package: symlink $base/$fname refers to $value\n"; $main::errors++; } } else { - my ($dev, $ino, $size) = (stat "$base/$fname")[0,1,7]; - if (defined $stash->{"$dev/$ino"}) { - $self->make_hardlink($stash->{"$dev/$ino"}); - } else { - $stash->{"$dev/$ino"} = $fname; - $self->{md5} = OpenBSD::md5::fromfile("$base/$fname"); - $self->{size} = $size; - } + $self->{md5} = OpenBSD::md5::fromfile("$base/$fname"); + $self->{size} = (stat "$base/$fname")[7]; } } sub makesum { my ($self, $base) = @_; - my $stash = {}; for my $item (@{$self->{items}}) { if ($item->IsFile()) { - compute_checksum($item, $base, $stash); + compute_checksum($item, $base); } } } |