+Mon Mar 12 23:17:11 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+ * libvirt.spec.in: Don't run UUID generation on first install,
+ instead run it if there is no <uuid> in the default network.
+ This ensures RPM upgrades get a UUID inserted
+
Mon Mar 12 12:32:11 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* libvirt.spec.in: Generate a random UUID for the default network
%post
/sbin/ldconfig
/sbin/chkconfig --add libvirtd
-if [ $1 = 1 ]; then
+grep uuid %{_sysconfdir}/libvirt/qemu/networks/default.xml 1>/dev/null 2>&1
+if [ $? != 0 ]; then
UUID=`/usr/bin/uuidgen`
sed -i -e "s,</name>,</name>\n <uuid>$UUID</uuid>," %{_sysconfdir}/libvirt/qemu/networks/default.xml
fi