The generated version.py has to go in the srcdir and has to be regenerated
based on config.status, which breaks "make distcheck" because it
write-protects the srcdir.  However, the contents of version.py only change
when the version number changes, so we can just "touch" it when it doesn't
really need to change.

The same pattern is used elsewhere in the tree for other files in the same
situation, e.g. the various RPM spec files.

Reported-by: Chris Wright <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
---
 python/automake.mk |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/python/automake.mk b/python/automake.mk
index 9672042..447c08f 100644
--- a/python/automake.mk
+++ b/python/automake.mk
@@ -62,10 +62,10 @@ ovs-uninstall-local:
 
 ALL_LOCAL += $(srcdir)/python/ovs/version.py
 $(srcdir)/python/ovs/version.py: config.status
-       $(ro_shell) > [email protected]
-       echo 'VERSION = "$(VERSION)"' >> [email protected]
+       $(ro_shell) > $(@F).tmp
+       echo 'VERSION = "$(VERSION)"' >> $(@F).tmp
        if [ "$(BUILDNR)" != "0" ]; \
-           then echo 'BUILDNR = "+build$(BUILDNR)"' >> [email protected]; \
-           else echo 'BUILDNR = ""' >> [email protected]; \
-       fi;
-       mv [email protected] $@
+           then echo 'BUILDNR = "+build$(BUILDNR)"' >> $(@F).tmp; \
+           else echo 'BUILDNR = ""' >> $(@F).tmp; \
+       fi
+       if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp 
$@; fi
-- 
1.7.2.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to