From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: kcar-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 3DF8E1F4E1; Wed, 14 Jan 2015 08:48:43 +0000 (UTC) Date: Wed, 14 Jan 2015 08:48:43 +0000 From: Eric Wong To: kcar-public@bogomips.org Subject: [PATCH] GIT-VERSION-GEN: fix install for non-tag versions Message-ID: <20150114084843.GA6083@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: Oops, we need to continue generating the Makefile snippet. --- This only affects users installing from git 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__ -- EW