[gobolinux-users] Issues while building Mercurial

Michael Homer michael at gobolinux.org
Fri Apr 3 14:18:11 NZDT 2009


On Friday 03 April 2009 13:43:49 Daed Lee wrote:
> 2009/4/2 Michael Homer <michael at gobolinux.org>:
> >> Fixed by editing StartRootless:
> >>
> >> export
> >> PYTHONPATH="${goboPrefix}/System/Links/Libraries/python2.3/site-packages
> >>:${
> >> goboPrefix}/System/Links/Libraries/python2.4/site-packages${PYTHONPATH:+
> >>:$PY THONPATH}"
> >>
> >> changed to:
> >>
> >> export
> >> PYTHONPATH="${goboPrefix}/System/Links/Libraries/python2.3/site-packages
> >>:${
> >> goboPrefix}/System/Links/Libraries/python2.4/site-packages:${goboPrefix}
> >>/Sys
> >> tem/Links/Libraries/python2.5/site-packages${PYTHONPATH:+:$PYTHONPATH}"
> >>
> >> Is this required every for every new version of Python?
> >
> > Probably, yes. It's a Rootless-specific problem (as is the one above, I
> > think); if you use our Python, PYTHONPATH isn't used and
> > /S/L/L/python2.{6,5,4,3} is inserted directly into sys.path. If you're
> > using the system Python though that won't be there and you have to
> > override it; in that case, yes, you'll have to update it each time (and
> > you probably want to reverse the order).
>
> How about using the following patch:
>
> --- CreateRootlessEnvironment.original	2009-03-25 11:51:14.000000000 -0400
> +++ CreateRootlessEnvironment.python	2009-04-02 20:32:57.000000000 -0400
> @@ -158,7 +158,12 @@ then
>     [ -e "${goboPrefix}/System/Settings/bashrc" ] && .
> "${goboPrefix}/System/Settings/bashrc"
>  fi
>
> -export
> PYTHONPATH="${goboPrefix}/System/Links/Libraries/python2.3/site-packages:${
>goboPrefix}/System/Links/Libraries/python2.4/site-packages${PYTHONPATH:+:$PY
>THONPATH}" +for pythonDirectory in `find
> "${goboPrefix}/System/Links/Libraries" -name "python*" | sort --reverse`
> +do
> +   
> PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}${pythonDirectory}/site-packages"
> +done
> +
> +export PYTHONPATH
>
>  export
> PKG_CONFIG_PATH="${goboPrefix}/System/Links/Libraries/pkgconfig${PKG_CONFIG
>_PATH:+:$PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfi
>g:/usr/lib/pkgconfig:/usr/share/pkgconfig"
That looks ok, though it probably wants -maxdepth 1 or it will pick up any 
other filenames starting with python and take longer to run. It won't work if 
$goboPrefix has spaces in it either. Better would be
while read pythonDirectory
do
   PYTHONPATH="${pythonDirectory}/site-packages${PYTHONPATH:+:$PYTHONPATH}"
done < <(find "${goboPrefix}/System/Links/Libraries" -maxdepth 1 -name 'python*' 
| sort)
That also makes the Rootless paths precede any system paths, which seems like 
the right way around.

If you're sending patches inline it's helpful to turn off line-wrapping too 
(and leave the filename intact). I have cleaned it up and committed with the 
above changes in r3951.
-Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.gobolinux.org/pipermail/gobolinux-users/attachments/20090403/e2a90943/attachment.pgp 


More information about the gobolinux-users mailing list