[hipl-dev] Re: [Merge] lp:~hipl-core/hipl/android-hipfw into lp:hipl

  • From: "Juhani Toivonen" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "juhani.toivonen@xxxxxxxxxxxxxx" for DMARC)
  • To: hipl-dev@xxxxxxxxxxxxx
  • Date: Wed, 24 Sep 2014 01:26:09 +0300

On 24.09.2014, at 01:06, Juhani Toivonen <dmarc-noreply@xxxxxxxxxxxxx> wrote:

>>> 
>>> --- tools/prepare_android_toolchain.sh      2013-11-18 14:14:39 +0000
>>> +++ tools/prepare_android_toolchain.sh      2014-09-23 12:13:08 +0000
>>> @@ -1,14 +1,18 @@
>>> # These are for the script's internals
>>> +PATCHES_DIR=$(dirname $(readlink -f ${0}))/../patches/android
>> 
>> readlink is not a standard tool, but only part of GNU coreutils.
>> But I don't think you really need it anyway.
> 
> It’s been on every Linux system I’ve ever used, including the Android phones. 
> That was the first solution I found.
> 
> I figure $(dirname $(pwd)/${0})/ would do too..

I don’t think the new one is better. Now calling the script with its absolute 
path makes it wrong. readlink handles this correctly too.

If readlink is not ok, what is the standard way for a script to find its own 
absolute path?

Now that the patches are extracted to separate files, the script needs a way to 
find them. Relative paths go out the window right after the script changes 
directory, which it does many times before the patches are to be applied. I 
would also like to avoid having the script work only if called from under 
tools/.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Other related posts: