[PATCH modular] release.sh: Find modular directory through symlinks

Dan Nicholson dbn.lists at gmail.com
Sun Mar 13 08:52:02 PDT 2011


On Sun, Mar 13, 2011 at 3:34 AM, Dirk Wallenstein <halsmit at t-online.de> wrote:
> To find the auxiliary script that updates a moduleset, consider the case
> where the main script is accessed through a symlink, and resolve that
> first.
>
> Signed-off-by: Dirk Wallenstein <halsmit at t-online.de>
> ---
>  release.sh |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/release.sh b/release.sh
> index 5228a30..e8ea013 100755
> --- a/release.sh
> +++ b/release.sh
> @@ -253,7 +253,8 @@ echo "    at: $announce"
>
>  if [ -n "$moduleset" ]; then
>     echo "updating moduleset $moduleset"
> -    modulardir=`dirname "$0"`
> +    real_script_path=`realpath "$0"`
> +    modulardir=`dirname "$real_script_path"`
>     sha1sum=`cd $tarball_dir && $SHA1SUM $targz | cut -d' ' -f1`
>     $modulardir/update-moduleset.sh $moduleset $sha1sum $targz
>  fi

Hmm, I don't have realpath on fedora and yum doesn't know of any
realpath packages. Might be safer to use "readlink -f" since readlink
comes from coreutils, which is definitely installed on every linux
host if not every unix host.

--
Dan


More information about the xorg-devel mailing list