[yocto-autobuilder-helper][dunfell 5/6] publish-artefacts: Improve sha256 checksum handling


Steve Sakoman
 

From: "Tummalapalli, Vineela" <vineela.tummalapalli@intel.com>

The existing checksum files were encoding full paths. This patch changes
this to use just the filename which allows relocation of the directories
and is more appropriate for sharing over http.

Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 835ac325a4ed3e421a5a9bfd7c75f552ae2103cf)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
scripts/publish-artefacts | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/scripts/publish-artefacts b/scripts/publish-artefacts
index e773350..6ed922a 100755
--- a/scripts/publish-artefacts
+++ b/scripts/publish-artefacts
@@ -5,10 +5,14 @@ target=$3

sha256sums(){
dest=$1
- for x in `find $dest -maxdepth 5 -type f`; do
- if [ ${x##*.} != sha256sum ]; then
- sha256sum $x >> $x.sha256sum
- fi
+ for x in `find -L $dest -maxdepth 5 -type f`; do
+ for w in $x;do
+ if [ ${w##*.} != sha256sum ]; then
+ shasum=`sha256sum $w | awk '{print $1}'`
+ filename=${w##*/}
+ echo $shasum $filename >> $w.sha256sum
+ fi
+ done
done
}

--
2.17.1

Join yocto@lists.yoctoproject.org to automatically receive all group messages.