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

[libvirt] [PATCH] Makefile portability in qemud



# HG changeset patch
# User john levon sun com
# 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 sun com>

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)
 
 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


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