From b51e40ffd82299ace280d085fe65c1f44c8d444e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 14 Jan 2015 08:47:35 +0000 Subject: [PATCH] GIT-VERSION-GEN: fix install for non-tag versions Oops, we need to continue generating the Makefile snippet. --- GIT-VERSION-GEN | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index e2057b7..77fdfb1 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -2,6 +2,7 @@ CONSTANT = "Kcar::VERSION" RVF = "lib/kcar/version.rb" DEF_VER = "v0.5.0" +GVF = "GIT-VERSION-FILE" vn = DEF_VER # First see if there is a version file (included in release tarballs), @@ -25,4 +26,14 @@ cur_ruby_version = File.read(RVF) rescue nil if new_ruby_version != cur_ruby_version File.open(RVF, "w") { |fp| fp.write(new_ruby_version) } end +File.chmod(0644, RVF) + +# generate the makefile snippet +new_make_version = "GIT_VERSION = #{vn}\n" +cur_make_version = File.read(GVF) rescue nil +if new_make_version != cur_make_version + File.open(GVF, "w") { |fp| fp.write(new_make_version) } +end +File.chmod(0644, GVF) + puts vn if $0 == __FILE__ -- 2.11.4.GIT