Merge pull request #266 from SuperQ/fix_complete_file_order

Fix build_complete_file in get_sources
This commit is contained in:
Thomas Pöchtrager 2021-03-23 19:38:42 +01:00 committed by GitHub
commit 61925a29c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -357,39 +357,40 @@ function build_msg()
function get_sources() function get_sources()
{ {
local url=$1 local url="$1"
local branch=$2 local branch="$2"
local project_name=$3 local project_name="$3"
local build_complete_file="$BUILD_DIR/.${project_name}_build_complete" local build_complete_file
if [ -z "$project_name" ]; then if [[ -z "${project_name}" ]]; then
project_name=$(get_project_name_from_url $url) project_name=$(get_project_name_from_url "${url}")
fi fi
build_complete_file="${BUILD_DIR}/.${project_name}_build_complete"
CURRENT_BUILD_PROJECT_NAME=$project_name CURRENT_BUILD_PROJECT_NAME="${project_name}"
build_msg $project_name $branch build_msg "${project_name}" "${branch}"
if [[ "$SKIP_BUILD" == *$project_name* ]]; then if [[ "${SKIP_BUILD}" == *${project_name}* ]]; then
f_res=0 f_res=0
return return
fi fi
git_clone_repository $url $branch $project_name git_clone_repository "${url}" "${branch}" "${project_name}"
if [ $f_res -eq 1 ]; then if [[ $f_res -eq 1 ]]; then
rm -f $build_complete_file rm -f "${build_complete_file}"
f_res=1 f_res=1
else else
# nothing has changed upstream # nothing has changed upstream
if [ -f $build_complete_file ]; then if [[ -f "${build_complete_file}" ]]; then
echo "" echo ""
echo "## Nothing to do ##" echo "## Nothing to do ##"
echo "" echo ""
f_res=0 f_res=0
else else
rm -f $build_complete_file rm -f "${build_complete_file}"
f_res=1 f_res=1
fi fi
fi fi