Re: [libvirt] [PATCH] Makefile portability in qemud

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



john.levon@xxxxxxx wrote:

> # HG changeset patch
> # User john.levon@xxxxxxx
> # Date 1229399267 28800
> # Node ID 35512df785342cd15214790e17e0c1f4d2182b32
> # Parent  57c76efe37988edc64beb12ca5dc1ff5863f0085
> Makefile portability in qemud
>
> Neither uuidgen nor sed -i are portable - only make the edit on
> platforms that can do so.
>
> Signed-off-by: John Levon <john.levon@xxxxxxx>
>
> diff --git a/qemud/Makefile.am b/qemud/Makefile.am
> --- a/qemud/Makefile.am
> +++ b/qemud/Makefile.am
> @@ -56,7 +56,7 @@ remote_protocol.c: remote_protocol.h
>
>  if WITH_LIBVIRTD
>
> -UUID=$(shell uuidgen)
> +UUID=$(shell type uuidgen >/dev/null 2>&1 && uuidgen)

ACK, but please use this smaller change:

  UUID=$(shell uuidgen 2>/dev/null)

>  sbin_PROGRAMS = libvirtd
>
> @@ -142,8 +142,9 @@ install-data-local: install-init install
>  	mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart
>  	$(INSTALL_DATA) $(srcdir)/default-network.xml \
>  	  $(DESTDIR)$(sysconfdir)/$(default_xml_dest)
> -	sed -i -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
> -	  $(DESTDIR)$(sysconfdir)/$(default_xml_dest)
> +	test -z "$(UUID)" || \
> +	  sed -i -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
> +	    $(DESTDIR)$(sysconfdir)/$(default_xml_dest)
>  	test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
>             ln -s ../default.xml \
>  	    $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]