[MacPorts] #58610: CPAN.pm/cpan2port needs gzip?

MacPorts noreply at macports.org
Wed Jun 19 05:27:10 UTC 2019


#58610: CPAN.pm/cpan2port needs gzip?
------------------------------+----------------------
  Reporter:  chrstphrchvz     |      Owner:  mojca
      Type:  defect           |     Status:  assigned
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.5.4
Resolution:                   |   Keywords:
      Port:  perl5 cpan2port  |
------------------------------+----------------------

Comment (by mojca):

 One question: where does the path to `gzip` come from when running `cpan`?

 By quickly inspecting the CPAN code (I did not try to execute it yet) it
 seems to me as if cpan creates a config file and writes location to the
 required executables the first time when you run it. This is problematic
 in case that you have `gzip` from MacPorts installed when you run `cpan`
 for the first time, but then uninstall `gzip` later.

 > Another question: are ports are allowed to use `/usr/bin/gzip`, i.e.
 does the usual policy of using software outside MacPorts not apply to
 `/usr/bin/gzip`?

 Yes, I would say that ports should be allowed to use `/usr/bin/gzip`
 (unless maybe on older systems some functionality is missing or so). The
 problem comes from libraries like `libpng` where we try to avoid linking
 against ancient libraries and then debug forever why something doesn't
 work as expected. Or when the executable is so old that it's not usable.
 But occasionally running some minor executable from `/usr` is fine and
 reduces the number of dependencies (which isn't a bad thing). Note that
 `gzip` in particular is very important, as it would be a chicken-and-egg
 problem if we were not allowed to use it. (How would we upgrade / extract
 `gzip` port itself?)

 We need to figure out how `cpan` decides which executable to use. If we
 can convince it to always consistently use `/usr/bin/gzip`, that would be
 somewhat preferable to declaring a dependency on the `gzip` port. Any help
 greatly appreciated.

 This piece of code for searching for executables like `gzip` is also nice
 (I'm not exactly sure what it does, but ...):
 {{{
 #!perl
         for $progname (@external_progs) {
             next if $matcher && $progname !~ /$matcher/;
             if ($^O eq 'MacOS') {
                 $CPAN::Config->{$progname} = 'not_here';
                 next;
             }
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/58610#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list