Bug 1200861 - Always remove xpi-stage/lightning if EN_US_BINARY_URL is set. r=mkmelin,a=philipp CLOSED TREE for beta build changes
authorPhilipp Kewisch <mozilla@kewis.ch>
Wed, 02 Sep 2015 13:04:04 +0200
changeset 22866 88062c7a9dc08e7ddad3fd7602a73fd702e44edc
parent 22865 23edc9818c24987419e8a77c15a97aaab42f9e84
child 22867 409957bf23934f7f446bcb99b3ab78a5d83d5ee4
push id1453
push usermozilla@kewis.ch
push dateWed, 02 Sep 2015 11:06:45 +0000
treeherdercomm-beta@88062c7a9dc0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, philipp
bugs1200861
Bug 1200861 - Always remove xpi-stage/lightning if EN_US_BINARY_URL is set. r=mkmelin,a=philipp CLOSED TREE for beta build changes
calendar/lightning/lightning-packager.mk
--- a/calendar/lightning/lightning-packager.mk
+++ b/calendar/lightning/lightning-packager.mk
@@ -26,36 +26,42 @@ include $(MOZILLA_SRCDIR)/toolkit/mozapp
 # not restricted by the calling makefile
 ifeq ($(UNIVERSAL_BINARY)|$(XPI_NO_UNIVERSAL),1|)
 UNIVERSAL_PATH=universal/
 else
 UNIVERSAL_PATH=
 endif
 
 _ABS_DIST := $(abspath $(DIST))
+XPI_STAGE_PATH = $(DIST)/$(UNIVERSAL_PATH)xpi-stage
+_ABS_XPI_STAGE_PATH = $(_ABS_DIST)/$(UNIVERSAL_PATH)xpi-stage
+ENUS_PKGNAME=$(subst .$(AB_CD).,.en-US.,$(XPI_PKGNAME))
+XPI_ZIP_IN=$(_ABS_XPI_STAGE_PATH)/$(ENUS_PKGNAME).xpi
+
 
 # This variable is to allow the wget-en-US target to know which ftp server to download from
 ifndef EN_US_BINARY_URL
 ifdef UPLOAD_HOST
 # If this url is missing, and UPLOAD_HOST is defined its probably the release
 # run where we can't influence the download location. Fake it from the env vars
 # we have
 BUILD_NR=$(shell echo $(POST_UPLOAD_CMD) | sed -n -e 's/.*-n \([0-9]*\).*/\1/p')
 CANDIDATE_NR=$(if $(LIGHTNING_VERSION),$(LIGHTNING_VERSION),$(XPI_VERSION))
 EN_US_BINARY_URL=http://$(UPLOAD_HOST)/pub/mozilla.org/calendar/lightning/nightly/$(CANDIDATE_NR)-candidates/build$(BUILD_NR)/$(MOZ_PKG_PLATFORM)
-else
-EN_US_BINARY_URL = $(error You must set EN_US_BINARY_URL)
 endif
 endif
 
-
-XPI_STAGE_PATH = $(DIST)/$(UNIVERSAL_PATH)xpi-stage
-_ABS_XPI_STAGE_PATH = $(_ABS_DIST)/$(UNIVERSAL_PATH)xpi-stage
-ENUS_PKGNAME=$(subst .$(AB_CD).,.en-US.,$(XPI_PKGNAME))
-XPI_ZIP_IN=$(_ABS_XPI_STAGE_PATH)/$(ENUS_PKGNAME).xpi
+# Check if EN_US_BINARY_URL has finally been set
+ifdef EN_US_BINARY_URL
+# If so, we are expected to unpack when the language pack is created
+ensure-stage-dir: wget-en-US unpack
+else
+# If not, use the existing lightning from xpi-stage, or warn that the var is not set.
+ensure-stage-dir: $(if $(wildcard $(XPI_STAGE_PATH)/$(XPI_NAME)/),,$(error You must set EN_US_BINARY_URL))
+endif
 
 $(XPI_STAGE_PATH):
 	mkdir -p $@
 
 # Target Directory used for the l10n files
 L10N_TARGET = $(XPI_STAGE_PATH)/$(XPI_NAME)-$(AB_CD)
 
 # Short name of the OS used in shipped-locales file. For now osx is the only
@@ -69,17 +75,16 @@ endif
 # function print_ltnconfig(section,configname)
 print_ltnconfig = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(XPI_STAGE_PATH)/$(XPI_NAME)/app.ini $1 $2)
 
 wget-en-US: FINAL_BINARY_URL = $(subst thunderbird,calendar/lightning,$(EN_US_BINARY_URL))
 wget-en-US: $(XPI_STAGE_PATH)
 	(cd $(XPI_STAGE_PATH) && $(WGET) -nv -N $(FINAL_BINARY_URL)/$(ENUS_PKGNAME).xpi)
 	@echo "Downloaded $(FINAL_BINARY_URL)/$(ENUS_PKGNAME) to $(XPI_ZIP_IN)"
 
-ensure-stage-dir: $(if $(wildcard $(XPI_STAGE_PATH)/$(XPI_NAME)/),,wget-en-US unpack)
 
 # We're unpacking directly into FINAL_TARGET, this keeps code to do manual
 # repacks cleaner.
 unpack: $(XPI_ZIP_IN)
 	if test -d $(XPI_STAGE_PATH)/$(XPI_NAME); then \
 	  $(RM) -r -v $(XPI_STAGE_PATH)/$(XPI_NAME); \
 	fi
 	$(NSINSTALL) -D $(XPI_STAGE_PATH)/$(XPI_NAME)