[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

john.levon@sun.com wrote:
# 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)
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

On Tue, Dec 16, 2008 at 06:49:48PM -0800, john.levon@sun.com wrote:
# 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.
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
Jim Meyering
-
john.levon@sun.com