lst_utils.sh: increase search depth 3 => 4

- Increase search depth from 3 to 4 for .lst files
- Avoid unnecessary directory scanning

Story: 2009108
Task: 42968

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: Idb2204cf5c2517c5aa887dd59255eab9621e7f5f
This commit is contained in:
Davlet Panech 2021-08-17 09:03:52 -04:00
parent a24defb52d
commit 080487ff07
1 changed files with 5 additions and 6 deletions

View File

@ -46,7 +46,7 @@ merge_lst () {
return 1
fi
layer_cfgs=$(find ${MY_REPO} -maxdepth 3 -name ${cfg_name})
layer_cfgs=$(find ${MY_REPO} -maxdepth 4 -name ${cfg_name})
if [ "$layer_cfgs" == "" ]; then
echo "ERROR: merge_lst: Could not find any '${cfg_name}' files" >&2
return 1
@ -65,11 +65,10 @@ merge_lst () {
done
done
for f in $(find ${MY_REPO} -maxdepth 3 -name ${distro}_${template}; \
find ${MY_REPO} -maxdepth 3 -name ${distro}_s${template}; \
); do
grep -v '^#' $f || true
done
find ${MY_REPO} -maxdepth 4 \
\( -name ${distro}_${template} -o -name ${distro}_s${template} \) \
\! -type d \
-exec grep --no-filename -v '^#' '{}' '+'
) | sort --unique
}