john.levon(a)sun.com wrote:
# HG changeset patch
# User john.levon(a)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(a)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)
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