control verbose mode in Portfile?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

control verbose mode in Portfile?

René J.V. Bertin
Hi,

Out of curiosity: is it possible to control verbose mode in a Portfile, like with `set +x` / `set -x` in shell scripts?

I'd be interested to use that in the post-activate block of a number of my ports, as an easy way to give a little more feedback to the user.

Thanks,
R.
Reply | Threaded
Open this post in threaded view
|

Re: control verbose mode in Portfile?

Christopher Jones


> On 21 May 2020, at 9:31 am, René J.V. Bertin <[hidden email]> wrote:
>
> Hi,
>
> Out of curiosity: is it possible to control verbose mode in a Portfile, like with `set +x` / `set -x` in shell scripts?
>
> I'd be interested to use that in the post-activate block of a number of my ports, as an easy way to give a little more feedback to the user.

verbose mode printout is only visible if the user activates it, i.e. 'port -v’.

If you want pass a message on to the user, you should not use verbose output to do that. Instead just use a regular ‘ui_msg'

Chris

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: control verbose mode in Portfile?

ryandesign2
Administrator
On May 21, 2020, at 10:05, Christopher Jones wrote:

> If you want pass a message on to the user, you should not use verbose output to do that. Instead just use a regular ‘ui_msg'

But you usually shouldn't use that either; instead, use `notes`.



Reply | Threaded
Open this post in threaded view
|

Re: control verbose mode in Portfile?

René J.V. Bertin
In reply to this post by Christopher Jones
Christopher Jones wrote:

> If you want pass a message on to the user, you should not use verbose output
> to do that. Instead just use a regular ‘ui_msg'

Except that this is not what I'm after; `port -v` generates additional output to
what's printed via `ui_msg`, just like `set -x` shows more than just the `echo`
commands. I probably shouldn't have implied that I wanted to use this to give
more feedback to the user, although it could be useful if the post-activate
calls a command (say a scan) that generates informative output (say progress
info).

A similar argument (irrelevant here) goes for `notes` vs. `ui_msg`: they're
complementary.

R