8211016: make images does not update jdk/lib/src.zip with latest changes
authorerikj
Tue, 19 Feb 2019 12:43:10 -0800
changeset 53829 56dc0b27536c
parent 53828 9c44ab24b4a4
child 53830 e403ff78116c
8211016: make images does not update jdk/lib/src.zip with latest changes Reviewed-by: ihse
make/common/MakeBase.gmk
make/common/ZipArchive.gmk
--- a/make/common/MakeBase.gmk	Tue Feb 19 12:40:44 2019 -0800
+++ b/make/common/MakeBase.gmk	Tue Feb 19 12:43:10 2019 -0800
@@ -392,9 +392,10 @@
   #
   # Param 1 - Dirs to find in
   # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
+  # Param 3 - (optional) options to find.
   define CacheFind
     $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
-      $(if $(wildcard $1), $(shell $(FIND) $(wildcard $1) \( -type f -o -type l \) $2 \
+      $(if $(wildcard $1), $(shell $(FIND) $3 $(wildcard $1) \( -type f -o -type l \) $2 \
           | $(TR) ' ' '?')), \
       $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
   endef
--- a/make/common/ZipArchive.gmk	Tue Feb 19 12:40:44 2019 -0800
+++ b/make/common/ZipArchive.gmk	Tue Feb 19 12:43:10 2019 -0800
@@ -62,8 +62,9 @@
     $1_FIND_LIST := $$($1_SRC)
   endif
 
-  # Find all files in the source tree.
-  $1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST)))
+  # Find all files in the source tree. Follow symlinks in this find since that is
+  # what zip does.
+  $1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST), , -L))
 
   # Filter on suffixes if set
   ifneq ($$($1_SUFFIXES),)
@@ -126,10 +127,14 @@
   $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
 	$$(call LogWarn, Updating $$($1_NAME))
 	$$(call MakeTargetDir)
-	$$(foreach s,$$($1_SRC),(cd $$s && $(ZIPEXE) -qru $$($1_ZIP_OPTIONS) $$@ . \
-	    $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* \
-	    $$($1_ZIP_EXCLUDES_$$s) \
-	    || test "$$$$?" = "12" )$$(NEWLINE)) true
+	$$(foreach s,$$($1_SRC), $$(call ExecuteWithLog, \
+	    $$(SUPPORT_OUTPUTDIR)/zip/$$(patsubst $$(OUTPUTDIR)/%,%, $$@), \
+	    (cd $$s && $(ZIPEXE) -qru $$($1_ZIP_OPTIONS) $$@ . \
+	        $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* \
+	        $$($1_ZIP_EXCLUDES_$$s) \
+	        || test "$$$$?" = "12" \
+	    ))$$(NEWLINE) \
+	) true \
 	$(TOUCH) $$@
 
   # Add zip to target list