Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: adblockplus/build.py

Issue 29863604: Issue 6865 - Update ABP dependency to version 3.2 (Closed)
Patch Set: Removing allowed contexts Created Aug. 28, 2018, 5:08 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | adblockplus/extensionBridge.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: adblockplus/build.py
===================================================================
--- a/adblockplus/build.py
+++ b/adblockplus/build.py
@@ -18,52 +18,57 @@
import os
import shutil
import subprocess
import sys
import tempfile
_BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-_ABP_DIR = "adblockplus"
+_ABP_DIR = "adblockpluschrome"
_ABP_CORE_DIR = "adblockpluscore"
+_SUBSCRIPTIONS_PATH = os.path.join(_BASE_DIR, _ABP_DIR, _ABP_CORE_DIR, "chrome",
+ "content", "ui", "subscriptions.xml")
+
+
+def _copy_subscriptions(xpi_path):
+ xpi_dir = os.path.dirname(xpi_path)
+ shutil.copy2(_SUBSCRIPTIONS_PATH, xpi_dir)
+
+
+def _patch_abp(patched_dir):
+ shutil.copytree(_BASE_DIR, patched_dir)
+ abp_dir = os.path.join(patched_dir, _ABP_DIR)
+ abp_core_dir = os.path.join(abp_dir, _ABP_CORE_DIR)
+ subprocess.check_call(["hg", "import", "-q", "-R", abp_core_dir,
+ os.path.join(patched_dir, "issue-6070.patch")])
def _build_abp(base_dir, xpi_path):
xpi_dir = os.path.dirname(os.path.abspath(xpi_path))
if not os.path.exists(xpi_dir):
os.makedirs(xpi_dir)
abp_dir = os.path.join(base_dir, _ABP_DIR)
sys.path.insert(0, abp_dir)
- import buildtools.build
- import buildtools.packager
+ import buildtools.build as tools_build
+ import buildtools.packager as tools_packager
def get_metadata_path(dir, type):
return os.path.join(base_dir, "metadata.gecko")
- buildtools.packager.getMetadataPath = get_metadata_path
- buildtools.build.processArgs(abp_dir, ["", "build", xpi_path])
-
-
-def _patch_abp(patched_dir):
- shutil.copytree(_BASE_DIR, patched_dir)
- abp_dir = os.path.join(patched_dir, _ABP_DIR)
- abp_core_dir = os.path.join(abp_dir, _ABP_CORE_DIR)
- subprocess.check_call(["hg", "import", "-q", "-R", abp_core_dir,
- os.path.join(patched_dir, "issue-6070.patch")])
-
- subprocess.check_call(["hg", "import", "-q", "-R", abp_core_dir,
- os.path.join(patched_dir, "issue-6108.patch")])
+ tools_packager.getMetadataPath = get_metadata_path
+ tools_build.process_args(abp_dir, "build", "-t", "gecko", "-r", xpi_path)
if __name__ == "__main__":
if len(sys.argv) < 2:
error_message = "Usage: %s XPI_PATH" % os.path.basename(sys.argv[0])
print >>sys.stderr, error_message
sys.exit(1)
xpi_path = sys.argv[1]
patched_dir = tempfile.NamedTemporaryFile().name
try:
+ _copy_subscriptions(xpi_path)
_patch_abp(patched_dir)
_build_abp(patched_dir, xpi_path)
finally:
shutil.rmtree(patched_dir)
« no previous file with comments | « no previous file | adblockplus/extensionBridge.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld