Hi Vincent,
thanks for the patch. At first glance this looks good to me. I'll give
it a try and will address this in (one of) the next uploads.
Thanks,
Michael
On Thu, Dec 06, 2012 at 10:27:14AM +0100, Vincent Kersten wrote:
> Package: fsl
> Version: 4.1.9-6~nd60+1
> Severity: normal
> Tags: patch upstream
>
> Having multiple versions of fsl installed, I find that the PATH and
> LD_LIBRARY_PATH are not cleaned when switching versions (sourceing fsl.sh
> multiple times). Arguably a corner case, with a simple solution:
>
> AWK ONLY:
> =-=-=--==-
>
> --- /tmp/4 2012-12-05 13:36:24.000000000 +0100
> +++ /etc/fsl/fsl.sh 2012-12-06 10:00:17.000000000 +0100
> @@ -13,7 +13,8 @@
> # Possum is installed in the same directory
> POSSUMDIR=$FSLDIR
>
> -# add the fsl binary path to the search path
> +# clean up and add the fsl binary path to the search path
> +PATH=$( echo $PATH | awk -F":" '{ORS="";MYOUT=0;for (i=1;i<=NF;i++){ if ($i
> !~ /\/fsl\//){if (MYOUT==0){ print $i ; MYOUT++ } else print ":"$i }}}' )
> PATH=$PATH:/usr/lib/fsl/4.1
>
> # The following variable selects the default output image type
> @@ -62,7 +63,8 @@
> FSLWISH FSLBROWSER FSLLOCKDIR FSLMACHINELIST FSLREMOTECALL
>
>
> -# Configure the linker search path for Debian FSLs internal shared libraries
> +# Clean and Configure the linker search path for Debian FSLs internal shared
> libraries
> +LD_LIBRARY_PATH=$( echo $LD_LIBRARY_PATH | awk -F":" '{ORS="";MYOUT=0;for
> (i=1;i<=NF;i++){ if ($i !~ /\/fsl\//){if (MYOUT==0){ print $i ; MYOUT++ }
> else print ":"$i }}}' )
> LD_LIBRARY_PATH=/usr/lib/fsl/4.1${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
> export LD_LIBRARY_PATH
>
>
>
>
>
> SHORTER BUT MORE PROGS INVOLVED
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> --- /tmp/4 2012-12-06 10:24:30.841855594 +0100
> +++ /tmp/fsl 2012-12-05 17:41:58.732980398 +0100
> @@ -13,6 +13,9 @@
> # Possum is installed in the same directory
> POSSUMDIR=$FSLDIR
>
> +# clean out previous fsl PATH components
> +PATH=$( echo $PATH | tr ":" "\n" | grep -v "/fsl/" | tr -s "\n" ":" | sed
> 's/:$//')
> +
> # add the fsl binary path to the search path
> PATH=$PATH:/usr/lib/fsl/4.1
>
> @@ -62,6 +65,9 @@
> FSLWISH FSLBROWSER FSLLOCKDIR FSLMACHINELIST FSLREMOTECALL
>
>
> +# clean out previous fsl LD_LIBRARY_PATH components
> +LD_LIBRARY_PATH=$( echo $LD_LIBRARY_PATH | tr ":" "\n" | grep -v "/fsl/" |
> tr -s "\n" ":" | sed 's/:$//')
> +
> # Configure the linker search path for Debian FSLs internal shared libraries
> LD_LIBRARY_PATH=/usr/lib/fsl/4.1${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
> export LD_LIBRARY_PATH
>
>
>
> Thank you Michael for ND and Mark for FSL!
>
>
> Vincent
>
>
>
>
> -- System Information:
> Debian Release: 6.0.6
> APT prefers stable-updates
> APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500,
> 'stable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 2.6.32-5-amd64 (SMP w/16 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
>
> Versions of packages fsl depends on:
> ii fsl-4.1 4.1.9-6~nd60+1 analysis tools for FMRI, MRI and
> D
>
> fsl recommends no packages.
>
> fsl suggests no packages.
>
> -- no debconf information
>
> ------------------------------------------------------------------------------
>
> De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
> uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
> ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
> te informeren door het bericht te retourneren. Het Universitair Medisch
> Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de
> W.H.W.
> (Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd bij
> de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.
>
> Denk s.v.p aan het milieu voor u deze e-mail afdrukt.
>
> ------------------------------------------------------------------------------
>
> This message may contain confidential information and is intended exclusively
> for the addressee. If you receive this message unintentionally, please do not
> use the contents but notify the sender immediately by return e-mail.
> University
> Medical Center Utrecht is a legal person by public law and is registered at
> the Chamber of Commerce for Midden-Nederland under no. 30244197.
>
> Please consider the environment before printing this e-mail.
--
Michael Hanke
http://mih.voxindeserto.de
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]