public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] configure: support arbitrary versions via a shell script
@ 2011-11-13 23:10 Michael Hope
  2011-11-14  7:21 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Hope @ 2011-11-13 23:10 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc

# HG changeset patch
# User Michael Hope <michael.hope@linaro.org>
# Date 1321225775 -46800
# Branch any-version
# Node ID 02572d8009f6a872ccd28d2e020b19772d7e8906
# Parent  3cd375ecdd7213104577bbd70863fa35f387bb93
configure: support arbitrary versions via a shell script

If the executable file '.version.sh' exists, then use its output for
the version.  Fall back to the contents of '.version' if the script
fails.

Note that .version.sh doesn't have to be a shell script.  I considered
making .version itself executable instead but this would cause trouble
with FAT based filesystems.

The fallback to .version is a bit dodgy.  Failing might be stricter
but is unfriendly.

Signed-off-by: Michael Hope <michael.hope@linaro.org>

diff -r 3cd375ecdd72 -r 02572d8009f6 configure
--- a/configure	Sun Nov 13 18:24:36 2011 +0100
+++ b/configure	Mon Nov 14 12:09:35 2011 +1300
@@ -2,7 +2,9 @@
 
 myname="${0##*/}"
 
-VERSION=$( cat .version )
+[ -f .version.sh -a -x .version.sh ] && VERSION=$( ./.version.sh )
+[ -z "${VERSION}" ] && VERSION=$( cat .version )
+
 DATE=$( date +%Y%m%d )
 
 PREFIX_DEFAULT=/usr/local

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-15  2:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-13 23:10 [PATCH] configure: support arbitrary versions via a shell script Michael Hope
2011-11-14  7:21 ` Yann E. MORIN
2011-11-14 20:37   ` Michael Hope
2011-11-14 21:17     ` Yann E. MORIN
2011-11-15  2:42       ` Michael Hope

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).