mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Christoph Rüdiger" <christoph.ruediger@rwth-aachen.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] (no subject)
Date: Sun, 22 Feb 2015 20:17:52 +0100	[thread overview]
Message-ID: <54EA2B60.6040506@rwth-aachen.de> (raw)
In-Reply-To: <20150222093847.GC1532@pengutronix.de>


[-- Attachment #1.1: Type: text/plain, Size: 3318 bytes --]



Am 22.02.15 um 10:38 schrieb Michael Olbrich:
>> What is the intention of this brace usage here?
> 
> It's valid bash syntax. A bit of history here:
> The standard for sh shells says, that the file descriptors up to 9 can be
> used inside the shell scripts. So that's what we used originally: With
> "5>&1" we create a file descriptor that we can later use to write to stdout
> when the normal stdout is redirected to the log file.
> However this solution as a problem: oder scripts can use the same file
> descriptor numbers and the output is send to the wrong place. This happened
> e.g. with configure scripts. So we changed it to:
> "exec {PTXDIST_FD_STDOUT}>&1". This is valid in bash and means that a new
> file descriptor is opened (with a currently unused number >= 10) and
> anything written to it is send to stdout. The file descriptor number is
> stored in the specified variable (PTXDIST_FD_STDOUT).

Thank you very much for the explanation. I've never heard or read about
this feature before.


> I don't know why the bash in Max OS X cannot handle this. Maybe it's too
> old? What version are you using?

Your assumption is right. My OS X is 10.9.5 (Mavericks) and way newer
than the Ubuntu 10.04.4 which is the oldest system where I use ptxdist
for my day-to-day work. That's why I didn't took the version numbers
into account. But I was wrong:

Ubuntu 10.04.4: bash 4.1.5(1)-release
OS X 10.9.5: bash 3.2.53(1)-release

Just for completeness: The redirection feature with the optional left
hand {var} notation was introduced in bash 4.1-alpha (see
http://git.savannah.gnu.org/cgit/bash.git/tree/CHANGES#n1550).

bash 4.1 was released on 31 Dec. 2009. :-)

> Maybe something like this works:
> exec 7>&1
> exec 8>&1
> export PTXDIST_FD_STDOUT=7
> export PTXDIST_FD_STDERR=8

I've installed a recent bash 4.3.33 via homebrew instead. But this is
only part of the fix, because the ptxdist' scripts have a hardcoded
shebang to /bin/bash.

Additionally I needed to replace the Apple bash:
# mv /bin/bash /bin/bash.apple
# ln -s /usr/local/bin/bash /bin/bash


Here is also a potential fix for the configure script to check for a
proper bash version. I've never worked with autoconf, so please check
the patch carefully.

diff -urd a/configure.ac b/configure.ac
--- a/configure.ac	2013-12-18 10:48:42.000000000 +0100
+++ b/configure.ac	2015-02-22 19:16:21.000000000 +0100
@@ -101,9 +101,9 @@
 # though the result /could/ be available to us directly as $BASH_VERSION we
 # don't want to use, or trust it, incase the user is specifying a different
 # bash executable.
-if `$BASH -c '[[ "$BASH_VERSION" \< "2.04" ]]'` ; then
+if `$BASH -c '[[ "$BASH_VERSION" \< "4.1" ]]'` ; then
     AC_MSG_ERROR([
-$PACKAGE_NAME requires at least version 2.04 of bash, you can download
a current
+$PACKAGE_NAME requires at least version 4.1 of bash, you can download a
current
 version of bash from ftp.gnu.org
 ])
 fi

This problem seems to be solved now.

I'm now facing the problem, that host-zlib is not getting compiled with
the compiler setup in ptxdist setup. But this is part of another story
coming soon.

Best regards,
Christoph


-- 
Christoph Rüdiger
Am Horber Wald 19
73765 Neuhausen

phone: +49 - 7158 - 12 84 670


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 882 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2015-02-22 19:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-21 23:07 Rüdiger, Christoph
2015-02-21 23:11 ` Jon Ringle
2015-02-21 23:29   ` Rüdiger, Christoph
2015-02-21 23:43     ` Rüdiger, Christoph
2015-02-22  9:38 ` Michael Olbrich
2015-02-22 19:17   ` Christoph Rüdiger [this message]
2015-02-22 23:38     ` Anders Montonen
2015-02-23  8:33       ` Michael Olbrich
2015-02-23  9:13         ` Rüdiger, Christoph
2015-02-23 11:24           ` Michael Olbrich
2015-02-24 21:28             ` Rüdiger, Christoph
2015-02-26 12:23               ` Michael Olbrich
2015-02-27  8:48                 ` Rüdiger, Christoph
2015-02-27  9:06                   ` Michael Olbrich
2015-02-27  9:24                     ` Rüdiger, Christoph
2015-02-27 10:32                       ` Juergen Borleis
2015-02-27 15:36                       ` Michael Olbrich
2015-02-27  9:23                   ` Juergen Borleis
2015-02-27  9:31                     ` Rüdiger, Christoph
  -- strict thread matches above, loose matches on Subject: below --
2021-01-24 10:36 flix.ptxdist
2018-12-11  7:41 [ptxdist] [PATCH 1/2] rules: polkit: Fix incorrect installation path Michael Olbrich
2018-12-17  8:26 ` [ptxdist] (no subject) Dold, Wolfram
     [not found] <829880836.3299556.1488275043753.ref@mail.yahoo.com>
2017-02-28  9:44 ` fredy zavis
2017-02-28 10:23   ` Juergen Borleis
2015-03-26 13:11 carsten.schlote
2015-04-02 16:22 ` Michael Olbrich
2012-10-15  9:30 Alexander Dahl
2012-10-15 10:15 ` Alexander Dahl
2012-04-26 19:41 Ali Beddah
     [not found] <WC20111103170332.35000F@rsi-elektrotechnik.dedd a simple QML demo application [V2]>
2011-11-04  7:48 ` Josef Holzmayr

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=54EA2B60.6040506@rwth-aachen.de \
    --to=christoph.ruediger@rwth-aachen.de \
    --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