File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -416,15 +416,15 @@ define define_module =
416
416
# XXX: "git clean -dffx" is a hack for coreboot during commit switching, need
417
417
# module-specific cleanup action to get rid of it.
418
418
$(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 ) " && \
421
421
git clone $($1_repo ) "$(build ) /$($1_base_dir ) " && \
422
422
echo "INFO: Resetting repository to commit $($1_commit_hash ) " && \
423
423
git -C "$(build ) /$($1_base_dir ) " reset --hard $($1_commit_hash ) && \
424
424
echo "INFO: Creating .canary file with repo and commit hash" && \
425
425
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 ) " && \
428
428
git -C "$(build ) /$($1_base_dir ) " reset --hard HEAD^ && \
429
429
echo "INFO: Fetching commit $($1_commit_hash ) from $($1_repo ) (without recursing submodules)" && \
430
430
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