From 080487ff072c17d86dee7db64b4c0dfd34f9aea7 Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Tue, 17 Aug 2021 09:03:52 -0400 Subject: [PATCH] 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 Change-Id: Idb2204cf5c2517c5aa887dd59255eab9621e7f5f --- toCOPY/lst_utils.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/toCOPY/lst_utils.sh b/toCOPY/lst_utils.sh index e6a7aee3..68767af4 100644 --- a/toCOPY/lst_utils.sh +++ b/toCOPY/lst_utils.sh @@ -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 }