pkgfile.5: revise the section on preventing tarball unpacking

This commit is contained in:
John McQuah 2023-01-17 07:57:37 -05:00
parent 773282ba51
commit 4760ed2496
1 changed files with 21 additions and 13 deletions

View File

@ -1,6 +1,6 @@
.\"
.\" Pkgfile manual page.
.\" (C) 2018 by Fun, updated 2021--2022 by John McQuah <jmcquah at disroot dot org>
.\" (C) 2018 by Fun, updated 2021--2023 by John McQuah <jmcquah at disroot dot org>
.\"
.TH Pkgfile 5
.SH NAME
@ -105,18 +105,26 @@ does not rely on the specific names chosen for downloaded sources (it helps that
the directory created by unpacking a tarball will have the same name, regardless
of how the tarball itself is saved on disk).
.PP
Starting with CRUX 3.7 you can use the \fIrenames\fP array to prevent automatic
unpacking of archives whose original filenames would have matched the pattern
*.(tar|tar.gz|tar.bz2|tar.xz|zip|rpm|7z); in previous CRUX versions the clunky
workaround was to redefine the \fBpkgmk(8)\fP function \fIunpack_source()\fP and
delay that pattern match until specially-designated source files are given
special treatment. Keeping in mind that earlier versions of CRUX will not respect the
renaming feature (and will gladly proceed to unpack the tarball that you wanted
left intact), during the transition period to CRUX 3.7 it is safer to stick with
the method of redefining \fIunpack_source()\fP to shield specific archives from
being extracted. (This advice only applies to user-published port collections;
the CRUX development team will push their ports to the 3.7 branch and not have
to worry about inadvertent attempts to compile them on earlier branches.)
CRUX 3.7 introduced the possibility of using the \fIrenames\fP array to
prevent automatic unpacking of archives whose original filenames would have
matched the pattern *.(tar|tar.gz|tar.bz2|tar.xz|zip|rpm|7z); in previous
CRUX versions the clunky workaround was to redefine the \fBpkgmk(8)\fP
function \fIunpack_source()\fP and delay that pattern match until
specially-designated source files are given special treatment.
Because this use of \fIrenames\fP is not a very intuitive solution to the
problem of coping tarballs intact, another mechanism was proposed. Starting
in CRUX 3.7.1 you can define a \fInounpack\fP array in your Pkgfile,
containing the on-disk filenames of tarballs that you want copied as-is into
the work directory. Filenames that do not match the pattern
*.(tar|tar.gz|tar.bz2|tar.xz|zip|rpm|7z) will be treated exactly as before;
you never need to define \fInounpack\fP (or \fIrenames\fP) if the pre-3.7
pkgmk behaviour is what you want. During the gradual rollout of the new
pkgmk feature, it is safer to try finding alternative source files that will
populate the work directory appropriately, regardless of which pkgmk the
user has installed. For example: instead of
.B source=(pkg1.rpm pkg2.rpm pkg3.rpm),
distribute a tarball containing all these rpms, and then define logic in
\fIbuild()\fP that lets bsdtar handle each rpm as needed for your port.
.SS Directories
In general packages should install files in these directories. Exceptions