[Libguestfs] Porting febootstrap to urpmi-based distributions
Richard W.M. Jones
rjones at redhat.com
Mon Oct 29 10:25:10 UTC 2012
On Mon, Oct 29, 2012 at 11:10:04AM +0100, Guillaume Rousse wrote:
> Hello Richard.
>
> I didn't find any dedicated mailing-list for febootstrap, so sending
> this directly seems the best option.
CC-ing this to libguestfs at redhat.com which is the right list.
> I'm interested to have
> libguestfs on mageia, meaning I have to port febootstrap first. I
> had a quick look at the code, and it seems all I have to do is to
> provide a new dedicated package handler.
>
> From the content of the febootstrap_yum_rpm.ml file, it seems I just
> have to rewrite the yum_rpm_resolve_dependencies_and_download
> function, given than all other adress rpm command directly.
Starting from an existing similar plugin is a good idea, so yes.
See also: src/febootstrap_package_handlers.mli where the interface is
precisely defined.
> My
> current understanding of this function tells me that its purpose is
> to download a given package and all its dependency. I think I could
> basically achieve the same result by calling urpmi (the functional
> equivalent of yum install) with the --no-install flag, wrapping its
> output to return the list of downloaded filenames. Or am I missing
> an obvious trap ?
The purpose of ph_resolve_dependencies_and_download is described as:
Take a list of package names, and using the package manager
resolve those to a list of all the packages that are required
including dependencies. Download the full list of packages and
dependencies into a tmpdir. Return the list of full filenames.
Note this should also process the [excludes] list.
Unfortunately for the RPM/Yum plugin we have to do this with some
complex Python code, which keeps breaking because they keep changing
their ill-defined "API". For the dpkg/apt plugin it's a lot simpler,
just running the command:
apt-cache depends --recurse -i [package list]
The obvious(?) trap might be that urpmi requires root. Hopefully not,
but if it does require root unnecessarily, please get urpmi upstream
to fix this.
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