From 23fedc9c415ccda66a3e0d7a5abbafd0a5fe48c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Fri, 9 Nov 2018 11:45:48 +0100 Subject: [PATCH] update-recipe-checksums.sh: rework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * replace for loop by while -> immediate response * Ask bitbake for location of recipes Signed-off-by: Andreas Müller --- scripts/update-recipe-checksums.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/scripts/update-recipe-checksums.sh b/scripts/update-recipe-checksums.sh index f46f84b..c85869f 100755 --- a/scripts/update-recipe-checksums.sh +++ b/scripts/update-recipe-checksums.sh @@ -14,19 +14,14 @@ # Includes . `dirname $0`/include/common-helpers.inc -# Do we find bitbake -if [ "x`which bitbake 2>/dev/null`" = "x" ] ; then - ErrorOut "bitbake not found! Run this script in same environment as bitbake." -fi - - -OLDIFS=$IFS -IFS=$'\n' +# Ask bitbake for recipe directory +GetBitbakeEnvVar "TOPDIR" +_TOPDIR="$BitbakeEnvVar" echo -echo -e "${style_bold}Run bitbake -k ${1}...${style_normal}" +echo -e "${style_bold}Run bitbake -k --runall=fetch ${1}...${style_normal}" -for line in `bitbake -k $1 2>&1`; do +bitbake -k --runall=fetch $1 2>&1 | while read line; do if echo "$line" | grep -q "was expected"; then # Shorten line to ensure not being confused by filenames containing spaces line=`echo "$line" | sed 's:.*checksum ::'` @@ -34,12 +29,10 @@ for line in `bitbake -k $1 2>&1`; do newchecksum=`echo "$line" | awk '{print $1}'` oldchecksum=`echo "$line" | awk '{print $3}'` # Lazy way: just grep for old checksums to find recipes - for recipe in `grep -rl "$oldchecksum" "$OE_SOURCE_DIR"`; do + for recipe in `grep -rl "$oldchecksum" "${_TOPDIR}"`; do if [ -f "$recipe" ]; then EvalExAuto "sed -i '"s:$oldchecksum:$newchecksum:"' "$recipe"" "Change checksum in $recipe to $newchecksum" fi done fi done -IFS=$OLDIFS -