mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Jon Ringle <jon@ringle.org>
To: ptxdist@pengutronix.de, ptxdist@pengutronix.de
Subject: Re: [ptxdist] ptxdist compile redirects stderr to stdout
Date: Fri, 2 Dec 2016 12:25:01 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1612021218040.17102@jring-w510-7m3g.gridpoint.com> (raw)
In-Reply-To: <20161201102908.i2vplcm7y6vmiusz@pengutronix.de>



On Thu, 1 Dec 2016, Michael Olbrich wrote:

> Hi,
> 
> On Wed, Nov 30, 2016 at 03:46:14AM -0500, Jon Ringle wrote:
> > I found that this is being caused by commit
> > 30b9267e35eea1c2edb4da0231a428bfa25b6766
> > 
> > Is there a way that the stderr to stdout redirect could be implemented    
> > conditionally so that I can still have stderr segregated if I want to?
> 
> Yes. It's really only necessary if output synchronization is enabled. So,
> we could set some variable in setup_parallel() to '1' or '2' depending on
> PTXDIST_OUTPUT_SYNC and then use it instead of '2>&1'.

I did some experimenting with this, and when I use a variable to hold 
"2>&1", it works fine for the *) case, but for the python*) case where the 
ptxd_eval is surrounded by ( ), bash chokes.

Here's what I was trying:
ptxd_make_world_compile() {

    output_redirect="2>&1";

    ptxd_make_world_init &&

    if [ -z "${pkg_build_dir}" ]; then
        # no build dir -> assume the package has nothing to build.
        return
    fi &&
    case "${pkg_conf_tool}" in
        python*)
        (
        ptxd_eval \
            cd "${pkg_build_dir}" '&&' \
            "${pkg_path}" \
            "${pkg_env}" \
            "${pkg_make_env}" \
            "${ptx_build_python}" \
            setup.py \
            "${pkg_make_opt}"
        ) ${output_redirect}
        ;;
        *)
        ptxd_eval \
            "${pkg_path}" \
            "${pkg_env}" \
            "${pkg_make_env}" \
            "${MAKE}" -C "${pkg_build_dir}" \
            "${pkg_make_opt}" \
            "${pkg_make_par}" ${output_redirect}
        ;;
    esac
}

$ ~/git/ptxdist/bin/ptxdist --force compile testprog >/dev/null
/home/jringle-admin/git/ptxdist/scripts/lib/ptxd_make_world_compile.sh: 
line 35: syntax error near unexpected token `${output_redirect}'
/home/jringle-admin/git/ptxdist/scripts/lib/ptxd_make_world_compile.sh: 
line 35: `      ) ${output_redirect}'
ptxdist: error: failed to source lib: 
/home/jringle-admin/git/ptxdist/scripts/lib/ptxd_make_world_compile.sh


If I remove the variable redirect from the offending line and leave the 
variable redirect in the *) case, bash is fine with it and it does what is 
expected.

-Jon

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2016-12-02 17:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30  8:46 Jon Ringle
2016-12-01 10:29 ` Michael Olbrich
2016-12-02 17:25   ` Jon Ringle [this message]
2016-12-05  9:03     ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1612021218040.17102@jring-w510-7m3g.gridpoint.com \
    --to=jon@ringle.org \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox