commit fb88a0efb9dd502485eb9db710e3d6e4ac0f21d0
parent 12c885354d8d68651d3641d735f25088ca2b5ba9
Author: Bastien Orivel <borivel@mozilla.com>
Date: Mon, 10 Nov 2025 15:02:09 +0000
Bug 1999227 - Move the debian distribution.ini in tree. r=releng-reviewers,jcristau
Right now distribution files for deb packages live at
https://github.com/mozilla-partners/deb/ with the only reason being
"other distributions lived there".
Bringing those files in-tree reduces complexity, makes adding new
repackaging tasks (rpm) easier, brings us in line with what comm has
which reduces the chances of breaking their stuff, prevents having an
external source which might change between rebuilds...
Differential Revision: https://phabricator.services.mozilla.com/D271967
Diffstat:
3 files changed, 25 insertions(+), 38 deletions(-)
diff --git a/browser/installer/linux/app/debian/distribution.ini b/browser/installer/linux/app/debian/distribution.ini
@@ -0,0 +1,9 @@
+[Global]
+id=mozilla-deb
+version=1.0
+about=Mozilla Firefox Debian Package
+
+[Preferences]
+intl.locale.requested=""
+dom.ipc.forkserver.enable=true
+browser.gnome-search-provider.enabled=true
diff --git a/python/mozbuild/mozbuild/repackaging/utils.py b/python/mozbuild/mozbuild/repackaging/utils.py
@@ -6,7 +6,6 @@ import json
import os
import pathlib
import shutil
-import subprocess
import tarfile
import zipfile
from datetime import datetime
@@ -167,32 +166,13 @@ def inject_desktop_entry_file(
def inject_distribution_folder(source_dir, source_type, app_name):
distribution_ini_path = mozpath.join(source_dir, source_type, "distribution.ini")
- # Check to see if a distribution.ini file is already supplied in the templates directory
- # If not, continue to download default Firefox distribution.ini from GitHub
- if os.path.exists(distribution_ini_path):
- os.makedirs(
- mozpath.join(source_dir, app_name.lower(), "distribution"), exist_ok=True
- )
- shutil.move(
- distribution_ini_path,
- mozpath.join(source_dir, app_name.lower(), "distribution"),
- )
-
- return
-
- with TemporaryDirectory() as git_clone_dir:
- subprocess.check_call(
- [
- "git",
- "clone",
- "https://github.com/mozilla-partners/deb.git",
- git_clone_dir,
- ],
- )
- shutil.copytree(
- mozpath.join(git_clone_dir, "desktop/deb/distribution"),
- mozpath.join(source_dir, app_name.lower(), "distribution"),
- )
+ os.makedirs(
+ mozpath.join(source_dir, app_name.lower(), "distribution"), exist_ok=True
+ )
+ shutil.move(
+ distribution_ini_path,
+ mozpath.join(source_dir, app_name.lower(), "distribution"),
+ )
def inject_prefs_file(source_dir, app_name, template_dir):
diff --git a/python/mozbuild/mozbuild/test/repackaging/test_utils.py b/python/mozbuild/mozbuild/test/repackaging/test_utils.py
@@ -357,19 +357,17 @@ def test_render_templates():
def test_inject_distribution_folder(monkeypatch):
- def mock_check_call(command):
- global clone_dir
- clone_dir = command[-1]
- os.makedirs(os.path.join(clone_dir, "desktop/deb/distribution"))
+ def mock_makedirs(destination, *, exist_ok):
+ assert destination == "/source_dir/firefox/distribution"
+ assert exist_ok
- monkeypatch.setattr(utils.subprocess, "check_call", mock_check_call)
+ def mock_move(source, destination):
+ assert source == "/source_dir/debian/distribution.ini"
+ assert destination == "/source_dir/firefox/distribution"
- def mock_copytree(source_tree, destination_tree):
- global clone_dir
- assert source_tree == mozpath.join(clone_dir, "desktop/deb/distribution")
- assert destination_tree == "/source_dir/firefox/distribution"
-
- monkeypatch.setattr(utils.shutil, "copytree", mock_copytree)
+ monkeypatch.setattr(utils.os.path, "exists", lambda _: True)
+ monkeypatch.setattr(utils.shutil, "move", mock_move)
+ monkeypatch.setattr(utils.os, "makedirs", mock_makedirs)
utils.inject_distribution_folder("/source_dir", "debian", "Firefox")