[Updated] D8472: packaging: split Inno installer building from Mercurial building

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Thu Apr 30 05:51:47 UTC 2020


Closed by commit rHG5760936e8d53: packaging: split Inno installer building from Mercurial building (authored by indygreg).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8472?vs=21174&id=21240

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8472/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8472

AFFECTED FILES
  contrib/packaging/hgpackaging/inno.py

CHANGE DETAILS

diff --git a/contrib/packaging/hgpackaging/inno.py b/contrib/packaging/hgpackaging/inno.py
--- a/contrib/packaging/hgpackaging/inno.py
+++ b/contrib/packaging/hgpackaging/inno.py
@@ -61,8 +61,7 @@
 
     vc_x64 = r'\x64' in os.environ.get('LIB', '')
     arch = 'x64' if vc_x64 else 'x86'
-    inno_source_dir = source_dir / 'contrib' / 'packaging' / 'inno'
-    inno_build_dir = build_dir / ('inno-%s' % arch)
+    inno_build_dir = build_dir / ('inno-py2exe-%s' % arch)
     staging_dir = inno_build_dir / 'stage'
 
     requirements_txt = (
@@ -104,6 +103,31 @@
         print('copying %s to %s' % (f, dest_path))
         shutil.copyfile(f, dest_path)
 
+    build_installer(
+        source_dir,
+        inno_build_dir,
+        staging_dir,
+        iscc_exe,
+        version,
+        arch="x64" if vc_x64 else None,
+    )
+
+
+def build_installer(
+    source_dir: pathlib.Path,
+    inno_build_dir: pathlib.Path,
+    staging_dir: pathlib.Path,
+    iscc_exe: pathlib.Path,
+    version,
+    arch=None,
+):
+    """Build an Inno installer from staged Mercurial files.
+
+    This function is agnostic about how to build Mercurial. It just
+    cares that Mercurial files are in ``staging_dir``.
+    """
+    inno_source_dir = source_dir / "contrib" / "packaging" / "inno"
+
     # The final package layout is simply a mirror of the staging directory.
     package_files = []
     for root, dirs, files in os.walk(staging_dir):
@@ -158,8 +182,8 @@
 
     args = [str(iscc_exe)]
 
-    if vc_x64:
-        args.append('/dARCH=x64')
+    if arch:
+        args.append('/dARCH=%s' % arch)
 
     if not version:
         version = read_version_py(source_dir)



To: indygreg, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200430/e0e52166/attachment-0002.html>


More information about the Mercurial-patches mailing list