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. .\" 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 .TH Pkgfile 5
.SH NAME .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 the directory created by unpacking a tarball will have the same name, regardless
of how the tarball itself is saved on disk). of how the tarball itself is saved on disk).
.PP .PP
Starting with CRUX 3.7 you can use the \fIrenames\fP array to prevent automatic CRUX 3.7 introduced the possibility of using the \fIrenames\fP array to
unpacking of archives whose original filenames would have matched the pattern prevent automatic unpacking of archives whose original filenames would have
*.(tar|tar.gz|tar.bz2|tar.xz|zip|rpm|7z); in previous CRUX versions the clunky matched the pattern *.(tar|tar.gz|tar.bz2|tar.xz|zip|rpm|7z); in previous
workaround was to redefine the \fBpkgmk(8)\fP function \fIunpack_source()\fP and CRUX versions the clunky workaround was to redefine the \fBpkgmk(8)\fP
delay that pattern match until specially-designated source files are given function \fIunpack_source()\fP and delay that pattern match until
special treatment. Keeping in mind that earlier versions of CRUX will not respect the specially-designated source files are given special treatment.
renaming feature (and will gladly proceed to unpack the tarball that you wanted Because this use of \fIrenames\fP is not a very intuitive solution to the
left intact), during the transition period to CRUX 3.7 it is safer to stick with problem of coping tarballs intact, another mechanism was proposed. Starting
the method of redefining \fIunpack_source()\fP to shield specific archives from in CRUX 3.7.1 you can define a \fInounpack\fP array in your Pkgfile,
being extracted. (This advice only applies to user-published port collections; containing the on-disk filenames of tarballs that you want copied as-is into
the CRUX development team will push their ports to the 3.7 branch and not have the work directory. Filenames that do not match the pattern
to worry about inadvertent attempts to compile them on earlier branches.) *.(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 .SS Directories
In general packages should install files in these directories. Exceptions In general packages should install files in these directories. Exceptions