]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: Fix default network generation on FreeBSD
authorAndrea Bolognani <abologna@redhat.com>
Thu, 21 Apr 2016 10:01:27 +0000 (12:01 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 21 Apr 2016 14:45:20 +0000 (16:45 +0200)
FreeBSD's sed(1) doesn't support using "\n" to insert a newline,
so the installed default.xml file ends up containing a literal
"n" between tags; to work around this problem, add a tr(1)
invocation as suggested by the sed FAQ[1].

[1] http://sed.sourceforge.net/sedfaq4.html (4.1 c)

src/Makefile.am

index b71e69485f37c69e6287ced1a34c2611de9a1250..09389a82b296d67182566d7aec7162df4de16124 100644 (file)
@@ -3072,8 +3072,9 @@ if WITH_NETWORK
        $(INSTALL_DATA) $(srcdir)/network/default.xml \
          $(DESTDIR)$(confdir)/qemu/networks/default.xml
        test -z "$(UUID)" || \
-         { sed -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
-             $(DESTDIR)$(confdir)/qemu/networks/default.xml > \
+         { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
+             $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
+             tr ";" "\n" > \
              $(DESTDIR)$(confdir)/qemu/networks/default.xml.t && \
            cp $(DESTDIR)$(confdir)/qemu/networks/default.xml.t \
              $(DESTDIR)$(confdir)/qemu/networks/default.xml && \