From: Bernhard Walle <bernhard@bwalle.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] ptxdist: Check for GNU readlink
Date: Mon, 12 Mar 2012 20:56:17 +0100 [thread overview]
Message-ID: <20120312195617.GA13907@regiomontanus.bwalle.de> (raw)
In-Reply-To: <20120214220510.GQ25569@pengutronix.de>
Hi Michael,
thanks again for the review.
* Michael Olbrich <m.olbrich@pengutronix.de> [2012-02-14 23:05]:
> > +# bash implementation of realpath / readlink -f
> > +# arg1 - filename
> > +realpath()
> > +{
> > + local fname oldfname
> > +
>
> hmmm, scary.
What's wrong about 'local'?
> Another idea: Is the problem that "readlink -f" does not work or does
> "readlink" not exist at all? Any readlink implementations should work here
> for fname="$(readlink "${fname}")".
You're right. Even Apple adds a working readlink implementation. :)
> > + if [ "$fname" = . ] ; then
> > + fname="$(dirname $oldfname)"
> > + elif echo $fname | grep -vq '^/' - ; then
>
> elif [ "${fname}" -eq "${fname#/}" ]; then
-eq is only for numeric comparison, so it should be '=', right?
> ( cd "$(dirname "${fname}")"
>
> > + fname=$(pwd -P)/$(basename $fname)
>
> )
Assigning a variable in a subshell has no effect on the outer shell, has
it? But echo'ing directly here works.
A reworked version will follow.
Regards,
Bernhard
--
ptxdist mailing list
ptxdist@pengutronix.de
next prev parent reply other threads:[~2012-03-12 19:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-14 20:55 Bernhard Walle
2012-02-14 22:05 ` Michael Olbrich
2012-03-12 19:56 ` Bernhard Walle [this message]
2012-03-13 10:14 ` Michael Olbrich
2012-03-13 11:32 ` Bernhard Walle
2012-03-13 10:16 [ptxdist] [PATCH 2/2] " Michael Olbrich
2012-03-13 11:23 ` [ptxdist] [PATCH] " bernhard
2012-03-13 11:30 ` bernhard
2012-03-13 13:17 ` 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=20120312195617.GA13907@regiomontanus.bwalle.de \
--to=bernhard@bwalle.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