Fix docker images rebuilt issue when building each host image (#5925)

* Change back the mtime changed by applying patch

* Fix bug

* Fix bug

* Use the grep or pattern instead to call a new grep command
This commit is contained in:
xumia 2020-11-24 21:45:06 +08:00 committed by GitHub
parent 962e838b16
commit 98d749128a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -558,8 +558,10 @@ ALL_DEP_FILES_LIST += $(foreach pkg,$(2), $($(filter none,$($(1)_CACHE_MODE)), \
$(addsuffix .$(3),$(addprefix $(2)/, $(1))) : $(2)/%.$(3) : \
$(2)/%.flags $$$$($$$$*_DEP_FILES) $$$$(if $$$$($$$$*_SMDEP_FILES), $(2)/%.smdep)
@$$(eval $$*_DEP_FILES_MODIFIED := $$? )
@$$(file >$$@,$$($$*_DEP_FILES))
@cat $$@ |xargs git hash-object >$$@.sha
@$$(file >$$@.tmp,$$($$*_DEP_FILES))
@cat $$@.tmp |xargs git hash-object >$$@.sha.tmp
@if ! cmp -s $$@.sha.tmp $$@.sha; then cp $$@.tmp $$@; cp $$@.sha.tmp $$@.sha; fi
@rm -f $$@.tmp $$@.sha.tmp
@$$(if $$(MDEBUG), $$(info DEP: $$@, MOD:$$?))
endef
$(eval $(call SHA_DEP_RULES, $(SONIC_MAKE_DEBS) $(SONIC_DPKG_DEBS) $(SONIC_ONLINE_DEBS) $(SONIC_COPY_DEBS), $(DEBS_PATH),dep))

View File

@ -5,7 +5,7 @@ DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/sai.mk platform/broa
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
# Get the Latest HTTP Header and calculate the SHA value as it is a softlink that always points to LATEST_INT_OCP_SAI_X.X.X
SAI_FLAGS := $(shell wget --spider --server-response $($(BRCM_SAI)_URL) $($(BRCM_SAI_DEV)_URL) 2>&1 \
| grep -Ev -- '--|Date:'|sha256sum|awk '{print $$1}' )
| grep -Ev -- '--|Date:|x-ms-request-id'|sha256sum|awk '{print $$1}' )
$(BRCM_SAI)_CACHE_MODE := GIT_CONTENT_SHA
$(BRCM_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(SAI_FLAGS)

View File

@ -12,7 +12,6 @@ $(SONIC_CONFIG_ENGINE_PY2)_DEP_FILES := $(DEP_FILES)
# SONIC_CONFIG_ENGINE_PY3 package
SPATH := $($(SONIC_CONFIG_ENGINE_PY3)_SRC_PATH)
DEP_FILES += $(shell git ls-files $(SPATH))
$(SONIC_CONFIG_ENGINE_PY3)_CACHE_MODE := GIT_CONTENT_SHA
$(SONIC_CONFIG_ENGINE_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)