[MacPorts] #52989: buildbot: allow building 'pseudoports'

MacPorts noreply at macports.org
Thu Dec 1 11:48:56 CET 2016


#52989: buildbot: allow building 'pseudoports'
-----------------------------+----------------------
  Reporter:  mojca           |      Owner:  admin@…
      Type:  enhancement     |     Status:  new
  Priority:  Normal          |  Milestone:
 Component:  server/hosting  |    Version:
Resolution:                  |   Keywords:  buildbot
      Port:                  |
-----------------------------+----------------------
Description changed by mojca:

Old description:

> I would find it useful if we would allow building a subset of ports with
> simple expressions, so that we could rebuild all ports (either in one go
> or incrementally) every now and then.
>
> In particular it would be helpful if we could build `category:shells` or
> `all` or similar things.
>
> We are currently using the following expression to list the subports:
> {{{
> port info --index --line --name wxWidgets-3.0 subportof:wxWidgets-3.0
> }}}
>
> The following works:
> {{{
> port info --index --line --name 'category:shells'
> }}}
> but
> {{{
> port info --index --line --name 'category:shells'
> subportof:'category:shells'
> port info --index --line --name all subportof:all
> }}}
> doesn't.
>
> What would be needed to get this working?
>
> After inspecting the source code I see that a list of ports is generated
> with
> {{{
> #!bash
> for p in "$@"; do
>     print-subports "$p" && success=1
> done
> }}}
> and `print-subports` does
> {{{
> #!bash
> ports=$("${option_prefix}/bin/port" -q info --index --line --name
> "${portname}" "subportof:${portname}" 2>/dev/null) || return
> }}}
> which fails if the argument of `subportof:` is not a proper port name.
> One possible solution would be to run `port info` first, for example
> {{{
> > port info --index --line --name maintainer:mojca and category:math
> aquaterm
> gnuplot
> libcerf
> }}}
> or
> {{{
> > port info --index --line --name wxWidgets-2.8 wxWidgets-3.0
> wxWidgets-2.8
> wxWidgets-3.0
> }}}
> and then iterate over that result rather than on the list of arguments
> (three in the example `maintainer:mojca and category:math`) to print all
> subports.
>
> At the same time we should be a bit careful about code injections to
> prevent logged in users from executing arbitrary shell code on the build
> slaves.
>
> Any thoughts?

New description:

 I would find it useful if we would allow building a subset of ports with
 simple expressions, so that we could rebuild all ports (either in one go
 or incrementally) every now and then.

 In particular it would be helpful if we could build `category:shells` or
 `all` or similar things.

 We are currently using the following expression to list the subports:
 {{{
 port info --index --line --name wxWidgets-3.0 subportof:wxWidgets-3.0
 }}}

 The following works:
 {{{
 port info --index --line --name 'category:shells'
 }}}
 but
 {{{
 port info --index --line --name 'category:shells'
 subportof:'category:shells'
 port info --index --line --name all subportof:all
 }}}
 doesn't.

 What would be needed to get this working?

 After inspecting the source code I see that a list of ports is generated
 with
 {{{
 #!bash
 for p in "$@"; do
     print-subports "$p" && success=1
 done
 }}}
 and `print-subports` does
 {{{
 #!bash
 ports=$("${option_prefix}/bin/port" -q info --index --line --name
 "${portname}" "subportof:${portname}" 2>/dev/null) || return
 }}}
 which fails if the argument of `subportof:` is not a proper port name. One
 possible solution would be to run `port info` first, for example
 {{{
 > port info --index --line --name maintainer:mojca and category:math
 aquaterm
 gnuplot
 libcerf
 }}}
 or
 {{{
 > port info --index --line --name wxWidgets-2.8 wxWidgets-3.0
 wxWidgets-2.8
 wxWidgets-3.0
 }}}
 and then iterate over that result rather than on the list of arguments
 (three in the example `maintainer:mojca and category:math`) to print all
 subports. The only problem is that `category:foo` would already list all
 subports, so additional measures would be needed to make sure that we
 don't end up with duplicates of build jobs.

 At the same time we should be a bit careful about code injections to
 prevent logged in users from executing arbitrary shell code on the build
 slaves.

 Any thoughts?

--

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


More information about the macports-tickets mailing list