Bug 1345422 - Do not hardcode the sfx package and installer path. r=mshal
authorEdmund Wong <ewong@pw-wspx.org>
Wed, 22 Mar 2017 08:52:35 +0800
changeset 348809 2e22ffe74d4194ca7703e047c0f3ce5f61749360
parent 348808 4c45a777949168d16c03a4cba167678b7ab65f76
child 348810 a6fe49ad11cbe5dfca3b172f2a71750de9e47b29
push id31536
push usercbook@mozilla.com
push dateWed, 22 Mar 2017 13:26:47 +0000
treeherdermozilla-central@27f7aadeea83 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1345422
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1345422 - Do not hardcode the sfx package and installer path. r=mshal
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.]*//' )