Re: [macports-base] 03/03: fetch: Do not redirect stderr

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

Re: [macports-base] 03/03: fetch: Do not redirect stderr

Ryan Schmidt-24

On Apr 15, 2018, at 11:34, Rainer Müller wrote:

> Rainer Müller (raimue) pushed a commit to branch vcs-fetch
> in repository macports-base.
>
>
> https://github.com/macports/macports-base/commit/600c6b2c7e03d208eefda5ae25d1f1d0ac58933e
>
> commit 600c6b2c7e03d208eefda5ae25d1f1d0ac58933e
>
> Author: Rainer Müller
> AuthorDate: Sun Apr 15 18:34:48 2018 +0200
>
>     fetch: Do not redirect stderr
>    
>     There is no need to redirect stderr to stdout with 2>&1, because the
>     system command will already do this by default for us.

Why does the system command do this?


Reply | Threaded
Open this post in threaded view
|

Re: [macports-base] 03/03: fetch: Do not redirect stderr

Rainer Müller-4
On 2018-04-16 01:31, Ryan Schmidt wrote:

>
> On Apr 15, 2018, at 11:34, Rainer Müller wrote:
>
>> Rainer Müller (raimue) pushed a commit to branch vcs-fetch
>> in repository macports-base.
>>
>>
>> https://github.com/macports/macports-base/commit/600c6b2c7e03d208eefda5ae25d1f1d0ac58933e
>>
>> commit 600c6b2c7e03d208eefda5ae25d1f1d0ac58933e
>>
>> Author: Rainer Müller
>> AuthorDate: Sun Apr 15 18:34:48 2018 +0200
>>
>>     fetch: Do not redirect stderr
>>    
>>     There is no need to redirect stderr to stdout with 2>&1, because the
>>     system command will already do this by default for us.
>
> Why does the system command do this?

We want to record the output of commands in our log files, both stdout
and stderr. Therefore these channels will already be merged when we
redirect the output of the child process in the system command.

The set up for this is here:
https://github.com/macports/macports-base/blob/42e7ce792faaebb5e3aec958d2936c5fb8f02216/src/pextlib1.0/system.c#L239-L247

Now that I added the -o/-e options to system to capture stdout and
stderr in separate variables, this redirect would defeat this
functionality. When the shell already merges the channels with 2>&1, we
would not be able to tell them apart anymore as all output would only
arrive on stdout.

Rainer