Commit 84ecced2 authored by Jan-Tarek Butt's avatar Jan-Tarek Butt

firmware-bot.sh: Fix mindeaph of find command

parent 73420729
#!/bin/sh
#!/bin/bash
# -- config --
......@@ -34,7 +34,7 @@ clean_pid() {
#Generating md5, sha1 and sha2 checksum
generate_checksum() {
find "$1" -type d | sort | while read -r dir; do
find "$1" -mindepth 1 -type d | sort | while read -r dir; do
cd "${dir}" || clean_pid 1
find . -type f | egrep gluon- | egrep -v "(*md5|*sha1|*sha2)" | sort | while read -r file; do
if ! [ -f "$file.md5" ]; then
......@@ -53,6 +53,18 @@ generate_checksum() {
done
}
#check if manifest symlink exsist
check_manifest_symlink() {
find "$1" -mindepth 1 -type d | sort | while read -r dir; do
cd "${dir}" || clean_pid 1
find . -type f | egrep ./*.manifest | while read -r manifest; do
if ! [ -f manifest ]; then
ln -s $manifest manifest
fi
done
done
}
# check code into directory out. If it already exists fetch code up to commit ID
checkout_git() {
MYGIT="git -C $1/$2"
......@@ -80,22 +92,6 @@ checkout_git() {
unset MYGIT
}
#check if manifest symlink exsist
check_manifest_symlink() {
if [ -f "$1" ] && [ -f "$2" ]; then
find "$3" -type d | sort | while read -r dir; do
cd "${dir}" || clean_pid 1
find . -type f | egrep ./*.manifest | while read -r manifest; do
if ! [ -f manifest ]; then
ln -s $manifest manifest
fi
done
done
else
clean_pid 1
fi
}
generate_checksum $FIRMWARE_DIR
# checkout gluon git
......@@ -104,7 +100,20 @@ checkout_git "/tmp" "gluon" $GLUON_GIT $GLUON_BRANCH
# checkout siteconf git
checkout_git "/tmp" "siteconf" $SITECONF_GIT "master"
check_manifest_symlink "/tmp/gluon/contrib/sigtest.sh" "/tmp/siteconf/site.conf" $FIRMWARE_DIR
check_manifest_symlink $FIRMWARE_DIR
#MANIFEST_SIGNATUR=""
#if [ -f "/tmp/gluon/contrib/sigtest.sh" ] && [ -f "/tmp/siteconf/site.conf" ]; then
# find "$FIRMWARE_DIR" -mindepth 1 -type d | sort | while read -r dir; do
# cd "${dir}" || clean_pid 1
# MANIFEST_SIGNATUR=("${dir##*/}")
# done
#else
# clean_pid 1
#fi
#echo $MANIFEST_SIGNATUR
clean_pid 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment