From ebbaada218a0ed2202c16c358f7207f1697a6363 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Sat, 25 Jun 2011 16:20:22 +0200 Subject: [PATCH] Add experimental to list of Debian distributions. --- bash_completion/pbuilder-dist | 2 +- data/debian.csv | 1 + debian/changelog | 5 ++++- pbuilder-dist | 2 +- ubuntutools/distro_info.py | 20 ++++++++++++++++---- ubuntutools/test/test_distro_info.py | 5 +++-- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/bash_completion/pbuilder-dist b/bash_completion/pbuilder-dist index 423e284..4a12d0e 100644 --- a/bash_completion/pbuilder-dist +++ b/bash_completion/pbuilder-dist @@ -33,7 +33,7 @@ _pbuilder-dist() [ "$have" ] && _pbuilder-aliases() { local distro builder arch - for distro in $(ubuntu-distro-info --all; debian-distro-info --all) stable testing unstable experimental; do + for distro in $(ubuntu-distro-info --all; debian-distro-info --all) stable testing unstable; do for builder in pbuilder cowbuilder; do echo "$builder-$distro" for arch in i386 amd64 armel; do diff --git a/data/debian.csv b/data/debian.csv index 16dfb3d..ea01740 100644 --- a/data/debian.csv +++ b/data/debian.csv @@ -12,3 +12,4 @@ version,codename,series,created,release,eol 6.0,Squeeze,squeeze,2009-02-14,2011-02-06 7.0,Wheezy,wheezy,2011-02-06 ,Sid,sid,1993-08-16 +,Experimental,experimental,1993-08-16 diff --git a/debian/changelog b/debian/changelog index 296af7b..86932dc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,7 +19,10 @@ ubuntu-dev-tools (0.126) UNRELEASED; urgency=low * submittodebian: Write a usable .reportbugrc if it doesn't exist. (LP: #800429) - -- Evan Broder Sat, 11 Jun 2011 05:11:23 -0700 + [ Benjamin Drung ] + * Add experimental to list of Debian distributions. + + -- Benjamin Drung Sat, 25 Jun 2011 16:19:08 +0200 ubuntu-dev-tools (0.125ubuntu1) oneiric; urgency=low diff --git a/pbuilder-dist b/pbuilder-dist index f80945a..f6c2fa1 100755 --- a/pbuilder-dist +++ b/pbuilder-dist @@ -77,7 +77,7 @@ class PbuilderDist: self.builder = builder self._debian_distros = DebianDistroInfo().all + \ - ['stable', 'testing', 'unstable', 'experimental'] + ['stable', 'testing', 'unstable'] # Ensure that the used builder is installed diff --git a/ubuntutools/distro_info.py b/ubuntutools/distro_info.py index 87d4987..d8e2824 100644 --- a/ubuntutools/distro_info.py +++ b/ubuntutools/distro_info.py @@ -144,6 +144,18 @@ class DebianDistroInfo(DistroInfo): codename = default return codename + def devel(self, date=None): + """Get latest development distribution based on the given date.""" + if date is None: + date = self._date + distros = [x for x in self._avail(date) + if x["release"] is None or + (date < x["release"] and + (x["eol"] is None or date <= x["eol"]))] + if len(distros) < 2: + raise DistroDataOutdated() + return distros[-2]["series"] + def old(self, date=None): """Get old (stable) Debian distribution based on the given date.""" if date is None: @@ -168,12 +180,12 @@ class DebianDistroInfo(DistroInfo): if date is None: date = self._date distros = [x for x in self._avail(date) - if x["release"] is None or - (date < x["release"] and + if (x["release"] is None and x["version"]) or + (x["release"] is not None and date < x["release"] and (x["eol"] is None or date <= x["eol"]))] - if len(distros) < 2: + if not distros: raise DistroDataOutdated() - return distros[-2]["series"] + return distros[-1]["series"] def valid(self, codename): """Check if the given codename is known.""" diff --git a/ubuntutools/test/test_distro_info.py b/ubuntutools/test/test_distro_info.py index 7e0a376..c9465ab 100644 --- a/ubuntutools/test/test_distro_info.py +++ b/ubuntutools/test/test_distro_info.py @@ -34,7 +34,8 @@ class DebianDistroInfoTestCase(unittest.TestCase): def test_all(self): """Test: List all known Debian distributions.""" all_distros = set(["buzz", "rex", "bo", "hamm", "slink", "potato", - "woody", "sarge", "etch", "lenny", "squeeze", "sid"]) + "woody", "sarge", "etch", "lenny", "squeeze", "sid", + "experimental"]) self.assertEqual(all_distros - set(self._distro_info.all), set()) def test_devel(self): @@ -52,7 +53,7 @@ class DebianDistroInfoTestCase(unittest.TestCase): def test_supported(self): """Test: List all supported Debian distribution.""" self.assertEqual(self._distro_info.supported(self._date), - ["lenny", "squeeze", "sid"]) + ["lenny", "squeeze", "sid", "experimental"]) def test_testing(self): """Test: Get latest testing Debian distribution."""