diff options
author | Stephane Desneux <stephane.desneux@iot.bzh> | 2019-06-19 16:16:07 +0000 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2019-06-20 14:16:37 +0000 |
commit | 8018e4a98fd6b82019939a2e107dbb89243b77c8 (patch) | |
tree | f54c504e0a51ba2789a596f368156e92034cde60 /scripts/distro-manifest-generator.sh | |
parent | a80c2f8e53139940c1e412364f058fea679ee7d2 (diff) |
distro-manifest-generator: enhance git repos detection
Following recent change 334a201 (#21619), it's now necessary to
explore the layers folder to find git repositories.
But when the build directory is a subfolder of $METADIR (repo folder),
'find' digs too deeply to find git repositories.
This patch adds some limits for 'find' to dig into subfolders:
* only find "top" git repos (no git submodules)
* limit the search depth to 2
Bug-AGL: SPEC-2450
Change-Id: Idd907737673d196cc8ba157a5c49492119efeb88
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'scripts/distro-manifest-generator.sh')
-rwxr-xr-x | scripts/distro-manifest-generator.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/distro-manifest-generator.sh b/scripts/distro-manifest-generator.sh index 7552b9942..c6f82b076 100755 --- a/scripts/distro-manifest-generator.sh +++ b/scripts/distro-manifest-generator.sh @@ -155,8 +155,8 @@ function _getgitmanifest() { local gitrepo gitrev metagitdir sep="" DIST_LAYERS="" - for metagitdir in $(find $DIST_METADIR -type d -name ".git"); do - gitrepo=$($REALPATH -Ls $metagitdir/.. --relative-to=$DIST_METADIR) + for metagitdir in $(find $DIST_METADIR -maxdepth 2 -type d -exec test -d "{}/.git" \; -print -prune); do + gitrepo=$($REALPATH -Ls $metagitdir --relative-to=$DIST_METADIR) pushd $DIST_METADIR/$gitrepo &>/dev/null && { gitrev=$( { $GIT describe --long --dirty --always 2>/dev/null || echo "unknown_revision"; } | tr ' \t' '__' ) popd &>/dev/null |