-v being a bit too chatty

Rainer Müller raimue at macports.org
Sun Jan 31 06:02:24 PST 2016


On 2016-01-30 13:18, Joshua Root wrote:
> On 2016-1-30 21:16 , René J.V. Bertin wrote:
>> My qt5-kde port has the following bit of code that adds the appropriate -sdk option to configure.args:
>>
>> {{{
>>             # default: build for the current OS version, requesting the corresponding SDK explicitly
>>             if {[catch {system "xcrun --show-sdk-path -sdk macosx10.${OSX_MINOR}"} result]} {
>>                 ui_debug "Couldn't find preferred SDK macosx10.${OSX_MINOR}: ${result}"
>>                 # the preferred matching SDK isn't available; check if the default SDK is
>>   SNIP
>>             } else {
>>                 ui_debug "Using SDK macosx10.${OSX_MINOR} : ${result}"
>>                 configure.args-append \
>>                         -sdk [string tolower "macosx10.${OSX_MINOR}"]
>>             }
>> }}}
>>
>> I had been noticing that `port {-vy install|-v info} somePortDependingOnQT5` printed the full path to the preferred SDK, and finally traced that back to the `catch {system "xcrun ..."}]` statement above.

Is this with trunk? I made changes since the last release to the way the
command logs its output, so it might differ from base 2.3.4.

>> 2 questions:
>> - why is the Qt5-kde Portfile parsed when port:qt5-kde is uptodate?

All dependencies are parsed. To get the recursive list of dependencies,
we need to evaluate the Portfile since variants might add additional
dependencies that are not stored in the PortIndex.

Even if qt5-kde is the current version, one of its dependencies might
have a pending update and we would want to update them first.

>> - is there a way to silence output from `catch {system ...` even with the -v option? I thought the role of the catch function was also to ... catch the called function's output?
> 
> If you don't want the output printed and logged, don't use 'system',
> that's what it's for.

Most other port groups seem to use [exec ...] for this purpose. However,
I just noticed that this means the command runs without the sandbox
being applied.

Shouldn't we also have a wrapper for exec and insert the correct
sandbox-exec? Or we could add something like 'system -q' without
printing output and remove exec from the exported procs (or make it an
alias)?

Rainer


More information about the macports-dev mailing list