All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 03/19] externalsrc: Detect code changes in submodules
Date: Fri, 23 Apr 2021 03:58:45 -1000	[thread overview]
Message-ID: <d621b7c0ce0a99035de7e503596a3e36dc44b76f.1619186107.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1619186107.git.steve@sakoman.com>

From: Douglas Royds <douglas.royds@taitradio.com>

Further to 50ff9afb39, only detect code changes in submodules that are
subdirectories of the EXTERNALSRC directory.

The (undocumented) git submodule--helper returns a path
for each submodule relative to the top of the repo.
Don't add submodules that are not within our source subtree.

[YOCTO #14333]

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1c18225d3ef94a41fc073ae87c163b68e6d46571)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/externalsrc.bbclass | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 1d7300d65b..c7fcdca6ef 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -219,11 +219,12 @@ def srctree_hash_files(d, srcdir=None):
             submodule_helper = subprocess.check_output(['git', 'submodule--helper', 'list'], cwd=s_dir, env=env).decode("utf-8")
             for line in submodule_helper.splitlines():
                 module_dir = os.path.join(s_dir, line.rsplit(maxsplit=1)[1])
-                proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
-                proc.communicate()
-                proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
-                stdout, _ = proc.communicate()
-                git_sha1 += stdout.decode("utf-8")
+                if os.path.isdir(module_dir):
+                    proc = subprocess.Popen(['git', 'add', '-A', '.'], cwd=module_dir, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+                    proc.communicate()
+                    proc = subprocess.Popen(['git', 'write-tree'], cwd=module_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
+                    stdout, _ = proc.communicate()
+                    git_sha1 += stdout.decode("utf-8")
             sha1 = hashlib.sha1(git_sha1.encode("utf-8")).hexdigest()
         with open(oe_hash_file, 'w') as fobj:
             fobj.write(sha1)
-- 
2.25.1


  parent reply	other threads:[~2021-04-23 14:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 13:58 [OE-core][dunfell 00/19] Patch review Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 01/19] wpa-supplicant: fix CVE-2021-30004 Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 02/19] Revert "externalsrc: Detect code changes in submodules" Steve Sakoman
2021-04-23 13:58 ` Steve Sakoman [this message]
2021-04-23 13:58 ` [OE-core][dunfell 04/19] oeqa/selftest: Hardcode test assumptions about heartbeat event timings Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 05/19] oeqa/selftest: Ensure packages classes are set correctly for maintainers test Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 06/19] insane: clean up some more warning messages Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 07/19] sanity: Add error check for '%' in build path Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 08/19] sanity: Further improve directory sanity tests Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 09/19] lib/oe/terminal: Fix tmux new-session on older tmux versions (<1.9) Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 10/19] pseudo: Upgrade to add trailing slashes ignore path fix Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 11/19] kmod: do not symlink config.guess/config.sub during autoreconf Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 12/19] libtool: make sure autoheader run before automake Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 13/19] groff: not ship /usr/bin/grap2graph Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 14/19] parselogs: ignore floppy error on qemu-system-x86 at boot stage Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 15/19] ca-certificates: Fix openssl runtime cert dependencies Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 16/19] linux-yocto/5.4: update to v5.4.109 Steve Sakoman
2021-04-23 13:58 ` [OE-core][dunfell 17/19] linux-yocto/5.4: update to v5.4.111 Steve Sakoman
2021-04-23 13:59 ` [OE-core][dunfell 18/19] linux-yocto/5.4: update to v5.4.112 Steve Sakoman
2021-04-23 13:59 ` [OE-core][dunfell 19/19] linux-yocto/5.4: fix arm defconfig warnings Steve Sakoman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d621b7c0ce0a99035de7e503596a3e36dc44b76f.1619186107.git.steve@sakoman.com \
    --to=steve@sakoman.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.