[MacPorts] #64960: use_7z, use_bzip2, use_lzip, use_lzma, use_tar, use_xz, use_zip cannot be undone

MacPorts noreply at macports.org
Thu Apr 7 22:19:51 UTC 2022


#64960: use_7z, use_bzip2, use_lzip, use_lzma, use_tar, use_xz, use_zip cannot be
undone
------------------------+--------------------
 Reporter:  ryandesign  |      Owner:  (none)
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  base        |    Version:  2.7.2
 Keywords:              |       Port:
------------------------+--------------------
 MacPorts defaults to using .tar.gz distfiles. This can be changed by
 setting `use_7z`, `use_bzip2`, `use_lzip`, `use_lzma`, `use_tar`,
 `use_xz`, or `use_zip` to `yes` (which change both `extract.suffix` and
 the extraction commands and arguments) but once that's done, there's no
 way to undo it. Presumably when these were designed it was assumed that
 there would be no reason for a Portfile to set one of these and then set
 another of these; the Portfile should just set the single option that it
 needs.

 However, a portgroup may wish to use one of these as a default, as indeed
 the gitlab-1.0 portgroup currently does by setting `use_bzip2 yes` the
 moment that `gitlab.setup` is called. This is terrible because it means
 that once I run `gitlab.setup` I'm required to download a bzip2 file, even
 if I actually want to download a different kind of file from a different
 download location. Neither setting e.g. `use_xz yes` before calling
 `gitlab.setup` nor setting it afterward nor setting it in both places
 works. It effectively means that if I want to download a non-bzip2 file I
 have to forgo the benefits of using the gitlab portgroup entirely or
 manually fix up the extraction commands and arguments.

 Ultimately (#50969) I would like for these `use_` options to become
 wrappers that do nothing more than set `extract.suffix`, and eventually be
 retired entirely, and have MacPorts base be able to extract any distfile
 by inferring the commands to use based on what type of file it is. But
 until then, maybe there is a way to improve the `use_` options so that
 they can be fully undone if needed.

-- 
Ticket URL: <https://trac.macports.org/ticket/64960>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list