[Libguestfs] [PATCH 4/5] dib: require a Python interpreter

Pino Toscano ptoscano at redhat.com
Wed Mar 22 17:03:07 UTC 2017


On Wednesday, 22 March 2017 16:56:57 CET Richard W.M. Jones wrote:
> On Wed, Mar 22, 2017 at 11:19:49AM +0100, Pino Toscano wrote:
> >    if elements = [] && machine_readable then (
> > @@ -246,6 +252,19 @@ read the man page virt-dib(1).
> >    if elements = [] then
> >      error (f_"at least one distribution root element must be specified");
> >  
> > +  let python =
> > +    match python with
> > +    | Some exe ->
> > +      let p =
> > +        if Filename.is_relative exe then
> 
> IIUC what you mean here is "the 'exe' filename doesn't contain
> any slashes"?  That isn't what is written above.

Yes, sort of.  What about something like:

  let p =
    try
      ignore (String.find exe Filename.dir_sep);
      Unix.access exe [Unix.X_OK];
      exe
    with
    | Not_found ->
      get_required_tool exe in

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170322/61271050/attachment.sig>


More information about the Libguestfs mailing list