diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-06-13 18:11:45 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-06-13 18:11:45 +0000 |
commit | b60b7ff20522855b42af46b3d08cddf58ef48edf (patch) | |
tree | 8e509939599cf6f58e5c9fe5eb55e40681e232ba /usr.sbin | |
parent | 44b45358a0c0b2c3d8d77b3d1a34088f834738a4 (diff) |
if this is not a `real' file, override the size entry with a zero.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Ustar.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm index 813b23a2879..426bcb6074e 100644 --- a/usr.sbin/pkg_add/OpenBSD/Ustar.pm +++ b/usr.sbin/pkg_add/OpenBSD/Ustar.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Ustar.pm,v 1.21 2005/06/13 14:24:06 espie Exp $ +# $OpenBSD: Ustar.pm,v 1.22 2005/06/13 18:11:44 espie Exp $ # # Copyright (c) 2002-2004 Marc Espie <espie@openbsd.org> # @@ -161,6 +161,10 @@ sub mkheader die "Can't fit such a name $name\n"; } my $linkname = $entry->{linkname}; + my $size = $entry->{size}; + if (!$entry->isFile()) { + $size = 0; + } if (defined $entry->{cwd}) { my $cwd = $entry->{cwd}; $cwd.='/' unless $cwd =~ m/\/$/; @@ -177,7 +181,7 @@ sub mkheader sprintf("%07o", $entry->{mode}), sprintf("%07o", $entry->{uid}), sprintf("%07o", $entry->{gid}), - sprintf("%011o", $entry->{size}), + sprintf("%011o", $size), sprintf("%011o", $entry->{mtime}), $cksum, $type, |