From patchwork Mon Mar 9 14:12:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 82905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58D5FF3C269 for ; Mon, 9 Mar 2026 14:12:47 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.15118.1773065563899733779 for ; Mon, 09 Mar 2026 07:12:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UhH6Mq+y; spf=pass (domain: gmail.com, ip: 209.85.221.50, mailfrom: alex.kanavin@gmail.com) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-439c6fc2910so3928727f8f.0 for ; Mon, 09 Mar 2026 07:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773065562; x=1773670362; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9OpLINlxeB0uaBbWfimSlgPUORd7YPui3mqQdkdIro8=; b=UhH6Mq+yRMVGAADlFJpO/NYSCmD2atsyteoGZyeWoYYWDVjngyT+6DcdvLQzb6wQg0 9MCGzC39YiC8jvsZFzY7coxv3yI3A8qRUkVCosJV4U1+YEC9vbul/jxaHjlPlOc0woTQ lw8KPJAPSm2QLYdKv61cRQcJh619mvYmQyZkdWiVX9yXolyJ757ysDgUpKqcfX6ht73k 1/I8/10cLVravJ8HQe2DLcGzvTH40w3LJS4B3BqRWmizTTdWOylWR0x/MvLrBrpmw2nO 81gstsFL4CipmBiPF60Sy3oFMX/zjeBcnSwB5YcLAU0PSn/6qB5h6+OU4xsfszXSAhtK NChw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773065562; x=1773670362; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9OpLINlxeB0uaBbWfimSlgPUORd7YPui3mqQdkdIro8=; b=xSGLBOHn+rUIbV9uFhg8fabI6MXIiKKYKPIUNcl4CjpZpyZzO0eGbydecBBXG/Bid5 YBI370r7ylIs9WJyT6+vvWEyQzx+4X4UmdC5KaXNk2O08bxUpxmG09X+4AfbFJelGCl2 qar/UOZH4fDMbMV7QuGQP0vI2elJMqQe7jCkrP443syJ9hd0NMlpFkfHwpqS4ESpFBgc 8j7qivvyraNEW3mKZ25UYY8KRTIRDm+aFPWPwXR1ZdOQU44CN5NM7O6NcFqblhYTqUBW 6uDab+SydlUX7UVSIcZ3XSxRxyve9N+d30NJqwlPZF4QfffyLrlxXQH2FraHQGeRQ+0X c+Wg== X-Gm-Message-State: AOJu0YxXJTO9rUV26SSjVnjgQv9VBi/CrbVMZZqnzB+7iVZ/YWL1nXcR QGq0ZUfhA8iQrpO4I8bEk4KxqfRNHhFMqMuoH/+Ci7+fgsnZRKhxiJ0ppZ4dtg== X-Gm-Gg: ATEYQzxnpqiQpvOGh6mWVjrbS9/6gpnpd1D44mLhuMo71b4IeeOo10ugaY9G5sAHCJ4 1zDIHcFgVATT1sGcNgV4HBWn01xTGfVegTHIjk59eu9K/FKjpbgEVIPu0OGbgP2apOgIskSN/yQ D3Lynp5+P5Bz1Xgai0mOlG7GJD32SlVxy0klSaX059hLMSHgTGs/9U6yDtpGPs+Qrzyf+03wZXL SbBy+u7mAklYatVIZHhb2y7OO2ex7VxUyKFe4ZbTaBDM7I9o6T227TT2UgYRi7eMKY7U7erDk2t Ut3h1uemSnuB5T5WJFQ0YarUJMmg7rUl6tQEXQcPEG38KkD8k63LFFuOTJHQ55d1ZzlUAhF1H1N 1hHfYZILOPURf1uE7sCK5pWoOrsou0v2AQ14/40s8RZibZQZ5WXYq7bs0LJurc1RrV5JBbUf+jM 2Tj56XXmdgrXuzW1THnYEXx/ZwLrCYpNoNquQWCiwFCo/jmBL7TvS0zF+SAcY= X-Received: by 2002:a05:6000:2884:b0:439:cbc2:63b with SMTP id ffacd0b85a97d-439da6693eamr20475637f8f.29.1773065561698; Mon, 09 Mar 2026 07:12:41 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439dad8d973sm25443458f8f.3.2026.03.09.07.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 07:12:41 -0700 (PDT) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 1/3] bitbake-setup: ensure that config_id is always an absolute path Date: Mon, 9 Mar 2026 15:12:36 +0100 Message-ID: <20260309141238.1785102-1-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 09 Mar 2026 14:12:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19124 From: Alexander Kanavin If config_id (given on command line in 'init' operation) is provided and interpreted as a relative path to a local file (by checking for the file existence), it should be recorded into configuration instance as an absolute path. Otherwise status/update operations will fail if executed from a different directory that the template file was in, as they won't be able to find the file. Note that the patch context doesn't show where having the absolute path actually matters: further down in the function, config_id is used to set a 'non-interactive-cmdline-options' property in configuration instance dictionary. This property is used by status/update operations. Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index bdf134aea..54f2015a2 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -600,9 +600,10 @@ def obtain_config(top_dir, registry, args, source_overrides, d): config_id = args.config[0] config_parameters = args.config[1:] if os.path.exists(config_id): + config_id = os.path.abspath(config_id) logger.info("Reading configuration from local file\n {}".format(config_id)) upstream_config = {'type':'local', - 'path':os.path.abspath(config_id), + 'path':config_id, 'name':get_config_name(config_id), 'data':json.load(open(config_id)) } From patchwork Mon Mar 9 14:12:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 82907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACFF7F3C26E for ; Mon, 9 Mar 2026 14:12:47 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.15234.1773065564647504572 for ; Mon, 09 Mar 2026 07:12:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MT0QdBoj; spf=pass (domain: gmail.com, ip: 209.85.128.42, mailfrom: alex.kanavin@gmail.com) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4853c1ca73aso7748885e9.2 for ; Mon, 09 Mar 2026 07:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773065563; x=1773670363; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UAy3nmQE5PuWfBeQVBJnLnSRjiZ/1N4PeiBcKGGzkLI=; b=MT0QdBojaCtF0B7tK6oYIIjNobnJEpCkVROVA+siwoT0Eh/+kKri2OBRFP3lqBVuLT nmhU+CPG56hyBtwBasMsne+IGOLoBPrNaDKqboAdhXLFk+bf3nzF14MIjdo9aXtS9SSg gkyFzJ5H4bFty7S1oqOUZZnqaKHLdHC7caELxNKrXwOrARJ5bEERvAvkETN9S4ROaOdg NZGOUta4a+6QW0MfmJKy/fLWtK7IrOEOtHRw7z5fxSNqbMZQh5C8xZqLHl+M/E2GIL80 cBh+YlzxiSqHdXAYuQhzN4Ozj8feffngR1MiZWFi57Wv8k+I8UZGY+1FYsx7jNJxKG6C tkMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773065563; x=1773670363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UAy3nmQE5PuWfBeQVBJnLnSRjiZ/1N4PeiBcKGGzkLI=; b=aWCQ3j5iSDJmCZ4h0zTo+9CVjkftKiKMzvh5YcYhxYXjmB/v3A4Va/XbHWN3NHs8Hg L1VlMMcz//mUYdoAklpA/VdTeFbndHYf4kG6rW8DuKNZvkuhs0KTwaQ7caDeqv8lhTg6 JSkFSF9gWl/P7iR5BVUNlbNCM1aDKmVOrQ96vOyJ04IsqaGAd1tK9eCGI4ciMPkbsB91 lo7nkKN0vzPAQyx3lhu+GRwjTl+1xbR8Tu/GQRwCMUnjtI+72XazCP8ph9sR6wWr4S5c S1zyiqlKkD/40/v2N5L3qYJLrkJDnUrIrRH63nlcteUwc3WNbyjjk/xBVzO1BF4EiIh7 Scuw== X-Gm-Message-State: AOJu0YwQ87fuQ1uGLc33oL2UxzXOMqdFkdmNZsy/B4x0TdD87XbuFlRQ 77aMszs5F1b8cuzfjPvVN+H0GQmXDynQwsHt3NX/5OwoyrJczj4+2apgeQ8L3g== X-Gm-Gg: ATEYQzyE58QjtlYKShJdmEQKwdsHmktvvlkkMv9CGAAJxwrPLwtaI5nmT/O9RzBfimW Vlv+m9Vl0sLUUpUjV7cARRwfOQ4WjSgWEtsx/0oaGyOLopyDSSF3bAFgSaigthUGVhhVWiigp9U P217eSq1hTkY34yViemP6SZM9jFKZJqKNpV/fwLHnjFpSwQfBF2XrKNVzGH8pju07aLbjsSnfzQ sFNr5sXmex5tYrOKziEr6qYaPm3YFbU2glQQOLXF1mnEy5sbOUTTv16TV3erKI0V2d0JUTXaqnI 9DO8xLC7XX1OeyHSObd68C/nvE60TsSz+42pa+pomV3620J/J8Fa3X/j0haw9Y3PG3bjXLF3+hW w5/280CyxLgElvO7mHb0cfYNWchtth/5i4KbClnWe2fu87KjRZPvkfQFNYjipcpVL1S0LTYMCGq G4GQHl9ogPKyw2EUhG7EiMAwZP4azgFJ3Du17SbmAdWjWLYJqOk+nrjLDz18g= X-Received: by 2002:a05:6000:400e:b0:439:b0ed:2afe with SMTP id ffacd0b85a97d-439da348192mr17895753f8f.11.1773065562594; Mon, 09 Mar 2026 07:12:42 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439dad8d973sm25443458f8f.3.2026.03.09.07.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 07:12:42 -0700 (PDT) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 2/3] bitbake-setup: are_layers_changed(): calculate local_revision only once Date: Mon, 9 Mar 2026 15:12:37 +0100 Message-ID: <20260309141238.1785102-2-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260309141238.1785102-1-alex.kanavin@gmail.com> References: <20260309141238.1785102-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 09 Mar 2026 14:12:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19125 From: Alexander Kanavin There's no need to repeatedly do it in the loop, as it doesn't change. Also reposition 'remotes' and 'changed' variables assignments, as this will aid the code readability after the following commit. Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 54f2015a2..19a6b5373 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -742,12 +742,14 @@ def get_diff(file1, file2): def are_layers_changed(layers, layerdir, d): def _is_git_remote_changed(r_remote, repodir): - changed = False rev = r_remote['rev'] branch = r_remote.get('branch', None) - remotes = _get_remotes(r_remote) + rev_parse_result = bb.process.run('git -C {} rev-parse HEAD'.format(os.path.join(layerdir, repodir))) + local_revision = rev_parse_result[0].strip() + remotes = _get_remotes(r_remote) + changed = False for remote in remotes: type,host,path,user,pswd,params = bb.fetch.decodeurl(remote) fetchuri = bb.fetch.encodeurl(('git',host,path,user,pswd,params)) @@ -756,8 +758,6 @@ def are_layers_changed(layers, layerdir, d): else: fetcher = bb.fetch.FetchData("{};protocol={};rev={};nobranch=1;destsuffix={}".format(fetchuri,type,rev,repodir), d) upstream_revision = fetcher.method.latest_revision(fetcher, d, 'default') - rev_parse_result = bb.process.run('git -C {} rev-parse HEAD'.format(os.path.join(layerdir, repodir))) - local_revision = rev_parse_result[0].strip() if upstream_revision != local_revision: changed = True logger.info('Layer repository {} checked out into {} updated revision {} from {} to {}'.format(remote, os.path.join(layerdir, repodir), rev, local_revision, upstream_revision)) From patchwork Mon Mar 9 14:12:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 82906 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57B73F3C26B for ; Mon, 9 Mar 2026 14:12:47 +0000 (UTC) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.15119.1773065565282856549 for ; Mon, 09 Mar 2026 07:12:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RGCM+orR; spf=pass (domain: gmail.com, ip: 209.85.221.47, mailfrom: alex.kanavin@gmail.com) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-439b94a19fdso7501123f8f.0 for ; Mon, 09 Mar 2026 07:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773065564; x=1773670364; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=62vl2fSzjILu+ZTt2A0fS7ZlROKw9XyWE0/cTtQ+QXE=; b=RGCM+orRI9YohFLOnwTUks23JXuIkSDpqb6gibFL5sXNKrOyILj7kV88wQEjMMyIFu wyu/9MOoOt3Up0RoaGqt9EfxbMcTwirbvLVUxRruzliplQBLm3mUBhbmaC55rxnfoG+Z VerxhgJmumFhU3SNTsjDMOvgIDI/Ivy9b16NbIblFm/rJGpCI/0ADo1JbWAuwDmXj4Vb bHTDx2Awd4zykRo6/HzObj8pCtAxl3f0Q9FMjSj+OS0c0E6l4pEvj/u+gx9D77VZUbZ9 Nb53+U/XDmibRSmbLumgfqp+9lYzRkiyKyGnhrNSeBOy52tmCaw57Y5g+zjZdZM/q3sR V5wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773065564; x=1773670364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=62vl2fSzjILu+ZTt2A0fS7ZlROKw9XyWE0/cTtQ+QXE=; b=koulpn7VNMxmdz5lcUZvzbn00pVjMnYLVmvkRUmaxMJ+TeL48VUYDdeQ5KIeySFFgQ +eGjfcqtVodFGgQqd8BVZfKaOBeN7N1GJIuc8/vZUlc9h0HF8ADDyQw5qrTkv6xKLV0A 8jl4n1OlM0cGBr3s2JVmTlKswvIoaZ//mZlXaXtLqvbDNcZAlbsWsqRuR6NB4Y0HoI9G fTr+y9G3eAsYUt3KQsfWaR80ZpGXOf/EYUFDCbPlqBcmaFBEVRRHggW0tLHUe2C5GuyW ynzF06tzPmuZDc6Ycl/O2fSCuO1xGjOWUPN4FuDvaKPDHwu0nNxY5fgsQ5ERGBGTO+Jd C3EQ== X-Gm-Message-State: AOJu0YyVixL1r6Y7t58JsdOQmGvlaKBmuF2Ps43CAR4MxevgqiNxBdAG 1vd6dYunS0tn2KRmNHAGfgQQDn1qCr/4ZZZU+3wzX/soHSGPy4Z3O3phhOGZ9g== X-Gm-Gg: ATEYQzwHY++1cwJ0RHDC37LDd3oXLWun35vt7gRh9so6JCApVH7fjjbSTd5YInnqlk8 RxXQO6a0p2VCq7zNFSJ/Gss3qowxdZEYEdaS3omvQfVknE6v50HVtQ57MoIEzXoE2OIyn04rOO3 Cbi3J8U1xXP4ZAKXiuQx08GqK3XXiTnlEbvMNJ6snFzhqfTph1gtIQ/IfnUm/ex3OFTCScPj//q Amq0/4lsuggCBJwkwDW6jBD73i+XMg7zmTX0igd8b+XWXm3DDwloRzFu50cI8BhaC3fxirxV7ae inLMaxr5qY7rnYbB7AYPCHNORBTGSbgoV0H2/QjcKbQVstxKwc7KLq687ZID1TF76C33koRinzQ R0IquU8pTz1CoTEW5Dcd5oouL0+1Nu8N46SqfCp/nDjt3p80B2ujRis4pqTx36pz+SzkQXhKTHN 0EjbKhvka5C+uWOJjEh1vsUzAAoK9qZ4VT2JDrMh2mSqf8l21VpriW7ZTumrY= X-Received: by 2002:a05:6000:24c7:b0:439:c5cf:fc73 with SMTP id ffacd0b85a97d-439da654252mr18650195f8f.12.1773065563381; Mon, 09 Mar 2026 07:12:43 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439dad8d973sm25443458f8f.3.2026.03.09.07.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 07:12:42 -0700 (PDT) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH v2 3/3] bitbake-setup: correctly determine latest revision in status/update when it is fixed to a commit id Date: Mon, 9 Mar 2026 15:12:38 +0100 Message-ID: <20260309141238.1785102-3-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260309141238.1785102-1-alex.kanavin@gmail.com> References: <20260309141238.1785102-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 09 Mar 2026 14:12:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19126 From: Alexander Kanavin The code was relying on git fetcher's latest_revision() method, which works properly if the revision in the json config template is set to a branch or a tag, but does not work if it is set to a fixed revision (the method will return the latest revision on the respective branch, and bitbake-setup will incorrectly determine that the layer needs to be updated to that revision). Add a guard to check if the revision is a fixed commit id, and do a direct revision comparison if so, skipping the fetcher query. [YOCTO #16190] Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 19a6b5373..ca4461b1e 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -742,11 +742,18 @@ def get_diff(file1, file2): def are_layers_changed(layers, layerdir, d): def _is_git_remote_changed(r_remote, repodir): + from bb.fetch2.git import sha1_re + rev = r_remote['rev'] branch = r_remote.get('branch', None) rev_parse_result = bb.process.run('git -C {} rev-parse HEAD'.format(os.path.join(layerdir, repodir))) local_revision = rev_parse_result[0].strip() + if sha1_re.match(rev): + if rev != local_revision: + logger.info('Layer repository checked out into {} is at revision {} but should be at {}'.format(os.path.join(layerdir, repodir),local_revision, rev)) + return True + return False remotes = _get_remotes(r_remote) changed = False