From patchwork Tue Mar 5 20:53:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 1051993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44DTdP2MNFz9sBF for ; Wed, 6 Mar 2019 07:53:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="O7K/rc+M"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="drlm9uTN"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44DTdN68PRzDqD0 for ; Wed, 6 Mar 2019 07:53:44 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mendozajonas.com (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=sam@mendozajonas.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="O7K/rc+M"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="drlm9uTN"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44DTd94M0yzDqCH for ; Wed, 6 Mar 2019 07:53:32 +1100 (AEDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 1880521FD3; Tue, 5 Mar 2019 15:53:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 05 Mar 2019 15:53:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=fm2; bh=JhGAKYrXBbxjO yVTMiTSvvCTj0EOBTYLBVbBkOb6z6A=; b=O7K/rc+MNv6Epn+GdEmgAqbjDuY7P 51relnK13YHMSpXs/7P1K3IlFtpuh7ayHHw0JJQBYXl26lbZAgq6u/YzMKihK36s EO4cT79KUdLF6nINhikhSms6WelzuU1ugWInKReSPTZZ7tj6UqkkRfKmDgE3HW9K WIVYL5pryvkbi4if20GoeiUlHyPofxpyobJeCDNzIqmVJJtbJJGr0A2v4ITFHmNx JohIyGjjYLyWt8Ll+xIyZU8KetZY9HibqzbSZ6G2hNhivVsoYqXyK+t+D7xE/B26 OcxTG3QjdPGOTNgXpsHgGepuj1s5b6KiLQDMD2yP7Aw8uVCbr9C/LvwAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=JhGAKYrXBbxjOyVTM iTSvvCTj0EOBTYLBVbBkOb6z6A=; b=drlm9uTNA59jpXWsTFAH4rSIpn6x30prD qNB/8fuXzPdlEcONpzuvMkxt/z3DRo/MT1EaoG+aEoWZIPrtiFWB9TH775yR7sV1 u/lJxpMUihAHENUxz2L1+DAS6xTkBOu2j6ribSDUS9wg5zlkvxScA3lm3yDHYoYY TTYHrZjD0ZLm7xhqzfPeKztbvlgR3KvwsWzOKmptNjbmxdZB31ezj6RzIMPvIVF9 vIv4YP6SSve5t/YimFQjZQ2Z5HS7D5F2ShJj1r+dVGj4PrNSmXOwaHMyoPmjfolA jjxDbUZJWCnuCM74AGrLX2Dot06qrD4YJkxWGWFkUloUZUH3va/RA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfeefgddugeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepufgrmhhuvghlucfovghnughoiigrqdflohhnrghsuceoshgrmhes mhgvnhguohiirghjohhnrghsrdgtohhmqeenucfkphepuddvuddrleelrddufeehrddvud einecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmsehmvghnughoiigrjhhonhgrshdr tghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost.localdomain (unknown [121.99.135.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 3549610318; Tue, 5 Mar 2019 15:53:25 -0500 (EST) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH] version.sh: Include leading 'v' from git describe Date: Wed, 6 Mar 2019 09:53:05 +1300 Message-Id: <20190305205305.25370-1-sam@mendozajonas.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" For some reason our version script removes the leading 'v' from the git tag. This confuses some other tools such as Buildroot and is different to most other projects, so include it again. Additionally now that we have tagged releases just use git describe rather than using a SHA and date to describe non-tag commits. Signed-off-by: Samuel Mendoza-Jonas --- version.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/version.sh b/version.sh index bf91f707..83cda7a0 100755 --- a/version.sh +++ b/version.sh @@ -15,16 +15,8 @@ if head=$(git rev-parse --short=8 --verify HEAD 2>/dev/null); then suffix=-dirty fi - if tag=$(git describe --tags --exact-match 2>/dev/null); then - # use a tag; remove any 'v' prefix from v tags - tag=${tag#v} - version=$(printf "%s%s" ${tag} ${suffix}) - else - # Use the git commit revision for the package version, and add - # a date prefix for easy comparisons. - date=$(git log --pretty=format:"%ct" -1 HEAD) - version=$(printf "%($datefmt)T.g%s%s" ${date} ${head} ${suffix}) - fi + tag=$(git describe --tags 2>/dev/null) + version=$(printf "%s%s" ${tag} ${suffix}) else # Check if a specific version is set, eg: by buildroot if [ ! -z "$PETITBOOT_VERSION" ];