[Libguestfs] [PATCH v3] v2v: bootloaders: search grub config for all distributions
Richard W.M. Jones
rjones at redhat.com
Tue Nov 1 17:34:35 UTC 2016
On Tue, Nov 01, 2016 at 06:29:06PM +0100, Pino Toscano wrote:
> Our String.is_suffix is a does String.sub every time, so this is a bit
> inefficient -- I'd use Common_utils.last_part_of:
>
> let bootloader_type_of_filename path =
> match last_part_of path '/' with
> | Some "grub.cfg" -> Some Grub2
> | Some ("grub.conf"|"menu.lst") -> Some Grub1
> | Some _ | None -> None
OK, I'll change that. I should note that v3 of the patch also fails
check-slow for reasons I'm investigating.
[...]
> The g#is_file is there to exclude non-files (like directories), right?
> Otherwise it would be weird for g#find to return paths which don't
> exist..
Right, it's so we don't continue with a directory on some strange
system. I was considering adding a warning.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
More information about the Libguestfs
mailing list