diff -Nru mozilla-devscripts-0.53/amo-changelog mozilla-devscripts-0.54/amo-changelog --- mozilla-devscripts-0.53/amo-changelog 2018-05-18 06:09:40.000000000 +0000 +++ mozilla-devscripts-0.54/amo-changelog 2019-11-03 21:21:49.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Copyright (c) 2014, Jakub Wilk # Copyright (c) 2014, Ximin Luo @@ -15,14 +15,13 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -from __future__ import print_function - import argparse import os import re +import shutil import subprocess import sys -import urllib2 +import urllib import xml.etree.cElementTree as etree URL_TEMPLATE = "https://addons.mozilla.org/en-US/addon/{ext}/versions/format:rss" @@ -30,8 +29,10 @@ HTML_HEAD = "\n{title}\n\n" HTML_FOOT = "\n" + def fix_outgoing_href(match): - return 'href="%s"' % urllib2.unquote(match.group(1)) + return 'href="%s"' % urllib.parse.unquote(match.group(1)) + def convert_rss_to_html(first, source, target): elements = etree.iterparse(source) @@ -68,43 +69,36 @@ print(HTML_FOOT, file=target) return next_url -def which(cmd): - path = os.environ.get("PATH", os.defpath).split(os.pathsep) - for dir in path: - name = os.path.join(dir, cmd) - if (os.path.exists(name) and os.access(name, os.F_OK | os.X_OK) - and not os.path.isdir(name)): - return name - return None def try_external_write(out, args, **kwargs): prog = args[0] - if not which(prog): + if not shutil.which(prog): print("failed to write %s: program not found: %s" % (out, prog), file=sys.stderr) return False try: subprocess.check_call(args, **kwargs) print("wrote %s" % out, file=sys.stderr) return True - except Exception as e: - print("failed to write %s: %s" % (out, e), file=sys.stderr) + except Exception as error: + print("failed to write %s: %s" % (out, error), file=sys.stderr) return False + def main(): parser = argparse.ArgumentParser( description="Fetch Version History of an addon from the Mozilla " - "Extensions website and convert it into a human-readable format.") + "Extensions website and convert it into a human-readable format.") parser.add_argument("extension", - help="Extension short-name, as used on addons.mozilla.org.") + help="Extension short-name, as used on addons.mozilla.org.") parser.add_argument("-f", "--html-file", - metavar="FILE", default="debian/upstream/changelog.html", - help="File to write to. Default: %(default)s.") + metavar="FILE", default="debian/upstream/changelog.html", + help="File to write to. Default: %(default)s.") parser.add_argument("-p", "--plain-format", metavar="FORMAT", - choices=["text", "markdown", "rst"], default="none", - help="Generate a human-readable form of the changelog in the file " - "without the .html extension, using an external program. Possible " - "options are text (uses lynx(1)), markdown (pandoc(1)), or rst " - "(pandoc(1)). Default: %(default)s.") + choices=["text", "markdown", "rst"], default="none", + help="Generate a human-readable form of the changelog in the file " + "without the .html extension, using an external program. Possible " + "options are text (uses lynx(1)), markdown (pandoc(1)), or rst " + "(pandoc(1)). Default: %(default)s.") options = parser.parse_args() progname = os.path.basename(sys.argv[0]) @@ -112,7 +106,7 @@ html_file = options.html_file if not html_file.endswith(".html"): print("%s: Output filename must end with .html: %s" % - (progname, html_file), file=sys.stderr) + (progname, html_file), file=sys.stderr) return 1 plain_file = html_file[:-5] @@ -122,8 +116,8 @@ first = True while url: try: - source = urllib2.urlopen(url) - except urllib2.HTTPError as error: + source = urllib.request.urlopen(url) + except urllib.error.HTTPError as error: print("%s: For extension '%s', error fetching '%s': %s" % (progname, options.extension, url, error), file=sys.stderr) raise @@ -133,36 +127,36 @@ finally: source.close() print("wrote %s" % html_file, file=sys.stderr) - except Exception as e: - print("failed to write %s: %s" % (html_file, e), file=sys.stderr) - #os.remove(html_file) + except Exception as error: + print("failed to write %s: %s" % (html_file, error), file=sys.stderr) + # os.remove(html_file) return 1 if options.plain_format == "text": with open(plain_file, "w") as target: - if not try_external_write(plain_file, - ["lynx", "-dump", "-list_inline", "-width=84", html_file], stdout=target): - #os.remove(plain_file) + cmd = ["lynx", "-dump", "-list_inline", "-width=84", html_file] + if not try_external_write(plain_file, cmd, stdout=target): + # os.remove(plain_file) return 1 - else: - # 2 space indent is a bit more reasonable than lynx's 3 default - # width=84 above (3*2-2) effectively cancels the right margin - subprocess.call(["sed", "-i", "-e", "s/^ / /g", plain_file]) + + # 2 space indent is a bit more reasonable than lynx's 3 default + # width=84 above (3*2-2) effectively cancels the right margin + subprocess.call(["sed", "-i", "-e", "s/^ / /g", plain_file]) elif options.plain_format == "markdown": - if not try_external_write(plain_file, - ["pandoc", "-i", html_file, "--columns=79", "-wmarkdown", "-o", plain_file]): + cmd = ["pandoc", "-i", html_file, "--columns=79", "-wmarkdown", "-o", plain_file] + if not try_external_write(plain_file, cmd): return 1 elif options.plain_format == "rst": - if not try_external_write(plain_file, - ["pandoc", "-i", html_file, "--columns=79", "-wrst", "-o", plain_file]): + cmd = ["pandoc", "-i", html_file, "--columns=79", "-wrst", "-o", plain_file] + if not try_external_write(plain_file, cmd): return 1 - else: - # work around https://github.com/jgm/pandoc/issues/1656 - # by adding two spaces to all line-block continuation lines - subprocess.call(["sed", "-i", "-r", - "-e", r"/^\|/,/^ |^$/{s/^([^ |])/ \1/g}", plain_file]) + + # work around https://github.com/jgm/pandoc/issues/1656 + # by adding two spaces to all line-block continuation lines + subprocess.call(["sed", "-i", "-r", + "-e", r"/^\|/,/^ |^$/{s/^([^ |])/ \1/g}", plain_file]) return 0 diff -Nru mozilla-devscripts-0.53/debian/changelog mozilla-devscripts-0.54/debian/changelog --- mozilla-devscripts-0.53/debian/changelog 2019-09-25 08:39:51.000000000 +0000 +++ mozilla-devscripts-0.54/debian/changelog 2019-11-03 21:43:29.000000000 +0000 @@ -1,8 +1,17 @@ -mozilla-devscripts (0.53-0ubuntu1) eoan; urgency=medium +mozilla-devscripts (0.54) unstable; urgency=medium + [ Olivier Tilloy ] * Fix dh_webext when there is a debian/install-webext file (Closes: #941112) - -- Olivier Tilloy Wed, 25 Sep 2019 10:39:51 +0200 + [ Benjamin Drung ] + * Make pylint happier + * dh_webext: Use logging + * Port amo-changelog and xpi-repack to Python 3 (see Debian bug #937085) + * Bump Standards-Version to 4.4.1 (no changes required) + * Switch to debhelper 12 + * Remove Andrea Veri from uploaders. Thanks for your work. (Closes: #827972) + + -- Benjamin Drung Sun, 03 Nov 2019 22:43:29 +0100 mozilla-devscripts (0.53) unstable; urgency=medium diff -Nru mozilla-devscripts-0.53/debian/compat mozilla-devscripts-0.54/debian/compat --- mozilla-devscripts-0.53/debian/compat 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru mozilla-devscripts-0.53/debian/control mozilla-devscripts-0.54/debian/control --- mozilla-devscripts-0.53/debian/control 2018-09-23 05:39:22.000000000 +0000 +++ mozilla-devscripts-0.54/debian/control 2019-11-03 21:43:16.000000000 +0000 @@ -2,11 +2,13 @@ Section: devel Priority: optional Maintainer: Debian Mozilla Extension Maintainers -Uploaders: Benjamin Drung , Andrea Veri -Build-Depends: debhelper (>= 9), python-all (>= 2.6.6-3~), python-librdf - ,dh-python - ,python3 -Standards-Version: 3.9.8 +Uploaders: Benjamin Drung +Build-Depends: debhelper-compat (= 12), + dh-python, + python-all (>= 2.6.6-3~), + python-librdf, + python3 +Standards-Version: 4.4.1 VCS-Browser: https://salsa.debian.org/webext-team/webext-devscripts VCS-Git: https://salsa.debian.org/webext-team/webext-devscripts.git @@ -17,8 +19,8 @@ zip, ${misc:Depends}, ${perl:Depends}, - ${python:Depends}, - ${python3:Depends} + ${python3:Depends}, + ${python:Depends} Description: Development scripts used by Mozilla's addons packages This package contains mozilla-devscripts, a collection of scripts based on Makefile inheritance meant for packaging Firefox's and diff -Nru mozilla-devscripts-0.53/dh_webext mozilla-devscripts-0.54/dh_webext --- mozilla-devscripts-0.53/dh_webext 2019-09-25 05:10:30.000000000 +0000 +++ mozilla-devscripts-0.54/dh_webext 2019-11-03 21:20:39.000000000 +0000 @@ -31,27 +31,27 @@ ''' import argparse -import datetime import json +import logging import os import shlex import subprocess import sys import time -self_script = "dh_webext" +__script_name__ = "dh_webext" if __name__ == '__main__' else __name__ -app_packages_debian = { - "gecko": [ "firefox", "firefox-esr" ], +APP_PACKAGES_DEBIAN = { + "gecko": ["firefox", "firefox-esr"], "chromium": ["chromium"], # https://bugzilla.mozilla.org/show_bug.cgi?id=1396172 # The patch https://bugzilla.mozilla.org/attachment.cgi?id=8918600 # seems to use "thunderbird" rather than "gecko". not sure if my reading # is correct, someone should follow up on the bug report - "thunderbird": [ "thunderbird", ], + "thunderbird": ["thunderbird"], } -app_extension_paths = { +APP_EXTENSION_PATHS = { "gecko": [ "/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}", ], @@ -61,14 +61,14 @@ "chromium": ["/usr/share/chromium/extensions"], } -def log(*args): - print(self_script + ":", *args) -def run(cmdline, verbose=False): - if verbose: +def run(cmdline): + logger = logging.getLogger(__script_name__) + if logger.isEnabledFor(logging.INFO): print(" ", " ".join(shlex.quote(a) for a in cmdline)) subprocess.check_call(cmdline) + def get_all_packages(): with open("debian/control", encoding="utf-8") as fp: lines = fp.readlines() @@ -80,7 +80,8 @@ "will be generated. THIS IS PROBABLY NOT WHAT YOU WANT.", file=sys.stderr) return packages -def generate_substvars(package, name, supported, verbose=False): + +def generate_substvars(package, name, supported): ext_name = name for prefix in ("webext-",): if ext_name.startswith(prefix): @@ -90,16 +91,18 @@ # TODO: read old file and merge the new values in debian_apps = {deb: minversion - for app, minversion in supported.items() - for deb in app_packages_debian[app]} + for app, minversion in supported.items() + for deb in APP_PACKAGES_DEBIAN[app]} - own_version = subprocess.check_output(["dpkg-parsechangelog", "-SVersion"]).decode("utf-8").strip() + own_version = (subprocess.check_output(["dpkg-parsechangelog", "-SVersion"]) + .decode("utf-8").strip()) - depends = lambda k, v: "%s (>= %s~~)" % (k, v) if v is not None else k - breaks = lambda k, v: "%s (<< %s~~)" % (k, v) + def depends(k, v): + return "%s (>= %s~~)" % (k, v) if v is not None else k + # breaks = lambda k, v: "%s (<< %s~~)" % (k, v) meta = { "recommends": [" | ".join(sorted(depends(k, v) for k, v in debian_apps.items()))], - #"breaks": sorted(breaks(k, v) for k, v in debian_apps.items() if v), + # "breaks": sorted(breaks(k, v) for k, v in debian_apps.items() if v), "enhances": sorted(debian_apps.keys()), "provides": ["%s-%s (= %s)" % (prefix, ext_name, own_version) for prefix in debian_apps], } @@ -110,10 +113,11 @@ with open(filename, 'w+', encoding="utf-8") as fp: fp.writelines(lines) -def install_for_app(extname, appname, appextname, verbose=False): - for p in app_extension_paths[appname]: - run(["dh_link", "/usr/share/webext/%s" % extname, - os.path.join(p, appextname)], verbose=verbose) + +def install_for_app(extname, appname, appextname): + for p in APP_EXTENSION_PATHS[appname]: + run(["dh_link", "/usr/share/webext/%s" % extname, os.path.join(p, appextname)]) + def install_webext(*args): parser = argparse.ArgumentParser( @@ -123,11 +127,11 @@ help='Act on the specified binary PACKAGE(s). Default: all packages ' 'that start with the "webext-" prefix.') parser.add_argument( - "-I", "--dh-install-arg", dest="dh_install_args", metavar="ARG", action="append", default=[], - help="extra arguments to pass to dh_install") + "-I", "--dh-install-arg", dest="dh_install_args", metavar="ARG", action="append", + default=[], help="extra arguments to pass to dh_install") parser.add_argument( - "-v", "--verbose", action="store_true", dest="verbose", default=True, - help="print more information") + "-v", "--verbose", action="store_const", dest="log_level", default=logging.WARNING, + const=logging.INFO, help="print more information") parser.add_argument( 'home', metavar='PATH', nargs='?', default=None, help='Path to the source directory to install. Default: search the ' @@ -142,8 +146,10 @@ # for an example and `man debhelper` "COMMON DEBHELPER OPTIONS" for full list # TODO: import any useful options like -x from install-xpi args, unknown = parser.parse_known_args(args) + logging.basicConfig(format='%(name)s: %(message)s', level=args.log_level) + logger = logging.getLogger(__script_name__) if unknown: - log("Ignored some command-line arguments: %r" % unknown) + logger.warning("Ignored some command-line arguments: %r", unknown) packages = args.packages or get_all_packages() home = args.home @@ -156,10 +162,10 @@ candidates = [x.strip() for x in candidates.decode("utf-8").splitlines() if x.strip()] if len(candidates) == 1: home = os.path.dirname(candidates[0]) - log("Found 1 manifest.json, source PATH set to %s" % home) + logger.warning("Found 1 manifest.json, source PATH set to %s", home) else: home = "." - log("Found != 1 manifest.json, source PATH set to .") + logger.warning("Found != 1 manifest.json, source PATH set to .") manifest = os.path.join(home, "manifest.json") if not os.path.exists(manifest): @@ -176,28 +182,29 @@ if name is None: if packages[0].startswith("webext-"): name = packages[0][7:] - log("Set NAME to %s from package %s" % (name, packages[0])) + logger.warning("Set NAME to %s from package %s", name, packages[0]) else: name = manifest["name"] - log('Set NAME to %s from manifest.json "name" field' % name) + logger.warning('Set NAME to %s from manifest.json "name" field', name) if name.startswith("_"): - raise ValueError("name in manifest.json starts with _, please give actual name to %s" % self_script) + raise ValueError("name in manifest.json starts with _, " + "please give actual name to %s" % __script_name__) run(["dh_install", "-X.git", "-X.pc", "-Xdebian"] + args.dh_install_args + - [home, "usr/share/webext/%s" % name], verbose=args.verbose) + [home, "usr/share/webext/%s" % name]) supported = {} for appname, details in list(manifest["applications"].items()): - if appname in app_extension_paths: - install_for_app(name, appname, details["id"], args.verbose) + if appname in APP_EXTENSION_PATHS: + install_for_app(name, appname, details["id"]) supported[appname] = details.get("strict_min_version", - "57" if appname == "gecko" else None) + "57" if appname == "gecko" else None) else: - log("unrecognised application in manifest: %s", appname) + logger.warning("unrecognised application in manifest: %s", appname) if "minimum_chrome_version" in manifest: - install_for_app(name, "chromium", name, args.verbose) + install_for_app(name, "chromium", name) supported["chromium"] = manifest["minimum_chrome_version"] if os.path.exists("debian/install-webext"): @@ -208,13 +215,14 @@ appname, extid = line.split(" ") else: appname, extid = line, name - install_for_app(name, appname, extid, args.verbose) + install_for_app(name, appname, extid) for package in packages: - generate_substvars(package, name, supported, args.verbose) + generate_substvars(package, name, supported) return 0 return 1 + if __name__ == '__main__': sys.exit(install_webext(*sys.argv[1:])) diff -Nru mozilla-devscripts-0.53/dh_xul-ext mozilla-devscripts-0.54/dh_xul-ext --- mozilla-devscripts-0.53/dh_xul-ext 2018-05-18 06:09:40.000000000 +0000 +++ mozilla-devscripts-0.54/dh_xul-ext 2019-11-03 21:11:12.000000000 +0000 @@ -21,11 +21,11 @@ import subprocess import sys +import RDF + from moz_version import (compare_versions, convert_moz_to_debian_version, moz_to_next_debian_version) -import RDF - _VENDOR_ENV = "DH_XUL_EXT_VENDOR" # error codes COMMAND_LINE_SYNTAX_ERROR = 1 @@ -61,8 +61,8 @@ and self.xul_id == THUNDERBIRD_ID and compare_versions(version, "24") >= 0): return 1 - else: - return 0 + + return 0 def defaults_to_compatible(self): """Returns true if the maximum and all later versions of the XUL @@ -295,7 +295,7 @@ # check if MOZ_XPI_EXT_NAME is defined in debian/rules lines = open("debian/rules").readlines() lines = [l for l in lines if l.find("MOZ_XPI_EXT_NAME") != -1] - if len(lines) > 0: + if lines: line = lines[-1] ext_name = line[line.find("=")+1:].strip() @@ -336,7 +336,7 @@ def generate_substvars(script_name, xul_apps, package, verbose=False): install_rdfs = find_install_rdfs("debian/" + package) - if len(install_rdfs) == 0: + if not install_rdfs: if verbose: print(script_name + ": " + package + " does not contain a XUL extension (no install.rdf found).") @@ -392,7 +392,7 @@ def _process_long_opt(self, rargs, values): option = rargs[0].split("=")[0] - if not option in self._long_opt: + if option not in self._long_opt: self.unknown_options.append(option) del rargs[0] else: @@ -422,7 +422,7 @@ options = parser.parse_args()[0] - if len(options.packages) == 0: + if not options.packages: options.packages = get_all_packages() if options.verbose: @@ -432,7 +432,7 @@ print script_name + ": packages:", ", ".join(options.packages) xul_apps = get_xul_apps(script_name, options.all) - if options.verbose and len(xul_apps) > 0: + if options.verbose and xul_apps: print script_name + ": found %i Xul applications:" % (len(xul_apps)) for xul_app in xul_apps: print xul_app @@ -440,5 +440,6 @@ for package in options.packages: generate_substvars(script_name, xul_apps, package, options.verbose) + if __name__ == "__main__": main() diff -Nru mozilla-devscripts-0.53/install-xpi mozilla-devscripts-0.54/install-xpi --- mozilla-devscripts-0.53/install-xpi 2018-05-18 06:09:40.000000000 +0000 +++ mozilla-devscripts-0.54/install-xpi 2019-11-03 21:11:12.000000000 +0000 @@ -98,12 +98,9 @@ def get_arch(package, debian_directory): lines = open(os.path.join(debian_directory, "control")).readlines() - package_lines = filter(lambda x: x.find("Package:") >= 0, lines) - packages = map(lambda x: x[x.find(":")+1:].strip(), package_lines) - architecture_lines = filter(lambda x: x.find("Architecture:") >= 0, lines) - architectures = map(lambda x: x[x.find(":")+1:].strip(), architecture_lines) - (_, arch) = filter(lambda (x, y): x == package, - zip(packages, architectures))[0] + packages = [x[x.find(":")+1:].strip() for x in lines if x.find("Package:") >= 0] + architectures = [x[x.find(":")+1:].strip() for x in lines if x.find("Architecture:") >= 0] + arch = [a for (p, a) in zip(packages, architectures) if p == package][0] return arch @@ -147,7 +144,7 @@ # remove documented license files if remove_licenses: - for name in filter(lambda x: not x.endswith('/'), xpi_content): + for name in [x for x in xpi_content if not x.endswith('/')]: basename = os.path.basename(name).lower() if basename in LICENSE_PATTERN_LIST: exclude.append(name) @@ -160,7 +157,7 @@ # which prevents reproducible builds. Let's make it UTC before unzipping. os.environ['TZ'] = 'UTC' command = ["unzip", "-o", "-d", copy_dir, xpi_file] - if len(exclude) > 0: + if exclude: command.append("-x") command.extend(exclude) print(" ".join(command)) @@ -193,9 +190,9 @@ if system_prefs: # search for preference .js files in defaults/preferences/ pref_dir = os.path.join("defaults", "preferences") - preferences = filter(lambda f: os.path.dirname(f) == pref_dir and - f.endswith(".js"), xpi_content) - if len(preferences) > 0: + preferences = [f for f in xpi_content + if os.path.dirname(f) == pref_dir and f.endswith(".js")] + if preferences: prefdir = os.path.join("etc", "xul-ext") full_prefdir = os.path.join(debian_directory, package, prefdir) if not os.path.exists(full_prefdir): @@ -216,9 +213,8 @@ " in this file.\n") f.write("// You can override here the preferences specified " "in\n") - map(lambda x: f.write("// " + - os.path.join("/", install_dir, x) + - "\n"), preferences) + for preference in preferences: + f.write("// " + os.path.join("/", install_dir, preference) + "\n") f.close() link_source = os.path.join(prefdir, prefname) link_target = os.path.join(install_dir, "defaults", "preferences", @@ -251,8 +247,7 @@ def get_first_package(debian_directory): lines = open(os.path.join(debian_directory, "control")).readlines() - package_lines = filter(lambda x: x.find("Package:") >= 0, lines) - packages = map(lambda x: x[x.find(":")+1:].strip(), package_lines) + packages = [x[x.find(":")+1:].strip() for x in lines if x.find("Package:") >= 0] return packages[0] @@ -288,7 +283,7 @@ (options, args) = parser.parse_args() - if len(args) == 0: + if not args: print("%s: Error: No xpi file specified." % (script_name), file=sys.stderr) sys.exit(COMMAND_LINE_SYNTAX_ERROR) @@ -311,5 +306,6 @@ options.correct_permissions, options.remove_licenses, options.system_prefs, debian_directory, options.verbose) + if __name__ == "__main__": main() diff -Nru mozilla-devscripts-0.53/moz-version mozilla-devscripts-0.54/moz-version --- mozilla-devscripts-0.53/moz-version 2014-05-17 15:25:50.000000000 +0000 +++ mozilla-devscripts-0.54/moz-version 2019-11-03 21:11:12.000000000 +0000 @@ -63,6 +63,7 @@ return compare_versions(version1, version2, verbose) >= 0 elif comparator == "gt": return compare_versions(version1, version2, verbose) > 0 + raise NotImplementedError("Comparator '%s' not implemented." % (comparator)) def usage(output): diff -Nru mozilla-devscripts-0.53/setup.py mozilla-devscripts-0.54/setup.py --- mozilla-devscripts-0.53/setup.py 2018-09-23 05:18:02.000000000 +0000 +++ mozilla-devscripts-0.54/setup.py 2019-11-03 21:21:36.000000000 +0000 @@ -18,19 +18,20 @@ version = match.group(1) return version + SCRIPTS = [ - 'amo-changelog', 'dh_xul-ext', 'install-xpi', 'xpi-pack', - 'xpi-repack', 'xpi-unpack', 'moz-version', ] # need to treat these separately, else setuptools fucks with the shebang lines PY3_SCRIPTS = [ + 'amo-changelog', 'dh_webext', + 'xpi-repack', ] if __name__ == '__main__': @@ -46,7 +47,6 @@ ('share/mozilla-devscripts', ['data/xpi.mk'] + glob.glob('data/xul-app-data.csv.*')), ('share/perl5/Debian/Debhelper/Buildsystem', ['perl/Debian/Buildsystem/xul_ext.pm']), ('share/perl5/Debian/Debhelper/Sequence', - ['perl/Debian/Sequence/xul_ext.pm', - 'perl/Debian/Sequence/webext.pm']), + ['perl/Debian/Sequence/xul_ext.pm', 'perl/Debian/Sequence/webext.pm']), ], ) diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/all/debian/compat mozilla-devscripts-0.54/tests/dh_xul-ext/all/debian/compat --- mozilla-devscripts-0.53/tests/dh_xul-ext/all/debian/compat 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/all/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7 diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/all/debian/control mozilla-devscripts-0.54/tests/dh_xul-ext/all/debian/control --- mozilla-devscripts-0.53/tests/dh_xul-ext/all/debian/control 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/all/debian/control 2019-11-03 21:33:31.000000000 +0000 @@ -2,8 +2,8 @@ Section: web Priority: extra Maintainer: Ubuntu Mozilla Team -Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~) -Standards-Version: 3.9.2 +Build-Depends: debhelper-compat (= 12), mozilla-devscripts (>= 0.22~) +Standards-Version: 4.4.1 Package: xul-ext-test-package Architecture: all diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/all_environment/debian/compat mozilla-devscripts-0.54/tests/dh_xul-ext/all_environment/debian/compat --- mozilla-devscripts-0.53/tests/dh_xul-ext/all_environment/debian/compat 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/all_environment/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7 diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/all_environment/debian/control mozilla-devscripts-0.54/tests/dh_xul-ext/all_environment/debian/control --- mozilla-devscripts-0.53/tests/dh_xul-ext/all_environment/debian/control 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/all_environment/debian/control 2019-11-03 21:33:31.000000000 +0000 @@ -2,8 +2,8 @@ Section: web Priority: extra Maintainer: Ubuntu Mozilla Team -Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~) -Standards-Version: 3.9.2 +Build-Depends: debhelper-compat (= 12), mozilla-devscripts (>= 0.22~) +Standards-Version: 4.4.1 Package: xul-ext-test-package Architecture: all diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/debian/debian/compat mozilla-devscripts-0.54/tests/dh_xul-ext/debian/debian/compat --- mozilla-devscripts-0.53/tests/dh_xul-ext/debian/debian/compat 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/debian/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7 diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/debian/debian/control mozilla-devscripts-0.54/tests/dh_xul-ext/debian/debian/control --- mozilla-devscripts-0.53/tests/dh_xul-ext/debian/debian/control 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/debian/debian/control 2019-11-03 21:33:31.000000000 +0000 @@ -2,8 +2,8 @@ Section: web Priority: extra Maintainer: Ubuntu Mozilla Team -Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~) -Standards-Version: 3.9.2 +Build-Depends: debhelper-compat (= 12), mozilla-devscripts (>= 0.22~) +Standards-Version: 4.4.1 Package: xul-ext-test-package Architecture: all diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/default-to-compatible/debian/compat mozilla-devscripts-0.54/tests/dh_xul-ext/default-to-compatible/debian/compat --- mozilla-devscripts-0.53/tests/dh_xul-ext/default-to-compatible/debian/compat 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/default-to-compatible/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7 diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/default-to-compatible/debian/control mozilla-devscripts-0.54/tests/dh_xul-ext/default-to-compatible/debian/control --- mozilla-devscripts-0.53/tests/dh_xul-ext/default-to-compatible/debian/control 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/default-to-compatible/debian/control 2019-11-03 21:33:31.000000000 +0000 @@ -2,8 +2,8 @@ Section: web Priority: extra Maintainer: Ubuntu Mozilla Team -Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~) -Standards-Version: 3.9.2 +Build-Depends: debhelper-compat (= 12), mozilla-devscripts (>= 0.22~) +Standards-Version: 4.4.1 Package: xul-ext-test-package Architecture: all diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/test mozilla-devscripts-0.54/tests/dh_xul-ext/test --- mozilla-devscripts-0.53/tests/dh_xul-ext/test 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/test 2019-11-03 21:11:12.000000000 +0000 @@ -20,33 +20,39 @@ TESTS = ("all", "all_environment", "debian", "default-to-compatible", "ubuntu") + class TestError(Exception): pass + def escape_arg(arg): "Shell-escpae arg, if necessary" if ' ' not in arg: return arg return '"%s"' % arg.replace('\\', r'\\').replace('"', r'\"') + def fail(message): print >> sys.stderr, "dh_xul-ext test error: " + message sys.exit(1) + def check_call(cmd, cwd=None): return_code = subprocess.call(cmd, cwd=cwd) if return_code != 0: - raise TestError("'" + " ".join(escape_arg(cmd)) + "' returned " + + raise TestError("'" + " ".join(escape_arg(cmd)) + "' returned " + str(return_code) + ".") + def compare_files(file1, file2): actual = open(file1).read().strip() expected = open(file2).read().strip() if actual != expected: raise TestError("\033[91m Actual substvars files differs from expected file.\n" - "Expected content:\n" + expected + "\n" + \ + "Expected content:\n" + expected + "\n" + "Actual content:\n" + actual + "\033[0m") + def test_dh_xul_ext(test): basedir = os.path.dirname(__file__) testdir = os.path.join(basedir, test) @@ -62,6 +68,7 @@ finally: check_call(clean_cmd, cwd=testdir) + def main(): errors = 0 for test in TESTS: @@ -74,5 +81,6 @@ if errors > 0: sys.exit(1) + if __name__ == "__main__": main() diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/ubuntu/debian/compat mozilla-devscripts-0.54/tests/dh_xul-ext/ubuntu/debian/compat --- mozilla-devscripts-0.53/tests/dh_xul-ext/ubuntu/debian/compat 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/ubuntu/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7 diff -Nru mozilla-devscripts-0.53/tests/dh_xul-ext/ubuntu/debian/control mozilla-devscripts-0.54/tests/dh_xul-ext/ubuntu/debian/control --- mozilla-devscripts-0.53/tests/dh_xul-ext/ubuntu/debian/control 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/dh_xul-ext/ubuntu/debian/control 2019-11-03 21:33:31.000000000 +0000 @@ -2,8 +2,8 @@ Section: web Priority: extra Maintainer: Ubuntu Mozilla Team -Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~) -Standards-Version: 3.9.2 +Build-Depends: debhelper-compat (= 12), mozilla-devscripts (>= 0.22~) +Standards-Version: 4.4.1 Package: xul-ext-test-package Architecture: all diff -Nru mozilla-devscripts-0.53/tests/test-moz-version mozilla-devscripts-0.54/tests/test-moz-version --- mozilla-devscripts-0.53/tests/test-moz-version 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/tests/test-moz-version 2019-11-03 21:11:12.000000000 +0000 @@ -11,7 +11,7 @@ # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -60,10 +60,12 @@ ("1.*.1", "gt", "2.0", False), ) + def fail(message): print >> sys.stderr, "E: " + message sys.exit(TEST_FAILED_ERROR) + def test_compare(verbose=False): for pattern in TEST_PATTERN: compare_result = compare_versions(pattern[0], pattern[2], verbose) @@ -82,13 +84,14 @@ else: fail('Unknown pattern %s.' % (pattern[1])) + def main(): try: long_opts = ["verbose"] opts = getopt.gnu_getopt(sys.argv[1:], "v", long_opts)[0] - except getopt.GetoptError, e: + except getopt.GetoptError as error: # print help information and exit: - print >> sys.stderr, str(e) + print >> sys.stderr, str(error) sys.exit(COMMAND_LINE_SYNTAX_ERROR) verbose = False @@ -101,5 +104,6 @@ test_compare(verbose) + if __name__ == "__main__": main() diff -Nru mozilla-devscripts-0.53/xpi-repack mozilla-devscripts-0.54/xpi-repack --- mozilla-devscripts-0.53/xpi-repack 2014-04-28 18:38:50.000000000 +0000 +++ mozilla-devscripts-0.54/xpi-repack 2019-11-03 21:21:36.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Copyright (c) 2010-2014, Benjamin Drung # @@ -58,7 +58,7 @@ full_tar_file = os.path.join(directory, tar_file) cmd = ["tar", "-ca", "-C", tmp_dir, "-f", full_tar_file, extract_dir] if verbose: - print " ".join(cmd) + print(" ".join(cmd)) subprocess.check_call(cmd) finally: # remove temporary directory @@ -101,5 +101,6 @@ repack_xpi(args.package, args.version, args.xpi_file, args.format, args.verbose) + if __name__ == "__main__": main()