[Libguestfs] febootstrap and download packages

Richard W.M. Jones rjones at redhat.com
Fri Dec 21 19:30:11 UTC 2012


On Fri, Dec 21, 2012 at 07:28:19PM +0000, Richard W.M. Jones wrote:
> On Fri, Dec 21, 2012 at 09:16:41PM +0200, Evaggelos Balaskas wrote:
> > Thats fine - that was the approach i was going too but i couldnt think
> > how to implement this.
> > Thanks for the acknowledge on github.
> > 
> > I would like to discuss one more thing:
> > 
> > If pacman_config file doesnt exist then exit status of Sys.command cmd is 1
> > and febootstrap is trying to find this package from aur.
> > 
> > eg.
> > $ sudo pacman --config /etc/pacman.conf2 -Sw rsync ; echo $?
> > error: config file /etc/pacman.conf2 could not be read.
> > 1
> > 
> > a fallback mechanism could be this:
> > 
> > (match pacman_config with
> >  | None -> ""
> >  | Some filename when Sys.file_exists filename -> " --config " ^ filename
> >  | _ -> ""
> > )
> > 
> > (learning ocaml through febootstrap !)
> > 
> > I am not sure what the user experience should be on that.
> > Whats the approach on yum plugin, if the yum config doesnt exist ?
> 
> OK, I get it, you mean that the later code falls back to AUR.
> 
> That could happen.  I think what is needed is an explicit
> check earlier on, ie:
> 
>   fun pkg ->
>     if not (Sys.file_exists filename) then
>       failwith (sprintf "%s: pacman-config file does not exist" filename)
>     else (

Umm, in fact you don't need the explicit 'else' there ...

>       ... all the rest of the code ...

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora




More information about the Libguestfs mailing list