File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,15 +416,15 @@ define define_module =
416416 # XXX: "git clean -dffx" is a hack for coreboot during commit switching, need
417417 # module-specific cleanup action to get rid of it.
418418 $(build ) /$($1_base_dir ) /.canary: FORCE
419- if [ ! -e "$$@ " ]; then \
420- echo "INFO: .canary file not found. Cloning repository $($1_repo ) into $(build ) /$($1_base_dir ) " && \
419+ if [ ! -e "$$@ " ] && [ ! -d " $( build ) / $( $1_base_dir ) " ] ; then \
420+ echo "INFO: .canary file and directory not found. Cloning repository $($1_repo ) into $(build ) /$($1_base_dir ) " && \
421421 git clone $($1_repo ) "$(build ) /$($1_base_dir ) " && \
422422 echo "INFO: Resetting repository to commit $($1_commit_hash ) " && \
423423 git -C "$(build ) /$($1_base_dir ) " reset --hard $($1_commit_hash ) && \
424424 echo "INFO: Creating .canary file with repo and commit hash" && \
425425 echo -n '$($1_repo ) |$($1_commit_hash ) ' > "$$@ " ; \
426- elif [ "$$$$(cat "$$@ " ) " != '$($1_repo ) |$($1_commit_hash ) ' ]; then \
427- echo "INFO: Canary file differs. Switching $1 to $($1_repo ) at $($1_commit_hash ) " && \
426+ elif [ ! -e " $$@ " ] || [ "$$$$(cat "$$@ " ) " != '$($1_repo ) |$($1_commit_hash ) ' ]; then \
427+ echo "INFO: .canary file missing or differs. Resetting $1 to $($1_repo ) at $($1_commit_hash ) " && \
428428 git -C "$(build ) /$($1_base_dir ) " reset --hard HEAD^ && \
429429 echo "INFO: Fetching commit $($1_commit_hash ) from $($1_repo ) (without recursing submodules)" && \
430430 git -C "$(build ) /$($1_base_dir ) " fetch $($1_repo ) $($1_commit_hash ) --recurse-submodules=no && \
You can’t perform that action at this time.
0 commit comments