All of lore.kernel.org
 help / color / mirror / Atom feed
From: mcgrof@do-not-panic.com (Luis R. Rodriguez)
To: cocci@systeme.lip6.fr
Subject: [Cocci] [PATCH v3 1/2] autotools: simplify the way to determine version information
Date: Mon, 27 Jul 2015 15:03:31 -0700	[thread overview]
Message-ID: <1438034612-10595-2-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1438034612-10595-1-git-send-email-mcgrof@do-not-panic.com>

From: "Luis R. Rodriguez" <mcgrof@suse.com>

The version information you get when you run: spatch --version
comes from what ./confgure.ac ends up figuring out for you.
The top level Makefile uses the same mechanism to tell you
and use the version information at build time, but if the
strategy is updated in one place it would need to be updated
in both places.

Avoid this duplicatin of work and instead just make version
information come from ./version.sh script. We also remove the
Makefile version of determining the version information and
instead rely on the fact that Makefile.config.in is part of
AC_CONFIG_FILES() and have AC_SUBST([COCCI_VERSION], ["$PACKAGE_VERSION"])
in place.

Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Nikolay Orlyuk <virkony@gmail.com>
Cc: S?bastien Hinderer <Sebastien.Hinderer@inria.fr>
Cc: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 Makefile           | 1 -
 Makefile.config.in | 2 ++
 configure.ac       | 2 +-
 version.sh         | 2 ++
 4 files changed, 5 insertions(+), 2 deletions(-)
 create mode 100755 version.sh

diff --git a/Makefile b/Makefile
index fd369415b1ec..f8c99d3bb8d8 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,6 @@ endif
 -include /etc/Makefile.coccinelle  # local customizations, if any
 
 
-VERSION=$(shell cat ./version | tr -d '\n')
 CCVERSION=$(shell cat scripts/coccicheck/README | egrep -o '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' | head -n1)
 PKGVERSION=$(shell dpkg-parsechangelog -ldebian/changelog.$(DISTRIB_CODENAME) 2> /dev/null \
 	 | sed -n 's/^Version: \(.*\)/\1/p' )
diff --git a/Makefile.config.in b/Makefile.config.in
index 5eb7ac496fd3..ee23e09f29ce 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -1,3 +1,5 @@
+VERSION=@PACKAGE_VERSION@
+
 # * for each library $1, add another entry in the same manner
 MAKELIBS=@MAKE_dynlink@ @MAKE_menhirLib@ @MAKE_pycaml@ @MAKE_pcre@ \
   @MAKE_parmap@
diff --git a/configure.ac b/configure.ac
index d4072004228c..4c610afa5a2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ dnl  run 'automake -acf' to update setup/{install-sh,missing}
 
 dnl  standard initialization (we only use autoconf not automake)
 AC_PREREQ([2.68])
-AC_INIT([coccinelle], m4_esyscmd([cat ./version | tr -d '\n']), [cocci at systeme.lip6.fr], [], [http://coccinelle.lip6.fr/])
+AC_INIT([coccinelle], m4_esyscmd([./version.sh]), [cocci at systeme.lip6.fr], [], [http://coccinelle.lip6.fr/])
 AC_CONFIG_MACRO_DIR([setup])
 AC_CONFIG_AUX_DIR([setup])
 AC_SUBST([CONFIGURE_FLAGS], ["$*"])
diff --git a/version.sh b/version.sh
new file mode 100755
index 000000000000..02a5b7253ba9
--- /dev/null
+++ b/version.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+tr -d '\n' < ./version
-- 
2.3.2.209.gd67f9d5.dirty

  reply	other threads:[~2015-07-27 22:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 22:03 [Cocci] [PATCH v3 0/2] coccinelle: add localversion information Luis R. Rodriguez
2015-07-27 22:03 ` Luis R. Rodriguez [this message]
2015-07-31  6:44   ` [Cocci] [PATCH v3 1/2] autotools: simplify the way to determine version information SF Markus Elfring
2015-08-05 21:08     ` Luis R. Rodriguez
2015-07-27 22:03 ` [Cocci] [PATCH v3 2/2] autotools: add localversion information Luis R. Rodriguez
2015-07-30 13:50   ` Julia Lawall
2015-07-30 15:02     ` Luis R. Rodriguez
2015-07-31  7:03   ` [Cocci] " SF Markus Elfring
2015-08-05 21:10     ` Luis R. Rodriguez
2015-08-05 21:15 ` [Cocci] [PATCH v3 0/2] coccinelle: " Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438034612-10595-2-git-send-email-mcgrof@do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=cocci@systeme.lip6.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.