On Tuesday, 6 November 2018 11:44:14 CET Tomáš Golembiovský wrote:
> Install packages from local files without touching network.
> 
> Signed-off-by: Tomáš Golembiovský <tgole...@redhat.com>
> ---

In this case, better name it local_install/install_local (or something
along these lines) to make it more clear it is not a "classic install".

> +and do_install g { i_package_format = package_format } packages =
> +  assert (List.length packages > 0);
> +  match package_format with
> +  | "rpm" ->
> +    let cmd = [ "yum"; "--assumeyes"; "install" ] @ packages in
> +    let cmd = Array.of_list cmd in
> +    ignore (g#command cmd)

Note that i_package_format and i_package_management are different
things.  The code above breaks when the system is RPM-based, but does
not use yum, so e.g. Fedora (supported), and ALT Linux (not supported).

So either use i_package_format with low-level package managers
(rpm/dpkg/etc), or use i_package_management with yum/dnf/etc.

-- 
Pino Toscano

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to