Bug 1345422 - Do not hardcode the sfx package and installer path. r=mshal, a=gchang
authorEdmund Wong <ewong@pw-wspx.org>
Wed, 22 Mar 2017 08:52:35 +0800
changeset 395721 46bb49526e17c04ae6eaae4d24a50a04e92b64d2
parent 395720 abd5404ff4333cc93d3a07af3d5a6ad15f411264
child 395722 ab11d51947eb9ec46018150c96784bcc15d565e8
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal, gchang
bugs1345422
milestone54.0a2
Bug 1345422 - Do not hardcode the sfx package and installer path. r=mshal, a=gchang
browser/locales/Makefile.in
python/mozbuild/mozbuild/action/7z_exe_archive.py
toolkit/mozapps/installer/upload-files.mk
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -39,16 +39,19 @@ PP_TARGETS += L10N_PREF_JS_EXPORTS
 
 ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
 MOZ_PKG_MAC_DSSTORE=$(ABS_DIST)/branding/dsstore
 MOZ_PKG_MAC_BACKGROUND=$(ABS_DIST)/branding/background.png
 MOZ_PKG_MAC_ICON=$(ABS_DIST)/branding/disk.icns
 MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
 endif
 
+MOZ_SFX_PACKAGE=$(topsrcdir)/other-licenses/7zstub/firefox/7zSD.sfx
+MOZ_INSTALLER_PATH=$(topsrcdir)/browser/installer/windows
+
 ifeq (WINNT,$(OS_ARCH))
 UNINSTALLER_PACKAGE_HOOK = $(RM) -r $(STAGEDIST)/uninstall; \
     $(NSINSTALL) -D $(STAGEDIST)/uninstall; \
     cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall; \
     $(RM) $(ABS_DIST)/l10n-stage/setup.exe; \
     cp ../installer/windows/l10ngen/setup.exe $(ABS_DIST)/l10n-stage; \
     $(NULL)
 
--- a/python/mozbuild/mozbuild/action/7z_exe_archive.py
+++ b/python/mozbuild/mozbuild/action/7z_exe_archive.py
@@ -6,30 +6,30 @@ from __future__ import print_function
 
 import os
 import shutil
 import sys
 import subprocess
 import tempfile
 import mozpack.path as mozpath
 
-def archive_exe(pkg_dir, tagfile, package):
+def archive_exe(pkg_dir, tagfile, sfx_package, package):
     tmpdir = tempfile.mkdtemp(prefix='tmp')
-    subprocess.check_call(['upx', '--best', '-o', mozpath.join(tmpdir, '7zSD.sfx'), '../../../other-licenses/7zstub/firefox/7zSD.sfx'])
+    subprocess.check_call(['upx', '--best', '-o', mozpath.join(tmpdir, '7zSD.sfx'), sfx_package])
     shutil.move(pkg_dir, 'core')
     subprocess.check_call(['7z', 'a', '-r', '-t7z', mozpath.join(tmpdir, 'app.7z'), '-mx', '-m0=BCJ2', '-m1=LZMA:d25', '-m2=LZMA:d19', '-m3=LZMA:d19', '-mb0:1', '-mb0s1:2', '-mb0s2:3'])
     shutil.move('core', pkg_dir)
     with open(package, 'wb') as o:
-        for i in [mozpath.join(tmpdir, '7zSD.sfx'), mozpath.join('../../../browser/installer/windows', tagfile), mozpath.join(tmpdir, 'app.7z')]:
+        for i in [mozpath.join(tmpdir, '7zSD.sfx'), tagfile, mozpath.join(tmpdir, 'app.7z')]:
             shutil.copyfileobj(open(i, 'rb'), o)
     os.chmod(package, 755)
 
 def main(args):
-    if len(args) != 3:
-        print('Usage: 7z_exe_archive.py <pkg_dir> <tagfile> <package>',
+    if len(args) != 4:
+        print('Usage: 7z_exe_archive.py <pkg_dir> <tagfile> <sfx_package> <package>',
               file=sys.stderr)
         return 1
     else:
-        archive_exe(args[0], args[1], args[2])
+        archive_exe(args[0], args[1], args[2], args[3])
         return 0
 
 if __name__ == '__main__':
     sys.exit(main(sys.argv[1:]))
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -115,17 +115,17 @@ ifeq ($(MOZ_PKG_FORMAT),ZIP)
   endif
   PKG_SUFFIX	= .zip
   INNER_MAKE_PACKAGE = $(call py_action,make_zip,'$(MOZ_PKG_DIR)' '$(PACKAGE)')
   INNER_UNMAKE_PACKAGE = $(call py_action,make_unzip,'$(UNPACKAGE)')
 endif
 
 ifeq ($(MOZ_PKG_FORMAT),SFX7Z)
   PKG_SUFFIX	= .exe
-  INNER_MAKE_PACKAGE = $(call py_action,7z_exe_archive,'$(MOZ_PKG_DIR)' 'app.tag' '$(PACKAGE)')
+  INNER_MAKE_PACKAGE = $(call py_action,7z_exe_archive,'$(MOZ_PKG_DIR)' '$(MOZ_INSTALLER_PATH)/app.tag' '$(MOZ_SFX_PACKAGE)' '$(PACKAGE)')
   INNER_UNMAKE_PACKAGE = $(call py_action,7z_exe_extract,'$(UNPACKAGE)' '$(MOZ_PKG_DIR)')
 endif
 
 #Create an RPM file
 ifeq ($(MOZ_PKG_FORMAT),RPM)
   PKG_SUFFIX  = .rpm
   MOZ_NUMERIC_APP_VERSION = $(shell echo $(MOZ_PKG_VERSION) | sed 's/[^0-9.].*//' )
   MOZ_RPM_RELEASE = $(shell echo $(MOZ_PKG_VERSION) | sed 's/[0-9.]*//' )