|
|
f43be0 |
# HG changeset patch
|
|
|
f43be0 |
# User Rob Lemley <rob@thunderbird.net>
|
|
|
f43be0 |
# Date 1662996130 0
|
|
|
f43be0 |
# Mon Sep 12 15:22:10 2022 +0000
|
|
|
f43be0 |
# Node ID 5dfb405f325609c62215f9d74e01dba029b84611
|
|
|
f43be0 |
# Parent 9998ed5c2bcee289b03828eba670053614fa26da
|
|
|
f43be0 |
Bug 1790446 - Stop rewriting RNP config.h.in when updating the source from upstream. r=dandarnell
|
|
|
f43be0 |
|
|
|
f43be0 |
Differential Revision: https://phabricator.services.mozilla.com/D157151
|
|
|
f43be0 |
|
|
|
f43be0 |
diff --git a/comm/python/thirdroc/thirdroc/rnp.py b/comm/python/thirdroc/thirdroc/rnp.py
|
|
|
f43be0 |
--- a/comm/python/thirdroc/thirdroc/rnp.py
|
|
|
f43be0 |
+++ b/comm/python/thirdroc/thirdroc/rnp.py
|
|
|
f43be0 |
@@ -11,19 +11,18 @@ import re
|
|
|
f43be0 |
from packaging.version import parse
|
|
|
f43be0 |
|
|
|
f43be0 |
from mozbuild.preprocessor import Preprocessor
|
|
|
f43be0 |
|
|
|
f43be0 |
|
|
|
f43be0 |
-def rnp_source_update(rnp_root, version_str, revision, timestamp, bug_report):
|
|
|
f43be0 |
+def rnp_source_update(rnp_root, version_str, revision, timestamp):
|
|
|
f43be0 |
"""
|
|
|
f43be0 |
Update RNP source files: generate version.h and mangle config.h.in
|
|
|
f43be0 |
:param rnp_root:
|
|
|
f43be0 |
:type rnp_root:
|
|
|
f43be0 |
:param string version_str: latest version
|
|
|
f43be0 |
:param string revision: revision hash (short form)
|
|
|
f43be0 |
:param float timestamp: UNIX timestamp from revision
|
|
|
f43be0 |
- :param string bug_report: where to report bugs for this RNP build
|
|
|
f43be0 |
"""
|
|
|
f43be0 |
version = parse(version_str)
|
|
|
f43be0 |
version_major = version.major
|
|
|
f43be0 |
version_minor = version.minor
|
|
|
f43be0 |
version_patch = version.micro
|
|
|
f43be0 |
@@ -36,20 +35,17 @@ def rnp_source_update(rnp_root, version_
|
|
|
f43be0 |
RNP_VERSION_MINOR=version_minor,
|
|
|
f43be0 |
RNP_VERSION_PATCH=version_patch,
|
|
|
f43be0 |
RNP_VERSION=version_str,
|
|
|
f43be0 |
RNP_VERSION_FULL=version_full,
|
|
|
f43be0 |
RNP_VERSION_COMMIT_TIMESTAMP=str(timestamp),
|
|
|
f43be0 |
- BUGREPORT_EMAIL=bug_report,
|
|
|
f43be0 |
)
|
|
|
f43be0 |
src_lib = os.path.join(rnp_root, "src", "lib")
|
|
|
f43be0 |
version_h_in = os.path.join(src_lib, "version.h.in")
|
|
|
f43be0 |
version_h = os.path.join(src_lib, "version.h")
|
|
|
f43be0 |
- config_h_in = os.path.join(src_lib, "config.h.in")
|
|
|
f43be0 |
readme_rnp = os.path.join(rnp_root, "..", "README.rnp")
|
|
|
f43be0 |
|
|
|
f43be0 |
generate_version_h(version_h_in, version_h, defines)
|
|
|
f43be0 |
- mangle_config_h_in(config_h_in, defines)
|
|
|
f43be0 |
update_readme(readme_rnp, revision)
|
|
|
f43be0 |
|
|
|
f43be0 |
|
|
|
f43be0 |
def rnp_preprocess(tmpl, dest, defines):
|
|
|
f43be0 |
"""
|
|
|
f43be0 |
@@ -79,30 +75,10 @@ def generate_version_h(template, destina
|
|
|
f43be0 |
with open(template) as tmpl:
|
|
|
f43be0 |
with open(destination, "w") as dest:
|
|
|
f43be0 |
rnp_preprocess(tmpl, dest, defines)
|
|
|
f43be0 |
|
|
|
f43be0 |
|
|
|
f43be0 |
-def mangle_config_h_in(template, defines):
|
|
|
f43be0 |
- """
|
|
|
f43be0 |
- Mangle RNP's config.h.in so that it will work with CONFIGURE_DEFINE_FILES
|
|
|
f43be0 |
- :param string template: path to config.h.in
|
|
|
f43be0 |
- :param dict defines: result of get_defines()
|
|
|
f43be0 |
- """
|
|
|
f43be0 |
- with open(template) as tmpl:
|
|
|
f43be0 |
- tmp_string = StringIO()
|
|
|
f43be0 |
- rnp_preprocess(tmpl, tmp_string, defines)
|
|
|
f43be0 |
-
|
|
|
f43be0 |
- tmp_string.seek(0)
|
|
|
f43be0 |
-
|
|
|
f43be0 |
- with open(template, "w") as dest:
|
|
|
f43be0 |
- for line in tmp_string:
|
|
|
f43be0 |
- if line.startswith("#cmakedefine"):
|
|
|
f43be0 |
- line = line.replace("#cmakedefine", "#undef")
|
|
|
f43be0 |
- dest.write(line)
|
|
|
f43be0 |
- dest.write("\n")
|
|
|
f43be0 |
-
|
|
|
f43be0 |
-
|
|
|
f43be0 |
def update_readme(path, revision):
|
|
|
f43be0 |
"""
|
|
|
f43be0 |
Updates the commit hash in README.rnp
|
|
|
f43be0 |
:param string path: Path to README.rnp
|
|
|
f43be0 |
:param string revision: revision to insert
|
|
|
f43be0 |
diff --git a/comm/third_party/update_rnp.sh b/comm/third_party/update_rnp.sh
|
|
|
f43be0 |
--- a/comm/third_party/update_rnp.sh
|
|
|
f43be0 |
+++ b/comm/third_party/update_rnp.sh
|
|
|
f43be0 |
@@ -42,26 +42,23 @@ TAGLIST=$(git -C "${RNPgit}" tag --list
|
|
|
f43be0 |
|
|
|
f43be0 |
LATEST_VERSION=$($THIRDROC latest_version $TAGLIST)
|
|
|
f43be0 |
REVISION=$(git -C "${RNPgit}" rev-parse --verify HEAD)
|
|
|
f43be0 |
TIMESTAMP=$(git -C "${RNPgit}" show -s --format=%ct)
|
|
|
f43be0 |
|
|
|
f43be0 |
-BUGREPORT="https://bugzilla.mozilla.org/enter_bug.cgi?product=Thunderbird"
|
|
|
f43be0 |
-
|
|
|
f43be0 |
# Cleanup rnp checkout
|
|
|
f43be0 |
rm -rf ${RNPgit}/{.git,.github,.cirrus.yml,.clang-format,.gitignore}
|
|
|
f43be0 |
rm -rf ${RNPgit}/{_config.yml,docker.sh,ci,cmake,git-hooks,travis.sh,vcpkg.txt}
|
|
|
f43be0 |
rm -rf ${RNPgit}/{Brewfile,CMakeLists.txt,CMakeSettings.json}
|
|
|
f43be0 |
|
|
|
f43be0 |
# Do the switch
|
|
|
f43be0 |
rm -rf rnp
|
|
|
f43be0 |
mv "${RNPgit}" rnp
|
|
|
f43be0 |
-# Build version.h/config.h.in
|
|
|
f43be0 |
+# Build version.h
|
|
|
f43be0 |
$THIRDROC rnp_source_update rnp/ \
|
|
|
f43be0 |
"${LATEST_VERSION}" \
|
|
|
f43be0 |
"${REVISION}" \
|
|
|
f43be0 |
- "${TIMESTAMP}" \
|
|
|
f43be0 |
- "${BUGREPORT}"
|
|
|
f43be0 |
+ "${TIMESTAMP}"
|
|
|
f43be0 |
|
|
|
f43be0 |
# Restore moz.build
|
|
|
f43be0 |
hg revert rnp/moz.build rnp/module.ver rnp/rnp.symbols rnp/src/lib/rnp/rnp_export.h \
|
|
|
f43be0 |
rnp/src/rnp/moz.build rnp/src/rnpkeys/moz.build
|
|
|
f43be0 |
|