From 2d5e0185dcaabbbf454e743b152cd5700394da1e Mon Sep 17 00:00:00 2001 From: espie Date: Fri, 17 Jan 2014 15:39:53 +0000 Subject: [PATCH] "recognize" extended header thingies (we don't handle them, we just spew more useful error messages) --- usr.sbin/pkg_add/OpenBSD/Ustar.pm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm index f95ce49dde6..2877cd20da4 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.76 2014/01/13 18:42:34 espie Exp $ +# $OpenBSD: Ustar.pm,v 1.77 2014/01/17 15:39:53 espie Exp $ # # Copyright (c) 2002-2014 Marc Espie # @@ -37,7 +37,12 @@ use constant { MAXLINKNAME => 100, MAXPREFIX => 155, MAXUSERNAME => 32, - MAXGROUPNAME => 32 + MAXGROUPNAME => 32, + # XXX those are NOT supported, just recognized + XHDR => 'x', + GHDR => 'g', + LONGLINK => 'K', + LONGNAME => 'L', }; use File::Basename (); @@ -121,6 +126,13 @@ my $types = { BLOCKDEVICE , 'OpenBSD::Ustar::BlockDevice', }; +my $unsupported = { + XHDR => 'Extended header', + GHDR => 'GNU header', + LONGLINK => 'Long symlink', + LONGNAME => 'Long file', +}; + sub next { my $self = shift; @@ -187,7 +199,8 @@ sub next if (defined $types->{$type}) { $self->new_object($result, $types->{$type}); } else { - $self->fatal("Unsupported type #1", $type); + $self->fatal("Unsupported type #1 (#2)", $type, + $unsupported->{$type} // "unknown"); } if (!$result->isFile && $result->{size} != 0) { $self->fatal("Bad archive: non null size for #1 (#2)", -- 2.20.1