Re: [PATCH] Use python discovered through env instead of hardcoding a path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/13/2010 08:53 AM, Matthias Bolte wrote:
> This is more flexible regarding the location of the python binary
> but doesn't allow to pass the -u flag. The -i flag can be passed
> from inside the script using the PYTHONINSPECT env variable.
> 
> This fixes a problem with the esx_vi_generator.py on FreeBSD.
> ---
>  examples/python/dominfo.py    |    2 +-
>  examples/python/domrestore.py |    2 +-
>  examples/python/domsave.py    |    2 +-
>  examples/python/domstart.py   |    2 +-
>  examples/python/esxlist.py    |    2 +-
>  python/generator.py           |    2 +-
>  python/libvirt-override.py    |    5 +++++
>  src/esx/esx_vi_generator.py   |    2 +-
>  8 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/examples/python/dominfo.py b/examples/python/dominfo.py
> index e41709c..2f250e7 100755
> --- a/examples/python/dominfo.py
> +++ b/examples/python/dominfo.py
> @@ -1,4 +1,4 @@
> -#! /usr/bin/python
> +#!/usr/bin/env python

ACK.  It still assumes a hard-coded location, but /usr/bin/env is more
likely to exist on all platforms, regardless of where python was
installed.  It's a shame that #! lines are so limited, and portably take
only one argument, which is now "python".

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]