Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 # vim:set ts=8 sw=8 sts=8 noet:
2 #
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 STANDALONE_MAKEFILE := 1
9 # input location for the build, usually $(DIST)
10 # set this to $(DIST)/l10n-stage per override for L10n builds
11 PACKAGE_BASE_DIR = $(DIST)
13 # Default output location for update archive
14 STAGE_DIR = $(DIST)/$(PKG_UPDATE_PATH)
16 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
17 ifdef UNIVERSAL_BINARY
18 ifneq (,$(filter %/l10n-stage,$(PACKAGE_BASE_DIR)))
19 PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME)
20 else
21 PACKAGE_DIR = $(PACKAGE_BASE_DIR)/universal/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME)
22 endif
23 else
24 PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME)
25 endif
26 else
27 PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)
28 endif
30 MAR_BIN = $(LIBXUL_DIST)/host/bin/mar$(HOST_BIN_SUFFIX)
31 MBSDIFF_BIN = $(LIBXUL_DIST)/host/bin/mbsdiff$(HOST_BIN_SUFFIX)
33 OVERRIDE_DEFAULT_GOAL := full-update
34 full-update:: complete-patch $(if $(MOZ_AUTOMATION_UPDATE_PACKAGING),automation-partial-patch)
36 ifeq ($(OS_TARGET), WINNT)
37 MOZ_PKG_FORMAT := SFX7Z
38 UNPACKAGE = '$(subst $(DIST),$(_ABS_DIST),$(INSTALLER_PACKAGE))'
39 ifdef AB_CD
40 UNPACKAGE = '$(PACKAGE_BASE_DIR)/$(PACKAGE)'
41 endif
42 endif
44 include $(topsrcdir)/config/rules.mk
45 include $(topsrcdir)/toolkit/mozapps/installer/signing.mk
46 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
48 ifdef MOZ_EXTERNAL_SIGNING_FORMAT
49 # We can't use signcode on mar files
50 MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT))
51 MOZ_EXTERNAL_SIGNING_FORMAT := mar $(MOZ_EXTERNAL_SIGNING_FORMAT)
52 endif
54 dir-stage := $(call mkdir_deps,$(STAGE_DIR))
56 complete-patch:: $(dir-stage)
57 ifeq ($(OS_TARGET), WINNT)
58 test -f $(UNPACKAGE)
59 $(RM) -rf '$(PACKAGE_DIR)'
60 cd $(PACKAGE_BASE_DIR) && $(INNER_UNMAKE_PACKAGE)
61 endif
62 MAR=$(MAR_BIN) \
63 $(srcdir)/make_full_update.sh \
64 '$(DIST)/$(COMPLETE_MAR)' \
65 '$(PACKAGE_DIR)'
66 ifdef MOZ_SIGN_CMD
67 $(MOZ_SIGN_CMD) -f mar '$(DIST)/$(COMPLETE_MAR)'
68 endif
70 partial-patch:: $(dir-stage)
71 MAR=$(MAR_BIN) \
72 MBSDIFF=$(MBSDIFF_BIN) \
73 $(srcdir)/make_incremental_update.sh \
74 '$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar' \
75 '$(SRC_BUILD)' \
76 '$(DST_BUILD)'
77 ifdef MOZ_SIGN_CMD
78 $(MOZ_SIGN_CMD) -f mar '$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar'
79 endif
81 automation-partial-patch: complete-patch
82 rm -rf current current.work previous
83 mkdir current previous
84 latestmar=$$(ssh -l $(UPLOAD_USER) -i $(UPLOAD_SSH_KEY) $(UPLOAD_HOST) 'ls -1t $(LATEST_MAR_DIR) | grep $(MOZ_PKG_PLATFORM).complete.mar$$ | head -n 1'); \
85 if test -n "$$latestmar"; then \
86 wget -O $(STAGE_DIR)/previous.mar http://$(UPLOAD_HOST)/$(LATEST_MAR_DIR)/$$latestmar && \
87 (cd previous; \
88 MAR=$(MAR_BIN) perl $(topsrcdir)/tools/update-packaging/unwrap_full_update.pl '../$(STAGE_DIR)/previous.mar') && \
89 (cd current; \
90 MAR=$(MAR_BIN) perl $(topsrcdir)/tools/update-packaging/unwrap_full_update.pl '../$(DIST)/$(COMPLETE_MAR)') && \
91 find current -name \*.pgc -print -delete && \
92 find previous -name \*.pgc -print -delete && \
93 rm -f $(STAGE_DIR)/*.partial.*.mar && \
94 SRC_BUILD_ID=$$(python $(topsrcdir)/config/printconfigsetting.py $$(find previous -maxdepth 4 -type f -name application.ini) App BuildID) \
95 DST_BUILD_ID=$$(cat $(DEPTH)/config/buildid) \
96 SRC_BUILD=previous DST_BUILD=current \
97 $(MAKE) partial-patch && \
98 rm -f $(STAGE_DIR)/previous.mar; \
99 else \
100 echo "No previous MAR found; not creating a partial MAR"; \
101 fi