[Piglit] [PATCH] piglit: Don't override user's definition of the PIGLIT_SOURCE_DIR env variable
Dylan Baker
baker.dylan.c at gmail.com
Fri May 9 13:41:57 PDT 2014
On Friday, May 09, 2014 16:31:09 Tom Stellard wrote:
> ---
> piglit | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/piglit b/piglit
> index af8dfb1..f0e6696 100755
> --- a/piglit
> +++ b/piglit
> @@ -38,7 +38,7 @@ import argparse
>
> # If running in the source directory there will be a HACKING file, don't
> # muck with things, if not we need to screw with the python path
> -if not path.exists('HACKING'):
> +if not path.exists('HACKING') and 'PIGLIT_SOURCE_DIR' not in os.environ:
> _binpath, _bin = path.split(__file__)
> _libdir = path.abspath(path.join(_binpath, '..', 'lib', _bin))
> sys.path.append(_libdir)
>
That will break running piglit out of tree if you've set
PIGLIT_SOURCE_DIR, since it won't add the python modules to the python
path. I haven't tested, but I think this is what you want:
if not path.exists('HACKING'):
_binpath, _bin = path.split(__file__)
_libdir = path.abspath(path.join(_binpath, '..', 'lib', _bin))
sys.path.append(_libdir)
if 'PIGLIT_SOURCE_DIR' not in os.environ:
os.environ['PIGLIT_SOURCE_DIR'] = libdir_
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140509/e67f4bb5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140509/e67f4bb5/attachment-0001.sig>
More information about the Piglit
mailing list