[Pkg-mozext-commits] [adblock-plus] 18/74: Issue 2510 - Support Adblock Browser

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 12:07:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit 6883183d90a745656d33ab83c76abbcd9e442f77
Author: Felix Dahlke <felix at adblockplus.org>
Date:   Wed May 13 22:07:47 2015 +0200

    Issue 2510 - Support Adblock Browser
---
 chrome.manifest        |  2 +-
 dependencies           |  2 +-
 ensure_dependencies.py | 45 +++++++++++++++++++++++++++++++++++++--------
 lib/appSupport.js      |  1 +
 lib/objectTabs.js      |  3 ++-
 metadata.gecko         |  1 +
 6 files changed, 43 insertions(+), 11 deletions(-)

diff --git a/chrome.manifest b/chrome.manifest
index 04e7a21..013f7be 100644
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -3,4 +3,4 @@ skin      adblockplus classic/1.0 chrome/skin/
 locale    adblockplus {{LOCALE}} chrome/locale/{{LOCALE}}/
 
 # fennec settings
-override chrome://adblockplus/content/ui/settings.xul chrome://adblockplus/content/ui/fennecSettings.xul application={a23983c0-fd0e-11dc-95ff-0800200c9a66} application={aa3c5121-dab2-40e2-81ca-7ea25febc110}
+override chrome://adblockplus/content/ui/settings.xul chrome://adblockplus/content/ui/fennecSettings.xul application={a23983c0-fd0e-11dc-95ff-0800200c9a66} application={aa3c5121-dab2-40e2-81ca-7ea25febc110} application={55aba3ac-94d3-41a8-9e25-5c21fe874539}
diff --git a/dependencies b/dependencies
index f554b25..3643198 100644
--- a/dependencies
+++ b/dependencies
@@ -1,4 +1,4 @@
 _root = hg:https://hg.adblockplus.org/ git:https://github.com/adblockplus/
 _self = buildtools/ensure_dependencies.py
-buildtools = buildtools hg:97e2e12af6e8 git:ef69bbc
+buildtools = buildtools hg:f9f01a4c16af git:140ab9f
 adblockplusui = adblockplusui hg:75a50600e10a git:7ebacdc
diff --git a/ensure_dependencies.py b/ensure_dependencies.py
index b6557d0..cec2bbe 100755
--- a/ensure_dependencies.py
+++ b/ensure_dependencies.py
@@ -34,6 +34,10 @@ A dependencies file should look like this:
   buildtools = buildtools hg:016d16f7137b git:f3f8692f82e5
 """
 
+SKIP_DEPENDENCY_UPDATES = os.environ.get(
+  "SKIP_DEPENDENCY_UPDATES", ""
+).lower() not in ("", "0", "false")
+
 class Mercurial():
   def istype(self, repodir):
     return os.path.exists(os.path.join(repodir, ".hg"))
@@ -97,7 +101,20 @@ class Git():
     return subprocess.check_output(command, cwd=repo).strip()
 
   def pull(self, repo):
+    # Fetch tracked branches, new tags and the list of available remote branches
     subprocess.check_call(["git", "fetch", "--quiet", "--all", "--tags"], cwd=repo)
+    # Next we need to ensure all remote branches are tracked
+    newly_tracked = False
+    remotes = subprocess.check_output(["git", "branch", "--remotes"], cwd=repo)
+    for match in re.finditer(r"^\s*(origin/(\S+))$", remotes, re.M):
+      remote, local = match.groups()
+      with open(os.devnull, "wb") as devnull:
+        if subprocess.call(["git", "branch", "--track", local, remote],
+                           cwd=repo, stdout=devnull, stderr=devnull) == 0:
+          newly_tracked = True
+    # Finally fetch any newly tracked remote branches
+    if newly_tracked:
+      subprocess.check_call(["git", "fetch", "--quiet", "origin"], cwd=repo)
 
   def update(self, repo, rev):
     subprocess.check_call(["git", "checkout", "--quiet", rev], cwd=repo)
@@ -167,7 +184,7 @@ def read_deps(repodir):
 
 def safe_join(path, subpath):
   # This has been inspired by Flask's safe_join() function
-  forbidden = set([os.sep, os.altsep]) - set([posixpath.sep, None])
+  forbidden = {os.sep, os.altsep} - {posixpath.sep, None}
   if any(sep in subpath for sep in forbidden):
     raise Exception("Illegal directory separator in dependency path %s" % subpath)
 
@@ -188,6 +205,11 @@ def ensure_repo(parentrepo, target, roots, sourcename):
   if os.path.exists(target):
     return
 
+  if SKIP_DEPENDENCY_UPDATES:
+    logging.warning("SKIP_DEPENDENCY_UPDATES environment variable set, "
+                    "%s not cloned", target)
+    return
+
   parenttype = get_repo_type(parentrepo)
   type = None
   for key in roots:
@@ -227,15 +249,21 @@ def update_repo(target, revisions):
     return
 
   resolved_revision = repo_types[type].get_revision_id(target, revision)
-  if not resolved_revision:
-    logging.info("Revision %s is unknown, downloading remote changes" % revision)
-    repo_types[type].pull(target)
-    resolved_revision = repo_types[type].get_revision_id(target, revision)
-    if not resolved_revision:
-      raise Exception("Failed to resolve revision %s" % revision)
-
   current_revision = repo_types[type].get_revision_id(target)
+
   if resolved_revision != current_revision:
+    if SKIP_DEPENDENCY_UPDATES:
+      logging.warning("SKIP_DEPENDENCY_UPDATES environment variable set, "
+                      "%s not checked out to %s", target, revision)
+      return
+
+    if not resolved_revision:
+      logging.info("Revision %s is unknown, downloading remote changes" % revision)
+      repo_types[type].pull(target)
+      resolved_revision = repo_types[type].get_revision_id(target, revision)
+      if not resolved_revision:
+        raise Exception("Failed to resolve revision %s" % revision)
+
     logging.info("Updating repository %s to revision %s" % (target, resolved_revision))
     repo_types[type].update(target, resolved_revision)
 
@@ -247,6 +275,7 @@ def resolve_deps(repodir, level=0, self_update=True, overrideroots=None, skipdep
     return
   if level >= 10:
     logging.warning("Too much subrepository nesting, ignoring %s" % repo)
+    return
 
   if overrideroots is not None:
     config["_root"] = overrideroots
diff --git a/lib/appSupport.js b/lib/appSupport.js
index 54a9e2f..461b4c2 100644
--- a/lib/appSupport.js
+++ b/lib/appSupport.js
@@ -690,6 +690,7 @@ switch (application)
   }
 
   case "fennec2":
+  case "adblockbrowser":
   {
     exports.isKnownWindow = (window) => window.document.documentElement.id == "main-window";
 
diff --git a/lib/objectTabs.js b/lib/objectTabs.js
index ec29dd2..e726dbd 100644
--- a/lib/objectTabs.js
+++ b/lib/objectTabs.js
@@ -178,7 +178,8 @@ var objTabs =
   {
     // Object tabs aren't usable in Fennec
     let {application} = require("info");
-    if (application == "fennec" || application == "fennec2")
+    if (application == "fennec" || application == "fennec2" ||
+        application == "adblockbrowser")
       return;
 
     let {Prefs} = require("prefs");
diff --git a/metadata.gecko b/metadata.gecko
index 18307bd..ed4c882 100644
--- a/metadata.gecko
+++ b/metadata.gecko
@@ -34,6 +34,7 @@ fennec2=29.0/41.0
 thunderbird=29.0/41.0
 seamonkey=2.26/2.38
 toolkit=29.0/41.0
+adblockbrowser=1.0/1.0
 
 [mapping]
 chrome/content/ui/firstRun.html = adblockplusui/firstRun.html

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list