update-recipe-checksums.sh: rework

* replace for loop by while -> immediate response
* Ask bitbake for location of recipes

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Andreas Müller
2018-11-09 11:45:48 +01:00
parent c218f591ad
commit 23fedc9c41

View File

@@ -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