[MacPorts] #55455: github portgroup: ability to download files from more than one github project

MacPorts noreply at macports.org
Thu Dec 7 06:42:21 UTC 2017


#55455: github portgroup: ability to download files from more than one github
project
--------------------------+-----------------
  Reporter:  ryandesign   |      Owner:
      Type:  enhancement  |     Status:  new
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:
Resolution:               |   Keywords:
      Port:               |
--------------------------+-----------------

Comment (by ryandesign):

 I'm trying to decide what interface should be exposed to ports for this
 functionality. One option is to simply have a proc that takes all the
 parameters needed to specify a GitHub distfile, and then it adds the
 needed `master_sites` and `distfiles` and `post-extract` blocks to handle
 it. For example, for the libpsl port:

 {{{
 # hypothetical code
 github.add_distfile publicsuffix list
 85fa8fbdf73a0f2fcf5f4790c204394557dfbaf3 {} archive
 }}}

 But this becomes increasingly messy as more parameters are needed. It can
 be hard to remember which parameter is which, and skipping parameters
 requires entering empty strings. Would it make more sense to try to use
 named parameters? The `checksums` line comes to mind as an example of an
 existing option that uses key-value pairs. So it could instead be:

 {{{
 # hypothetical code
 github.add_distfile author  publicsuffix \
                     project list \
                     tag     85fa8fbdf73a0f2fcf5f4790c204394557dfbaf3 \
                     type    archive
 }}}

 It's clear what each parameter is for and it's easy to omit unneeded
 parameters. But it's different from how `github.setup` is invoked.

 This could be an opportunity to have a whole new github-2.0 portgroup with
 a different `github.setup` signature. Or, since we don't really like
 `.setup` procs and have tried to get away from them in other portgroup,
 maybe we can find an interface that doesn't require one here either. For
 example, instead of having `github.setup` set `name` and `version`, have
 the portfile author set `name` and `version` and let the portgroup take
 its defaults from that. Only `github.author` need be specified separately.
 But then we have the tag prefix which often needs to be specified too.

 A single proc to add a distfile might not be sufficient. What if we want
 to add a distfile, but not extract it? We don't have its filename easily
 available.

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


More information about the macports-tickets mailing list