From 11c8b909d521fdf96aff3b931e828f9a94646216 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sun, 7 Aug 2005 14:18:06 +0000 Subject: wrapper around Ustar that replaces long names/links with LongName#/LongLink#. The archive will unpack correctly with tar, except that those names won't be preserved. The wrapper checks names against the packing-list to restore the correct names on the fly. Put into a separate file, as it is an extension of Ustar proper, and we're going to do more archive checking in the future. Lots of tests by Bernd Ahlers. Comments by Tom Cosgrove. --- usr.sbin/pkg_add/pkg_merge | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.sbin/pkg_add/pkg_merge') diff --git a/usr.sbin/pkg_add/pkg_merge b/usr.sbin/pkg_add/pkg_merge index bd3cab8723b..9b71291b599 100644 --- a/usr.sbin/pkg_add/pkg_merge +++ b/usr.sbin/pkg_add/pkg_merge @@ -20,6 +20,7 @@ use OpenBSD::PackingList; use OpenBSD::Getopt; use OpenBSD::Error; use OpenBSD::Ustar; +use OpenBSD::ArcCheck; use File::Copy; use File::Path; @@ -40,18 +41,18 @@ sub copy_over { my ($self, $wrarc, $prefix, $pkg) = @_; my $e = $pkg->{pkg}->next(); - if ($e->{name} ne $self->{name}) { + if (!$e->check_name($self->{name})) { die "Names don't match: ", $e->{name}, " ", $self->{name}; } $e->{name} = $prefix."/".$e->{name}; - $e->copy($wrarc); + $e->copy_long($wrarc); } sub make_alias { my ($self, $wrarc, $prefix, $pkg, $alias) = @_; my $e = $pkg->{pkg}->next(); - if ($e->{name} ne $self->{name}) { + if (!$e->check_name($self->{name})) { die "Names don't match: ", $e->{name}, " ", $self->{name}; } $e->{name} = $prefix."/".$e->{name}; -- cgit v1.2.3