From patchwork Mon Jan 25 22:57:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Salt X-Patchwork-Id: 75128 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0PN1H5o027979 for ; Mon, 25 Jan 2010 23:01:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258Ab0AYXBO (ORCPT ); Mon, 25 Jan 2010 18:01:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752188Ab0AYXBO (ORCPT ); Mon, 25 Jan 2010 18:01:14 -0500 Received: from lon1-post-3.mail.demon.net ([195.173.77.150]:35756 "EHLO lon1-post-3.mail.demon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751079Ab0AYXBO (ORCPT ); Mon, 25 Jan 2010 18:01:14 -0500 Received: from youmustbejoking.demon.co.uk ([80.176.152.238] helo=pentagram.youmustbejoking.demon.co.uk) by lon1-post-3.mail.demon.net with esmtp (Exim 4.69) id 1NZXvl-0004Cm-dI; Mon, 25 Jan 2010 23:01:13 +0000 Received: from [192.168.0.5] (helo=flibble.youmustbejoking.demon.co.uk) by pentagram.youmustbejoking.demon.co.uk with esmtp (Exim 4.69) (envelope-from ) id 1NZXvk-0003dj-K5; Mon, 25 Jan 2010 23:01:12 +0000 Date: Mon, 25 Jan 2010 22:57:02 +0000 From: Darren Salt To: Johannes Berg , linux-wireless@vger.kernel.org Subject: [PATCH 1/3] Tweak version handling to allow vendor-specific suffixes without patching. Message-ID: <50E4CCD2A8%linux@youmustbejoking.demon.co.uk> In-Reply-To: <50E4CB7318%linux@youmustbejoking.demon.co.uk> References: <1264458811-21411-1-git-send-email-linux@youmustbejoking.demon.co.uk> <50E4CB7318%linux@youmustbejoking.demon.co.uk> Mail-Followup-To: Johannes Berg , linux-wireless@vger.kernel.org, Darren Salt User-Agent: Messenger-Pro/2.61.0.3112 (Qt/4.5.3) (Linux-x86_64) X-NuLabour-Date: Mon, 9187 Dec 1984 22:57:02 +0000 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.0.5 X-SA-Exim-Mail-From: linux@youmustbejoking.demon.co.uk X-SA-Exim-Scanned: No (on pentagram.youmustbejoking.demon.co.uk); SAEximRunCond expanded to false Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/Makefile b/Makefile index 2c5fd9e..8d6c700 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,11 @@ VERSION_OBJS := $(filter-out version.o, $(OBJS)) version.c: version.sh $(patsubst %.o,%.c,$(VERSION_OBJS)) rfkill.h Makefile \ $(wildcard .git/index .git/refs/tags) @$(NQ) ' GEN ' $@ +ifeq (,$(VERSION_SUFFIX)) $(Q)./version.sh $@ +else + $(Q)./version.sh --suffix "$(VERSION_SUFFIX)" $@ +endif %.o: %.c rfkill.h @$(NQ) ' CC ' $@ diff --git a/version.sh b/version.sh index 957684b..28b579a 100755 --- a/version.sh +++ b/version.sh @@ -1,9 +1,18 @@ #!/bin/sh VERSION="0.3" + +SUFFIX= +if test "x$1" = x--suffix; then + shift + SUFFIX="-$1" + shift +fi OUT="$1" -if head=`git rev-parse --verify HEAD 2>/dev/null`; then +if test "x$SUFFIX" != 'x'; then + v="$VERSION$SUFFIX" +elif head=`git rev-parse --verify HEAD 2>/dev/null`; then git update-index --refresh --unmerged > /dev/null descr=$(git describe 2>/dev/null || echo "v$VERSION")