From patchwork Wed Sep 12 09:28:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 11347 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id EEB8823E29 for ; Wed, 12 Sep 2012 09:31:36 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6B0C33DF818D for ; Wed, 12 Sep 2012 09:31:36 +0000 (UTC) Received: by ieak11 with SMTP id k11so2489254iea.11 for ; Wed, 12 Sep 2012 02:31:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Ty/ie8zQWVij11J2Q547DraQIjcUbcVm4EY6MD8cAa4=; b=AHVTIGpnJtUWh7lmpdpKuL5rvaATZ60+l7jp6FYunO/x9zTAc0sczGuIF/LYw2/+bW 4ka2BmXHmxgh9+dAU5vK36n93ubKxeLPHmeKVHgtBzxTrcdlOX2fhWnwXAJrECZHk9K6 Fmo9E6+6kIdY+F+dsd8NCmgEo5QiwGtk+EoqBljohq30XxM9B0MMglBELsiAx0J+s1oY 4CDj5T/DlnNXLJpYxv44pOSf9Bm4Z8KjMzYU5AnT89Xd6vgWwEFrwrRtA7jkmjcmVZ6v tvvFCqNacjogHBccMeDv9pbHT4kHrXohy+NqJNk0arbnYcCZSvPlx5JxoBiWrQgtA4B5 vKXw== Received: by 10.50.7.212 with SMTP id l20mr20043788iga.43.1347442295769; Wed, 12 Sep 2012 02:31:35 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp60187igc; Wed, 12 Sep 2012 02:31:35 -0700 (PDT) Received: by 10.66.82.3 with SMTP id e3mr31265941pay.56.1347442294815; Wed, 12 Sep 2012 02:31:34 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id iv6si28860707pbc.88.2012.09.12.02.31.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Sep 2012 02:31:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by pbcmd12 with SMTP id md12so2304330pbc.37 for ; Wed, 12 Sep 2012 02:31:34 -0700 (PDT) Received: by 10.66.75.73 with SMTP id a9mr31220284paw.43.1347442294193; Wed, 12 Sep 2012 02:31:34 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id jz10sm11137454pbc.8.2012.09.12.02.31.31 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Sep 2012 02:31:32 -0700 (PDT) From: Tushar Behera To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mmarek@suse.cz, patches@linaro.org Subject: [PATCH v2] kbuild: setlocalversion: ignore private tags while reporting local version Date: Wed, 12 Sep 2012 14:58:30 +0530 Message-Id: <1347442110-26569-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1347424996-15569-1-git-send-email-tushar.behera@linaro.org> References: <1347424996-15569-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQkpg7zB+WBDVrsr0OPxFlcP14lJTV41gAC7cgi+8iv4X7Vco1FeIwkzd4+9rkbq+ZSd23Lq The output of 'git describe' is relative to the immediate preceding tag. When the immediate tag preceding or at the HEAD is a private tag, setlocalversion extracts information with respect to the private tag and wrongly reports them with respect to Linux tag. Fixing this to extract information with respect to Linux tags. CC: Michal Marek Signed-off-by: Tushar Behera --- Changes since v1: * Extend the fix when the HEAD is a private tagged commit scripts/setlocalversion | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/setlocalversion b/scripts/setlocalversion index bd6dca8..b65e8a9 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -47,7 +47,7 @@ scm_version() # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore # it, because this version is defined in the top level Makefile. - if [ -z "`git describe --exact-match 2>/dev/null`" ]; then + if [ -z "`git describe --exact-match --match v[2-9].* 2>/dev/null`" ]; then # If only the short version is requested, don't bother # running further git commands @@ -57,7 +57,8 @@ scm_version() fi # If we are past a tagged commit (like # "v2.6.30-rc5-302-g72357d5"), we pretty print it. - if atag="`git describe 2>/dev/null`"; then + # Also match linux tags pattern to discard private tags + if atag="`git describe --match v[2-9].* 2>/dev/null`"; then echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' # If we don't have a tag at all we print -g{commitish}.