bug 1280683, keep a pristine copy of en-US installer for repacks, r=glandium
authorAxel Hecht <axel@pike.org>
Wed, 23 Nov 2016 22:19:19 +0100
changeset 324856 2747398601801bc3b7371db820443c5b36726097
parent 324855 176260cf74af539eb25adcbedb9e7132657df22e
child 324857 616c1cdadadee675b4e6b7ec50418506d6a7a153
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersglandium
bugs1280683
milestone53.0a1
bug 1280683, keep a pristine copy of en-US installer for repacks, r=glandium Let's use a pristine unpackaged directory of the en-US package, and just rsync that to l10n-stage. That way, all repacks start off with a copy of en-US without modifications of the previous repack. Removing clobber-zip, that hasn't been used in ages, on the way. Moving the creation of the branding dir to the INNER_UNMAKE_PACKAGE, which is the command that needs it, to simplify rulesets. MozReview-Commit-ID: 8WJtaAqjmk1
browser/locales/Makefile.in
mobile/android/locales/Makefile.in
toolkit/locales/l10n.mk
toolkit/mozapps/installer/upload-files.mk
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -82,18 +82,16 @@ DIST_SUBDIRS = $(DIST_SUBDIR)
 include $(topsrcdir)/config/rules.mk
 
 include $(topsrcdir)/toolkit/locales/l10n.mk
 
 $(list-json): $(call mkdir_deps,$(SEARCHPLUGINS_PATH)) $(if $(IS_LANGUAGE_REPACK),FORCE)
 	$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(list-json))
 searchplugins:: $(list-json)
 
-$(STAGEDIST): $(DIST)/branding
-
 $(DIST)/branding:
 	$(NSINSTALL) -D $@
 
 DEFINES += -DBOOKMARKS_INCLUDE_DIR=$(dir $(call MERGE_FILE,profile/bookmarks.inc))
 
 libs-%:
 	$(NSINSTALL) -D $(DIST)/install
 	@$(MAKE) -C ../../toolkit/locales libs-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@@ -116,35 +114,25 @@ repackage-win32-installer: $(call ESCAPE
 	  AB_CD=$(AB_CD) \
 	  MOZ_PKG_FORMAT=SFX7Z \
 	  ZIP_IN='$(WIN32_INSTALLER_IN)' \
 	  ZIP_OUT='$(WIN32_INSTALLER_OUT)' \
 	  SFX_HEADER='$(PWD)/../installer/windows/l10ngen/7zSD.sfx \
 	              $(topsrcdir)/browser/installer/windows/app.tag'
 
 ifeq (WINNT,$(OS_ARCH))
-repackage-win32-installer-%: $(STAGEDIST)
+repackage-win32-installer-%: unpack
 	@$(MAKE) repackage-win32-installer AB_CD=$* WIN32_INSTALLER_IN='$(WIN32_INSTALLER_IN)'
 
 repackage-zip-%: repackage-win32-installer-%
 else
 repackage-win32-installer-%: ;
 endif
 
 
-clobber-zip:
-	$(RM) $(STAGEDIST)/chrome/$(AB_CD).jar \
-	  $(STAGEDIST)/chrome/$(AB_CD).manifest \
-	  $(STAGEDIST)/$(PREF_DIR)/firefox-l10n.js
-	$(RM) -rf  $(STAGEDIST)/dictionaries \
-	  $(STAGEDIST)/hyphenation \
-	  $(STAGEDIST)/defaults/profile \
-	  $(STAGEDIST)/chrome/$(AB_CD)
-
-
 langpack: langpack-$(AB_CD)
 
 # This is a generic target that will make a langpack, repack ZIP (+tarball)
 # builds, and repack an installer if applicable. It is called from the
 # tinderbox scripts. Alter it with caution.
 
 installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
 	@echo 'repackaging done'
--- a/mobile/android/locales/Makefile.in
+++ b/mobile/android/locales/Makefile.in
@@ -15,25 +15,16 @@ L10N_PREF_JS_EXPORTS = $(firstword $(wil
 L10N_PREF_JS_EXPORTS_PATH = $(FINAL_TARGET)/$(PREF_DIR)
 L10N_PREF_JS_EXPORTS_FLAGS = $(PREF_PPFLAGS) --silence-missing-directive-warnings
 PP_TARGETS += L10N_PREF_JS_EXPORTS
 
 include $(topsrcdir)/config/rules.mk
 
 include $(topsrcdir)/toolkit/locales/l10n.mk
 
-clobber-zip:
-	$(RM) $(STAGEDIST)/chrome/$(AB_CD).jar \
-	  $(STAGEDIST)/chrome/$(AB_CD).manifest \
-	  $(STAGEDIST)/defaults/pref/mobile-l10n.js
-	$(RM) -r $(STAGEDIST)/dictionaries \
-	  $(STAGEDIST)/hyphenation \
-	  $(STAGEDIST)/defaults/profile \
-	  $(STAGEDIST)/chrome/$(AB_CD)
-
 # need to kill stage for repacks for now due to the library moves
 # in PACKAGE and UNPACKAGE
 # also clean up potential left-overs of multi-locale builds, notably
 # values-*/strings.xml and raw-*/suggestedsites.json.
 # Those would be in the way of a single locale build, which this
 # target is for
 clobber-stage:
 	$(RM) -rf $(STAGEDIST)
--- a/toolkit/locales/l10n.mk
+++ b/toolkit/locales/l10n.mk
@@ -3,20 +3,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
 # Shared makefile that can be used to easily kick off l10n builds
 # of Mozilla applications.
 # This makefile should be included, and then assumes that the including
 # makefile defines the following targets:
-# clobber-zip
-#   This target should remove all language dependent-files from $(STAGEDIST),
-#   depending on $(AB_CD) set to the locale code.
-#   $(AB_CD) will be en-US on the initial unpacking of the package
 # libs-%
 #   This target should call into the various libs targets that this
 #   application depends on.
 # installer-%
 #   This target should list all required targets, a typical rule would be
 #	installers-%: clobber-% langpack-% repackage-zip-%
 #		@echo "repackaging done"
 #   to initially clobber the locale staging area, and then to build the
@@ -67,39 +63,46 @@ clobber-%:
 
 PACKAGER_NO_LIBS = 1
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 STAGEDIST = $(ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources
 else
 STAGEDIST = $(ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)
 endif
+UNPACKED_INSTALLER = $(ABS_DIST)/unpacked-installer
 
 include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
 include $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.mk
 
 PACKAGE_BASE_DIR = $(ABS_DIST)/l10n-stage
 
-$(STAGEDIST): AB_CD:=en-US
-$(STAGEDIST): UNPACKAGE=$(call ESCAPE_WILDCARD,$(ZIP_IN))
-$(STAGEDIST): $(call ESCAPE_WILDCARD,$(ZIP_IN))
+$(UNPACKED_INSTALLER): AB_CD:=en-US
+$(UNPACKED_INSTALLER): UNPACKAGE=$(call ESCAPE_WILDCARD,$(ZIP_IN))
+$(UNPACKED_INSTALLER): $(call ESCAPE_WILDCARD,$(ZIP_IN))
 # only mac needs to remove the parent of STAGEDIST...
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-	$(RM) -r -v $(DIST)/l10n-stage
+	$(RM) -r -v $(UNPACKED_INSTALLER)
 else
 # ... and windows doesn't like removing STAGEDIST itself, remove all children
-	find $(STAGEDIST) -maxdepth 1 -print0 | xargs -0 $(RM) -r
+	find $(UNPACKED_INSTALLER) -maxdepth 1 -print0 | xargs -0 $(RM) -r
 endif
-	$(NSINSTALL) -D $(DIST)/l10n-stage
-	cd $(DIST)/l10n-stage && \
+	$(NSINSTALL) -D $(UNPACKED_INSTALLER)
+	cd $(UNPACKED_INSTALLER) && \
 	  $(INNER_UNMAKE_PACKAGE)
 
 
-unpack: $(STAGEDIST)
-	@echo done unpacking
+unpack: $(UNPACKED_INSTALLER)
+ifeq ($(OS_ARCH), WINNT)
+	$(RM) -r -f $(ABS_DIST)/l10n-stage
+	$(NSINSTALL) -D $(ABS_DIST)/l10n-stage
+	$(call copy_dir, $(UNPACKED_INSTALLER), $(ABS_DIST)/l10n-stage)
+else
+	rsync -rav --delete $(UNPACKED_INSTALLER)/ $(ABS_DIST)/l10n-stage
+endif
 
 # The path to the object dir for the mozilla-central build system,
 # may be overridden if necessary.
 MOZDEPTH ?= $(DEPTH)
 
 ifdef MOZ_MAKE_COMPLETE_MAR
 MAKE_COMPLETE_MAR = 1
 ifeq ($(OS_ARCH), WINNT)
@@ -147,17 +150,17 @@ ifneq (en,$(LPROJ_ROOT))
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 	mv $(STAGEDIST)/$(LPROJ_ROOT).lproj $(STAGEDIST)/en.lproj
 endif
 endif
 	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
 	mv -f '$(DIST)/l10n-stage/$(PACKAGE)' '$(ZIP_OUT)'
 	if test -f '$(DIST)/l10n-stage/$(PACKAGE).asc'; then mv -f '$(DIST)/l10n-stage/$(PACKAGE).asc' '$(ZIP_OUT).asc'; fi
 
-repackage-zip-%: $(STAGEDIST)
+repackage-zip-%: unpack
 	@$(MAKE) repackage-zip AB_CD=$* ZIP_IN='$(ZIP_IN)'
 
 APP_DEFINES = $(firstword $(wildcard $(LOCALE_SRCDIR)/defines.inc) \
                           $(srcdir)/en-US/defines.inc)
 TK_DEFINES = $(firstword \
    $(wildcard $(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/defines.inc) \
    $(MOZILLA_DIR)/toolkit/locales/en-US/defines.inc)
 
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -247,22 +247,28 @@ ifeq ($(MOZ_PKG_FORMAT),DMG)
   PKG_DMG_SOURCE = $(STAGEPATH)$(MOZ_PKG_DIR)
   INNER_MAKE_PACKAGE	= $(call py_action,make_dmg,'$(PKG_DMG_SOURCE)' '$(PACKAGE)')
   INNER_UNMAKE_PACKAGE	= \
     set -ex; \
     rm -rf $(ABS_DIST)/unpack.tmp; \
     mkdir -p $(ABS_DIST)/unpack.tmp; \
     $(_ABS_MOZSRCDIR)/build/package/mac_osx/unpack-diskimage $(UNPACKAGE) /tmp/$(MOZ_PKG_APPNAME)-unpack $(ABS_DIST)/unpack.tmp; \
     rsync -a '$(ABS_DIST)/unpack.tmp/$(_APPNAME)' $(MOZ_PKG_DIR); \
-    test -n '$(MOZ_PKG_MAC_DSSTORE)' && \
+    if test -n '$(MOZ_PKG_MAC_DSSTORE)' ; then \
+      mkdir -p '$(dir $(MOZ_PKG_MAC_DSSTORE))'; \
       rsync -a '$(ABS_DIST)/unpack.tmp/.DS_Store' '$(MOZ_PKG_MAC_DSSTORE)'; \
-    test -n '$(MOZ_PKG_MAC_BACKGROUND)' && \
+    fi; \
+    if test -n '$(MOZ_PKG_MAC_BACKGROUND)' ; then \
+      mkdir -p '$(dir $(MOZ_PKG_MAC_BACKGROUND))'; \
       rsync -a '$(ABS_DIST)/unpack.tmp/.background/$(notdir $(MOZ_PKG_MAC_BACKGROUND))' '$(MOZ_PKG_MAC_BACKGROUND)'; \
-    test -n '$(MOZ_PKG_MAC_ICON)' && \
+    fi; \
+    if test -n '$(MOZ_PKG_MAC_ICON)' ; then \
+      mkdir -p '$(dir $(MOZ_PKG_MAC_ICON))'; \
       rsync -a '$(ABS_DIST)/unpack.tmp/.VolumeIcon.icns' '$(MOZ_PKG_MAC_ICON)'; \
+    fi; \
     rm -rf $(ABS_DIST)/unpack.tmp; \
     if test -n '$(MOZ_PKG_MAC_RSRC)' ; then \
       cp $(UNPACKAGE) $(MOZ_PKG_APPNAME).tmp.dmg && \
       hdiutil unflatten $(MOZ_PKG_APPNAME).tmp.dmg && \
       { /Developer/Tools/DeRez -skip plst -skip blkx $(MOZ_PKG_APPNAME).tmp.dmg > '$(MOZ_PKG_MAC_RSRC)' || { rm -f $(MOZ_PKG_APPNAME).tmp.dmg && false; }; } && \
       rm -f $(MOZ_PKG_APPNAME).tmp.dmg; \
     fi
   # The plst and blkx resources are skipped because they belong to each