From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6572151760657317888 X-Received: by 2002:a50:fd14:: with SMTP id i20-v6mr748146eds.9.1530556255542; Mon, 02 Jul 2018 11:30:55 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c3cd:: with SMTP id l13-v6ls5965899edr.4.gmail; Mon, 02 Jul 2018 11:30:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeDNGkWlqzx9+T7SKHr+DP89eNANs3CQT/h8/A/OqSFD9Cd7S5DaUnRGl2HDvIUHU++1qwv X-Received: by 2002:a50:c9c7:: with SMTP id c7-v6mr2853484edi.0.1530556255159; Mon, 02 Jul 2018 11:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530556255; cv=none; d=google.com; s=arc-20160816; b=Mx83BBAuHX+uH7tm+ubE8nmewWrq89Nlfviye51hVZbQ4MKa+8DdZHKZS99YlYJKvr xsIdwIIF/SvYoCOL/E41LSOvQi4HqqLZK2nSpc4/TBfE6t0jusx5xHTeNK+bHv5nDOoX phUXgjqyhtu7VSn4W7Xa9h7duE5Y/3SFWHGy3C6wnyZDhEaofJKsrqwF5DI7lkHwpr/B OH/GcK9PalvmeTfxpBlrj+xu/Qr6JLvHsEU6gQlv9Au5oWI4/1Q3QFtf9tUP59/JF9y7 L2cH2boKP99PTL5wEg1+EUNf8APlA0Vk7pQVqMWIqr53G4QBZRAFV3XFde1AO7tiPBfh YWXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=bKOGOEEeFDcmZb/mGfjXdI6YjTg4TkOl9WcLo3rE+0U=; b=HRozhaQTeQSr46JOG5U8niXQX9IsFLrgj09hrU9xY359fCiMCf48Kh9pWTSIOvwCaW kSpJGOuo6Nz9EmYOwi/lxhXIDQgPwIRC5G/jOVpJx+nuu8RJaAgwRrsKTAk409RfkVf4 nmPeE67EM88OicIdrU+XxjoCh83V4tA/ketc+fiRZP6x+UBqug/kDCtlO9AkAYH3aP5+ 88473r/VMcIqib2WJs4Hbjht0uwuUCO6Xx6FjZr3TaybY72W5a0uXcjenOuUKFvZc2ZM zEE2ybLVLz2X5ZDioIX+X2KktwSeB6fFjbgy5XxMcVhEb9mbAca5adoryNYRfdpP3/P2 7ahQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id n23-v6si398035edq.0.2018.07.02.11.30.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 11:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w62IUsGb017068 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Jul 2018 20:30:54 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w62IUsh1031512; Mon, 2 Jul 2018 20:30:54 +0200 Date: Mon, 2 Jul 2018 20:30:53 +0200 From: Henning Schild To: Cc: "Maxim Yu . Osipov" , Jan Kiszka Subject: Re: [PATCH] meta/image: allow customization of git command we use fo BUILD_ID Message-ID: <20180702203053.25cbe90e@md1pvb1c.ad001.siemens.net> In-Reply-To: <20180702181957.12054-1-henning.schild@siemens.com> References: <4cb847ca-f5ce-6765-602e-9d5263746a3f@ilbers.de> <20180702181957.12054-1-henning.schild@siemens.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: zW/XwaBZ4o5b Hi, in the previous one i wanted to start a discussion what the "correct" git describe arguments would be. But there where not too many opinions before it got merged. I talked to Jan off list and he agreed that users should be able to control it. But now that i just saw the patch on the list i realize that this is getting out of hand. I just introduced 2 variables and a new task, as interface to the user. That seems to be overkill. I will send an updated version, maybe of both patches. Henning Am Mon, 2 Jul 2018 20:19:57 +0200 schrieb Henning Schild : > One of the previous patches introduced the feature to leave some build > system information in the rootfs. The git command to derive that > information was kept pretty repository agnostic. > > This patch makes the command Isar-specific and allows users to > customize the command to their needs if they use a different tagging > scheme in their repository. > > Signed-off-by: Henning Schild > --- > meta-isar/recipes-core/images/isar-image-base.bb | 1 + > meta/classes/image.bbclass | 13 +++++++------ > 2 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/meta-isar/recipes-core/images/isar-image-base.bb > b/meta-isar/recipes-core/images/isar-image-base.bb index > c72bfdb..2ae1c01 100644 --- > a/meta-isar/recipes-core/images/isar-image-base.bb +++ > b/meta-isar/recipes-core/images/isar-image-base.bb @@ -25,6 +25,7 @@ > IMAGE_TRANSIENT_PACKAGES += "isar-cfg-localepurge" WORKDIR = > "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}" > ISAR_GIT_RELEASE_PATH ?= "${LAYERDIR_isar}" > +ISAR_GIT_RELEASE_CMD ?= "git -C ${ISAR_GIT_RELEASE_PATH} describe > --tags --dirty --match 'v[0-9].[0-9]*'" > do_rootfs[root_cleandirs] = "${IMAGE_ROOTFS} \ > ${IMAGE_ROOTFS}/isar-apt" > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index 7935b69..d60c6bb 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -36,7 +36,8 @@ def get_rootfs_size(d): > > # we assume that one git commit can describe the whole image, so you > should be # using submodules, kas, or something like that > -# set ISAR_GIT_RELEASE_PATH to that one "most significant" layer > +# set ISAR_GIT_RELEASE_PATH to that one "most significant" layer and > adjust +# ISAR_GIT_RELEASE_ARGS according to your tagging > # when not using git, override do_mark_rootfs > def get_build_id(d): > import subprocess > @@ -45,11 +46,11 @@ def get_build_id(d): > d.getVar("LAYERDIR_isar", True))): > bb.warn('You are using external layers that will not be > considered' + ' in the build_id. Considder setting > ISAR_GIT_RELEASE_PATH.') > - base = ["git", "-C", d.getVar("ISAR_GIT_RELEASE_PATH", True)] > - if (0 == subprocess.call(base + ["rev-parse"])): > - v = subprocess.check_output(base + > - ["describe", "--long", "--dirty", > - "--always"], > universal_newlines=True) > + if (0 == subprocess.call(["git", "-C", > + d.getVar("ISAR_GIT_RELEASE_PATH", > True), > + "rev-parse"])): > + cmd = d.getVar("ISAR_GIT_RELEASE_CMD", True) > + v = subprocess.check_output(cmd, shell=True, > universal_newlines=True) return v.rstrip() > return "" >