1 Commits

Author SHA1 Message Date
Andreas Müller
f62fa64eca update-recipe-checksums: Repeat update procedure as checksums were replaced
There are two cases which are enhanced:

1. A recipe contains one tarball with new checksums: After replacement the
   script fetches again so a valid tarball is available right after running
   this script.
2. A recipe contains multiple tarballs with new checksums: All checksums are
   corrected and on exit tarballs are usable immedately without further fetch.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
2020-06-10 17:09:28 +02:00

View File

@@ -35,18 +35,26 @@ fi
echo echo
echo -e "${style_bold}Run bitbake -k --runall=fetch $@...${style_normal}" echo -e "${style_bold}Run bitbake -k --runall=fetch $@...${style_normal}"
bitbake -k --runall=fetch "$@" 2>&1 | while read line; do while true; do
if echo "$line" | grep -q "was expected"; then replaced=""
# Shorten line to ensure not being confused by filenames containing spaces bitbake -k --runall=fetch "$@" 2>&1 | while read line; do
line=`echo "$line" | sed 's:.*checksum ::'` if echo "$line" | grep -q "was expected"; then
# Extract checksums # Shorten line to ensure not being confused by filenames containing spaces
newchecksum=`echo "$line" | awk '{print $1}'` line=`echo "$line" | sed 's:.*checksum ::'`
oldchecksum=`echo "$line" | awk '{print $3}'` # Extract checksums
# Lazy way: just grep for old checksums to find recipes newchecksum=`echo "$line" | awk '{print $1}'`
for recipe in `grep -rl "$oldchecksum" "${_TOPDIR}"`; do oldchecksum=`echo "$line" | awk '{print $3}'`
if [ -f "$recipe" ]; then # Lazy way: just grep for old checksums to find recipes
EvalExAuto "sed -i '"s:$oldchecksum:$newchecksum:"' "$recipe"" "Change checksum in $recipe to $newchecksum" for recipe in `grep -rl "$oldchecksum" "${_TOPDIR}"`; do
fi if [ -f "$recipe" ]; then
done replaced="1"
fi EvalExAuto "sed -i '"s:$oldchecksum:$newchecksum:"' "$recipe"" "Change checksum in $recipe to $newchecksum"
fi
done
fi
done
if [ $replaced != "1" ]
break
fi
done done