From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10322 invoked by alias); 13 Nov 2011 23:10:41 -0000 Received: (qmail 10314 invoked by uid 22791); 13 Nov 2011 23:10:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from unit0.ironport.snap.net.nz (HELO unit0.ironport.snap.net.nz) (202.37.100.104) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 13 Nov 2011 23:10:25 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEALhNwE57/y/M/2dsb2JhbABCqXuCeT8/PBUfThO+GINRhi4EmWmMVA Received: from rupert.snap.net.nz ([202.37.100.140]) by smtp0.ironport.snap.net.nz with ESMTP; 14 Nov 2011 12:10:23 +1300 X-Sender-IP: 123.255.47.204 X-Sender-IP: 123.255.47.204 Received: from [127.0.1.1] (204.47.255.123.static.snap.net.nz [123.255.47.204]) by rupert.snap.net.nz (Postfix) with ESMTPS id 4027820277; Mon, 14 Nov 2011 12:10:23 +1300 (NZDT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH] configure: support arbitrary versions via a shell script X-Mercurial-Node: 02572d8009f6a872ccd28d2e020b19772d7e8906 Message-Id: <02572d8009f6a872ccd2.1321225822@crucis> User-Agent: Mercurial-patchbomb/1.7.5 Date: Sun, 13 Nov 2011 23:10:00 -0000 From: Michael Hope To: "Yann E. MORIN" Cc: crossgcc@sourceware.org X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00034.txt.bz2 # HG changeset patch # User Michael Hope # 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 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