coreboot/util/scripts
Yidi Lin c4eb645a0b update_submodules: Fix submodule path handling
There are two regressions introduced by CB:87823.

1. If the specified repo path has a tailing slash, `submodule` becames a
   empty variable due to `${submodule##*/}`, e.g.,

   `./util/scripts/update_submodules -R 3rdparty/arm-trusted-firmware/`

2. CB:87823 uses `git submodule status | cut -d ' ' -f 3` to retrieve
   all submodule paths. The script gets the wrong path if the format is
   wrong, e.g.,

-26c572974bcf7255930b0e9a51da3144ed0104b5 3rdparty/amd_blobs
 57ac3f74b34a3303f03deee264a1f2247c68008d 3rdparty/arm-trusted-firmware (v2.12.0-908-g57ac3f74b)
+5b7492979fc139efdfdc7f97ae53a2349798f160 3rdparty/cmocka (cmocka-1.1.5-263-g5b74929)

   The script gets the empty path for 3rdparty/amd_blobs and get
   cmocka-1.1.5-263-g5b74929 for 3rdparty/cmocka.

This patch fixes 1 by removing the tailing slash for the input directory
and fixes 2 by the below command.
   `git submodule foreach 'echo ${sm_path}'|grep -v Entering`

Note that `smp_path` is an environment variable[1] set by
`git submodule` when travelling the submodule directory.

[1]: https://git-scm.com/docs/git-submodule

Change-Id: I0016f3a867e2b4594788d71a790ff9a938121da5
Signed-off-by: Yidi Lin <yidilin@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87972
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2025-06-06 13:26:30 +00:00
..
capture_commands.sh util/scripts: Add script to capture commands from build 2024-08-28 17:14:28 +00:00
config Treewide: Fix incorrect SPDX license strings 2024-02-18 01:55:57 +00:00
cross-repo-cherrypick cross-repo-cherrypick: Update downstream branch 2023-11-20 07:40:11 +00:00
decode_spd.sh util: Update all shebangs to use /usr/bin/env 2021-01-25 08:57:40 +00:00
description.md util/scripts: Add script to capture commands from build 2024-08-28 17:14:28 +00:00
dts-to-fmd.sh
find-unused-kconfig-symbols.sh util: Update all shebangs to use /usr/bin/env 2021-01-25 08:57:40 +00:00
find_new_user_commits.sh util/scripts: Add a script to find new users' commits on gerrit 2023-10-16 18:53:26 +00:00
gerrit-rebase
get_maintainer.pl
maintainers.go maintainers.go: Work around common mistake in MAINTAINERS 2021-04-14 12:18:58 +00:00
no-fsf-addresses.sh util: Update all shebangs to use /usr/bin/env 2021-01-25 08:57:40 +00:00
parse-maintainers.pl Treewide: Fix incorrect SPDX license strings 2024-02-18 01:55:57 +00:00
prepare-commit-msg.clang-format
rm_unused_code src, util: Clean up makefile.inc in text, help & comments 2024-01-26 20:15:18 +00:00
show_platforms.sh util/scripts/show_platforms.sh: Fix reStructuredText table output 2023-05-11 16:53:23 +00:00
testsoc util/scripts/testsoc: Pass arguments to abuild 2023-02-05 00:51:38 +00:00
ucode_h_to_bin.sh
update_submodules update_submodules: Fix submodule path handling 2025-06-06 13:26:30 +00:00