From: Ben Pfaff Date: Mon, 12 Mar 2012 17:34:22 +0000 (-0700) Subject: python: Fix "make distcheck" error on version.py. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=45db068c679242d411d4b5c45caa973f6b948977;p=sliver-openvswitch.git python: Fix "make distcheck" error on version.py. 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 Signed-off-by: Ben Pfaff --- diff --git a/python/automake.mk b/python/automake.mk index f9d2c575f..db0683fa3 100644 --- a/python/automake.mk +++ b/python/automake.mk @@ -62,7 +62,7 @@ ovs-uninstall-local: ALL_LOCAL += $(srcdir)/python/ovs/version.py $(srcdir)/python/ovs/version.py: config.status - $(ro_shell) > $@.tmp - echo 'VERSION = "$(VERSION)"' >> $@.tmp - echo 'BUILDNR = "$(BUILDNR)"' >> $@.tmp - mv $@.tmp $@ + $(ro_shell) > $(@F).tmp + echo 'VERSION = "$(VERSION)"' >> $(@F).tmp + echo 'BUILDNR = "$(BUILDNR)"' >> $(@F).tmp + if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi