diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-07-06 17:35:09 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-07-06 17:35:09 +0000 |
commit | 22dc050ceed327e027e1b62feeb831d97b54a26f (patch) | |
tree | f91d4a569b71f076e8ecf42cd9485f177ef2dc0b | |
parent | 58b8204bfe8fdb06318d99c826263401f4f75fb8 (diff) |
commit from the wrong tree. noticed by krw@
-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); } } } |