NAME
Skilletor::Tar - The reference's minimal tar reader: safe file and dir entries only
VERSION
version 0.001
SYNOPSIS
use Skilletor::Tar qw( parse_tar strip_top_level is_reserved );
my $entries = strip_top_level( parse_tar($tar_bytes) );
my @kept = grep { !is_reserved( $_->{name} ) } @$entries;
DESCRIPTION
The reference unpacks a url source with its own dependency-free tar reader, not with tar; reading archives the same way is what makes both implementations' cache trees the same. Plain files and directories are kept; GNU long names and pax path records are honoured; devices and other types are skipped; symlinks, hardlinks, absolute paths and .. are refused with a Skilletor::Error::Tar. A header whose size field is no non-negative octal number is a corrupt archive – a plain Skilletor::Error corrupt tar entry (size): <name>, so a url source falls back to its cache as for a failed download; so is an archive cut short (corrupt tar (truncated): ..., or no end-of-archive block). Of an entry's mode only the owner's executable bit is kept. Names are decoded as UTF-8 the way Node decodes them.
parse_tar
my $entries = parse_tar($bytes);
[ { name, type => 'file' | 'dir', data, executable } ].
strip_top_level
A single top-level directory (as GitHub's archives have) is stripped.
is_reserved
True for the version file's name at the tree root.
VERSION_FILE
.skilletor-version.
SUPPORT
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.