Files
brave-core/patches/chrome-installer-linux-debian-build.py.patch
T
Claudio DeSouza 6851fe3b8a [cr145] Adjust //chromium/installer/linux patches to refactor
There has been a significant refactor to this code done in upstream to
make it more python-like. This change corrects our patches to adjust to
the new expectations.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/d80c7ae95cd37bbdc1debc9fad8aab9de24f9847

commit d80c7ae95cd37bbdc1debc9fad8aab9de24f9847
Author: Tom Anderson <thomasanderson@chromium.org>
Date:   Thu Dec 11 17:03:39 2025 -0800

    Reland "Refactor chrome/installer/linux"

    This is a reland of commit db3d1a330291474e4d7b5001f89e0440e297f0df

    The reland dupes some code that shouldn't be shared by //remoting.

    Original change's description:
    > Refactor chrome/installer/linux
    >
    > No behavior changes. The built packages are bit-for-bit identical. The
    > original Python port of the shell scripts was a direct, literal
    > translation. This change aims to make the port more Pythonic.
    >
    > - Declarative Artifacts: Replaces the imperative file staging logic
    >   with a declarative list of Artifact objects. Each artifact defines
    >   its source, destination, type (binary, resource, icon, etc.), and
    >   permissions.
    > - InstallerConfig: Replaces the unstructured context dictionary
    >   with a typed InstallerConfig dataclass. This centralizes
    >   configuration, parsed arguments, and derived variables.
    > - Templating Engine: Switches from manual string replacement to
    >   Python's built-in string.Template. This necessitates updating all
    >   template files (deb, rpm, and common) to use the @@VARIABLE syntax
    >   (dropping the trailing @@) and accessing attributes directly from
    >   the config object (e.g., @@architecture instead of
    >   @@ARCHITECTURE@@).
    > - Type Hinting: Adds type annotations throughout installer.py,
    >   debian/build.py, and rpm/build.py.
    > - Modernization: Uses pathlib more extensively, adds a
    >   StagingContext manager for directory cleanup, and defines
    >   permission constants.
    >
    > Change-Id: Ib4954f5095790949f4d4c79de7af962141d8d5e5
    > Bug: None
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7214329
    > Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
    > Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
    > Commit-Queue: Lei Zhang <thestig@chromium.org>
    > Reviewed-by: Lei Zhang <thestig@chromium.org>
    > Cr-Commit-Position: refs/heads/main@{#1557645}

    Bug: None
    Change-Id: I8ec3abd52f56c34ac48c342e6f795276fbb0c92d
    Cq-Include-Trybots: luci.chrome.try:linux64-rel-ready
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7253206
    Reviewed-by: Lei Zhang <thestig@chromium.org>
    Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
    Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1557781}
2026-01-29 13:40:32 -05:00

23 lines
1.2 KiB
Diff

diff --git a/chrome/installer/linux/debian/build.py b/chrome/installer/linux/debian/build.py
index 4c8c99046294dbcdb7bac607af383202faf1b22e..36ad3e6c09ebdd5480287042e634740b639c2169 100755
--- a/chrome/installer/linux/debian/build.py
+++ b/chrome/installer/linux/debian/build.py
@@ -161,6 +161,8 @@ def main() -> None:
logging.info(f"Packaging {args.arch}...")
config.deb_pre_depends = config.common_predeps
config.deb_depends = config.common_deps
+ # Ensure that our signing key is up-to-date (brave/brave-browser#4205).
+ config.deb_depends = f"brave-keyring, {config.common_deps}"
config.deb_provides = "www-browser"
installer.gen_changelog(config, deb_changelog)
@@ -172,6 +174,8 @@ def main() -> None:
os.environ["DEB_HOST_ARCH"] = args.arch
pkg_name = f"{config.package_orig}-{config.channel}"
+ if config.channel == "stable": pkg_name = f"{config.package_orig}"
+ zip_path = (output_dir / f"{pkg_name}-{config.versionfull}-linux-{args.arch}.zip").resolve(); subprocess.check_call(["zip", "-qr", str(zip_path), "."], cwd=str(install_dir))
if deb_control.exists():
gen_control(