mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas@biessmann.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] libptxdist: explicitly use sed to run migrate_*
Date: Mon, 17 Oct 2011 09:06:21 +0200	[thread overview]
Message-ID: <8827b632aa90795542df9b3ef705367b@biessmann.de> (raw)
In-Reply-To: <20111014150343.GA31488@regiomontanus.bwalle.de>

Dear Bernhard,

On Fri, 14 Oct 2011 17:03:43 +0200, Bernhard Walle wrote:
> Hi,
>
> * Michael Olbrich <m.olbrich@pengutronix.de> [2011-10-14 16:04]:
>> Hmmm, I just had another idea: How about fixing the environment in 
>> ptxdist:
>>
>> mkdir <TMP_BIN>/
>> ln -s @PYTHON@ <TMP_BIN>/python
>> ln -s @SED@ <TMP_BIN>/sed
>> [...]
>> export PATH=<TMP_BIN>:$PATH
>> [...]
>>
>> just do this as early as possible in ptxdist and PATH will provide 
>> the
>> correct tools. Do you think that could work?
>
> That's what I'm doing in the Arch Linux ptxdist package [1]. Arch 
> Linux
> has /usr/bin/python pointing to /usr/bin/python3 instead of python2.
> There's a configure flag for ptxdist and Python, but that doesn't 
> work.
>
> I sent a patch [2], but even that patch doesn't fix everything 
> (there's
> still some ipkg problem). Because I was too lazy I changed it that 
> way
> (modifying PATH).
>
> I'm doing
>
> ----- 8< --------
> export PATH=$(dirname $(readlink -f "$0")):$PATH
> ----- >8 --------
>
> which inclues /usr/lib/ptxdist-2011.xx.y/bin into $PATH and that 
> works.

Seems to me the best solution for our problem. I think the current 
discussion is leading to some PTXDIST_BINDIR directory with links to the 
respective tools.

> It's not really nice, but I think it's better than patching lots of
> tools. And having scripts as executable programs is IMO still better
> than having to call the interpreter manually (which is necessary with
> your $PTXDIST_SED approach.

But how should we handle a script's sheebang? If we require the 
scripts/migrate tools to be executable scripts we need to preprocess the 
scripts to adopt the sheebang to e.g. $PTXDIST_BINDIR. I think it is 
much more portable to have the shell scripts kall the interpreter with 
the respective configuration, e.g. $PTXDIST_BINDIR/sed -f 
scripts/migrate/migrate_platform.

> Regards,
> Bernhard
>
> [1] http://aur.archlinux.org/packages.php?ID=49649
> [2] http://www.mail-archive.com/ptxdist@pengutronix.de/msg04264.html

best regards

Andreas Bießmann

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2011-10-17  9:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30  7:33 [ptxdist] [PATCH] scripts/migrate: use env to find sed Andreas Bießmann
2011-10-04 13:26 ` Michael Olbrich
2011-10-05 16:54 ` [ptxdist] [PATCH v2] scripts/migrate: use autotools to insert working sed Andreas Bießmann
2011-10-10 16:04   ` [ptxdist] [PATCH] libptxdist: explicitly use sed to run migrate_* Michael Olbrich
2011-10-11 10:16     ` andreas
2011-10-14 14:04       ` Michael Olbrich
2011-10-14 15:03         ` Bernhard Walle
2011-10-17  7:06           ` Andreas Bießmann [this message]
2011-10-17 10:45             ` Bernhard Walle
2011-10-17 12:53               ` Michael Olbrich
2011-10-17  6:54         ` Andreas Bießmann
2011-10-17  7:10           ` Andreas Bießmann

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=8827b632aa90795542df9b3ef705367b@biessmann.de \
    --to=andreas@biessmann.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