From 69fa5a271fa68527b5c67ccb314588a3a1bdfb17 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Wed, 23 May 2012 21:29:56 +0200 Subject: dh_xul-ext: Do not generate a Breaks entry for Firefox/Iceweasel 10 or later. Firefox/Iceweasel 10 defaults add-ons to compatible. --- dh_xul-ext | 15 ++++++++++++++- tests/dh_xul-ext/all/debian/control | 1 + tests/dh_xul-ext/all_environment/debian/control | 1 + tests/dh_xul-ext/debian/debian/control | 1 + .../dh_xul-ext/default-to-compatible/debian/changelog | 5 +++++ tests/dh_xul-ext/default-to-compatible/debian/compat | 1 + tests/dh_xul-ext/default-to-compatible/debian/control | 18 ++++++++++++++++++ tests/dh_xul-ext/default-to-compatible/debian/rules | 8 ++++++++ tests/dh_xul-ext/default-to-compatible/install.rdf | 16 ++++++++++++++++ .../expected_result/default-to-compatible.substvars | 5 +++++ tests/dh_xul-ext/test | 2 +- tests/dh_xul-ext/ubuntu/debian/control | 1 + 12 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 tests/dh_xul-ext/default-to-compatible/debian/changelog create mode 100644 tests/dh_xul-ext/default-to-compatible/debian/compat create mode 100644 tests/dh_xul-ext/default-to-compatible/debian/control create mode 100755 tests/dh_xul-ext/default-to-compatible/debian/rules create mode 100644 tests/dh_xul-ext/default-to-compatible/install.rdf create mode 100644 tests/dh_xul-ext/expected_result/default-to-compatible.substvars diff --git a/dh_xul-ext b/dh_xul-ext index 6876988..e995174 100755 --- a/dh_xul-ext +++ b/dh_xul-ext @@ -44,13 +44,26 @@ class XulApp(object): return self.xul_id + ": " + self.package + " (" + self.sol + " to " + \ self.eol + ")" + def defaults_to_compatible(self): + """Returns true if the maximum and all later versions of the XUL + application defaults add-ons to compatible. The XUL extension will be + enabled even if the version of the XUL application is higher than the + specified maximum version in this case. + + Firefox/Iceweasel 10 defaults add-ons to compatible.""" + + if self.xul_id == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" and \ + compare_versions(self.max_version, "10") >= 0: + return True + return False + def get_breaks(self): """Return a string for ${xpi:Breaks} for the XUL application.""" breaks = [] if self.min_version: deb_min_version = convert_moz_to_debian_version(self.min_version) breaks.append(self.package + " (<< " + deb_min_version + ")") - if self.max_version: + if self.max_version and not self.defaults_to_compatible(): deb_max_version = moz_to_next_debian_version(self.max_version) breaks.append(self.package + " (>> " + deb_max_version + ")") return ", ".join(breaks) diff --git a/tests/dh_xul-ext/all/debian/control b/tests/dh_xul-ext/all/debian/control index 346ceba..1aea594 100644 --- a/tests/dh_xul-ext/all/debian/control +++ b/tests/dh_xul-ext/all/debian/control @@ -11,6 +11,7 @@ Depends: ${misc:Depends}, ${xpi:Depends} Recommends: ${xpi:Recommends} Provides: ${xpi:Provides} Enhances: ${xpi:Enhances} +Breaks: ${xpi:Breaks} Description: mozilla-devscripts test package This is a test package designed to test some scripts in mozilla-devscripts. It is part of the mozilla-devscripts test suite and may do very odd things. It diff --git a/tests/dh_xul-ext/all_environment/debian/control b/tests/dh_xul-ext/all_environment/debian/control index 346ceba..1aea594 100644 --- a/tests/dh_xul-ext/all_environment/debian/control +++ b/tests/dh_xul-ext/all_environment/debian/control @@ -11,6 +11,7 @@ Depends: ${misc:Depends}, ${xpi:Depends} Recommends: ${xpi:Recommends} Provides: ${xpi:Provides} Enhances: ${xpi:Enhances} +Breaks: ${xpi:Breaks} Description: mozilla-devscripts test package This is a test package designed to test some scripts in mozilla-devscripts. It is part of the mozilla-devscripts test suite and may do very odd things. It diff --git a/tests/dh_xul-ext/debian/debian/control b/tests/dh_xul-ext/debian/debian/control index 346ceba..1aea594 100644 --- a/tests/dh_xul-ext/debian/debian/control +++ b/tests/dh_xul-ext/debian/debian/control @@ -11,6 +11,7 @@ Depends: ${misc:Depends}, ${xpi:Depends} Recommends: ${xpi:Recommends} Provides: ${xpi:Provides} Enhances: ${xpi:Enhances} +Breaks: ${xpi:Breaks} Description: mozilla-devscripts test package This is a test package designed to test some scripts in mozilla-devscripts. It is part of the mozilla-devscripts test suite and may do very odd things. It diff --git a/tests/dh_xul-ext/default-to-compatible/debian/changelog b/tests/dh_xul-ext/default-to-compatible/debian/changelog new file mode 100644 index 0000000..1b45ee9 --- /dev/null +++ b/tests/dh_xul-ext/default-to-compatible/debian/changelog @@ -0,0 +1,5 @@ +test-package (1.0-1) UNRELEASED; urgency=low + + * Initial release. + + -- Benjamin Drung Sat, 09 Jul 2011 12:55:23 +0200 diff --git a/tests/dh_xul-ext/default-to-compatible/debian/compat b/tests/dh_xul-ext/default-to-compatible/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/tests/dh_xul-ext/default-to-compatible/debian/compat @@ -0,0 +1 @@ +7 diff --git a/tests/dh_xul-ext/default-to-compatible/debian/control b/tests/dh_xul-ext/default-to-compatible/debian/control new file mode 100644 index 0000000..1aea594 --- /dev/null +++ b/tests/dh_xul-ext/default-to-compatible/debian/control @@ -0,0 +1,18 @@ +Source: test-package +Section: web +Priority: extra +Maintainer: Ubuntu Mozilla Team +Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~) +Standards-Version: 3.9.2 + +Package: xul-ext-test-package +Architecture: all +Depends: ${misc:Depends}, ${xpi:Depends} +Recommends: ${xpi:Recommends} +Provides: ${xpi:Provides} +Enhances: ${xpi:Enhances} +Breaks: ${xpi:Breaks} +Description: mozilla-devscripts test package + This is a test package designed to test some scripts in mozilla-devscripts. + It is part of the mozilla-devscripts test suite and may do very odd things. It + should not be installed like a regular package. It may be an empty package. diff --git a/tests/dh_xul-ext/default-to-compatible/debian/rules b/tests/dh_xul-ext/default-to-compatible/debian/rules new file mode 100755 index 0000000..26712f4 --- /dev/null +++ b/tests/dh_xul-ext/default-to-compatible/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_install: + dh_install install.rdf /usr/share/xul-ext/test-package/ + DEB_VENDOR=Debian ../../../dh_xul-ext diff --git a/tests/dh_xul-ext/default-to-compatible/install.rdf b/tests/dh_xul-ext/default-to-compatible/install.rdf new file mode 100644 index 0000000..660f7e1 --- /dev/null +++ b/tests/dh_xul-ext/default-to-compatible/install.rdf @@ -0,0 +1,16 @@ + + + + {deadda7a-fee1-dead-coo1-d00ddeadc0de} + 1.0 + mozilla-devscripts test package + + + + {ec8030f7-c20a-464f-9b0e-13a3a9e97384} + 4.0 + 11 + + + + diff --git a/tests/dh_xul-ext/expected_result/default-to-compatible.substvars b/tests/dh_xul-ext/expected_result/default-to-compatible.substvars new file mode 100644 index 0000000..eeb600b --- /dev/null +++ b/tests/dh_xul-ext/expected_result/default-to-compatible.substvars @@ -0,0 +1,5 @@ +xpi:Depends=iceweasel (>= 4.0) +xpi:Recommends= +xpi:Breaks=iceweasel (<< 4.0) +xpi:Enhances=iceweasel +xpi:Provides=iceweasel-test-package, test-package diff --git a/tests/dh_xul-ext/test b/tests/dh_xul-ext/test index 7da0433..02085b8 100755 --- a/tests/dh_xul-ext/test +++ b/tests/dh_xul-ext/test @@ -18,7 +18,7 @@ import os import sys import subprocess -TESTS = ("all", "all_environment", "debian", "ubuntu") +TESTS = ("all", "all_environment", "debian", "default-to-compatible", "ubuntu") class TestError(Exception): pass diff --git a/tests/dh_xul-ext/ubuntu/debian/control b/tests/dh_xul-ext/ubuntu/debian/control index 346ceba..1aea594 100644 --- a/tests/dh_xul-ext/ubuntu/debian/control +++ b/tests/dh_xul-ext/ubuntu/debian/control @@ -11,6 +11,7 @@ Depends: ${misc:Depends}, ${xpi:Depends} Recommends: ${xpi:Recommends} Provides: ${xpi:Provides} Enhances: ${xpi:Enhances} +Breaks: ${xpi:Breaks} Description: mozilla-devscripts test package This is a test package designed to test some scripts in mozilla-devscripts. It is part of the mozilla-devscripts test suite and may do very odd things. It -- cgit v1.2.3