diff --git a/data/debian.csv b/data/debian.csv index 116aa78..16dfb3d 100644 --- a/data/debian.csv +++ b/data/debian.csv @@ -1,14 +1,14 @@ -version,codename,series,release,eol -1.1,Buzz,buzz,1996-06-17,1997-06-05 -1.2,Rex,rex,1996-12-12,1998-06-05 -1.3,Bo,bo,1997-06-05,1999-03-09 -2.0,Hamm,hamm,1998-07-24,2000-03-09 -2.1,Slink,slink,1999-03-09,2000-10-30 -2.2,Potato,potato,2000-08-15,2003-07-30 -3.0,Woody,woody,2002-07-19,2006-06-30 -3.1,Sarge,sarge,2005-06-06,2008-03-30 -4.0,Etch,etch,2007-04-08,2010-02-15 -5.0,Lenny,lenny,2009-02-14,2012-02-06 -6.0,Squeeze,squeeze,2011-02-06 -7.0,Wheezy,wheezy -,Sid,sid +version,codename,series,created,release,eol +1.1,Buzz,buzz,1993-08-16,1996-06-17,1997-06-05 +1.2,Rex,rex,1996-06-17,1996-12-12,1998-06-05 +1.3,Bo,bo,1996-12-12,1997-06-05,1999-03-09 +2.0,Hamm,hamm,1997-06-05,1998-07-24,2000-03-09 +2.1,Slink,slink,1998-07-24,1999-03-09,2000-10-30 +2.2,Potato,potato,1999-03-09,2000-08-15,2003-07-30 +3.0,Woody,woody,2000-08-15,2002-07-19,2006-06-30 +3.1,Sarge,sarge,2002-07-19,2005-06-06,2008-03-30 +4.0,Etch,etch,2005-06-06,2007-04-08,2010-02-15 +5.0,Lenny,lenny,2007-04-08,2009-02-14,2012-02-06 +6.0,Squeeze,squeeze,2009-02-14,2011-02-06 +7.0,Wheezy,wheezy,2011-02-06 +,Sid,sid,1993-08-16 diff --git a/data/ubuntu.csv b/data/ubuntu.csv index 64a88d0..457369a 100644 --- a/data/ubuntu.csv +++ b/data/ubuntu.csv @@ -1,15 +1,15 @@ -version,codename,series,release,eol,eol-server -4.10,Warty Warthog,warty,2004-10-20,2006-04-30 -5.04,Hoary Hedgehog,hoary,2005-04-08,2006-10-31 -5.10,Breezy Badger,breezy,2005-10-13,2007-04-13 -6.06 LTS,Dapper Drake,dapper,2006-06-01,2009-07-14,2011-06-01 -6.10,Edgy Eft,edgy,2006-10-26,2008-04-25 -7.04,Feisty Fawn,feisty,2007-04-19,2008-10-19 -7.10,Gutsy Gibbon,gutsy,2007-10-18,2009-04-18 -8.04 LTS,Hardy Heron,hardy,2008-04-24,2011-04,2013-04 -8.10,Intrepid Ibex,intrepid,2008-10-30,2010-04-30 -9.04,Jaunty Jackalope,jaunty,2009-04-23,2010-10-23 -9.10,Karmic Koala,karmic,2009-10-29,2011-04 -10.04 LTS,Lucid Lynx,lucid,2010-04-29,2013-04,2015-04 -10.10,Maverick Meerkat,maverick,2010-10-10,2012-04 -11.04,Natty Narwhal,natty,2011-04-28,2012-10 +version,codename,series,created,release,eol,eol-server +4.10,Warty Warthog,warty,2004-03-05,2004-10-20,2006-04-30 +5.04,Hoary Hedgehog,hoary,2004-10-20,2005-04-08,2006-10-31 +5.10,Breezy Badger,breezy,2005-04-08,2005-10-13,2007-04-13 +6.06 LTS,Dapper Drake,dapper,2005-10-13,2006-06-01,2009-07-14,2011-06 +6.10,Edgy Eft,edgy,2006-06-01,2006-10-26,2008-04-25 +7.04,Feisty Fawn,feisty,2006-10-26,2007-04-19,2008-10-19 +7.10,Gutsy Gibbon,gutsy,2007-04-19,2007-10-18,2009-04-18 +8.04 LTS,Hardy Heron,hardy,2007-10-18,2008-04-24,2011-04,2013-04 +8.10,Intrepid Ibex,intrepid,2008-04-24,2008-10-30,2010-04-30 +9.04,Jaunty Jackalope,jaunty,2008-10-30,2009-04-23,2010-10-23 +9.10,Karmic Koala,karmic,2009-04-23,2009-10-29,2011-04 +10.04 LTS,Lucid Lynx,lucid,2009-10-29,2010-04-29,2013-04,2015-04 +10.10,Maverick Meerkat,maverick,2010-04-29,2010-10-10,2012-04 +11.04,Natty Narwhal,natty,2010-10-10,2011-04-28,2012-10 diff --git a/debian/changelog b/debian/changelog index 740f4fe..af8b4a2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,13 +5,14 @@ ubuntu-dev-tools (0.116) UNRELEASED; urgency=low - Add .icns and .java to extension whitelist. - Add image/vnd.adobe.photoshop to the mime-type whitelist. * data/debian.csv: Add wheezy and release date of squeeze. + * *distro-info: Add a "created" column to the data. [ Stefano Rivera ] * debian/copyright: - Files is space-separated, not comma. - Bump Format revision. - -- Benjamin Drung Sun, 06 Feb 2011 15:16:39 +0100 + -- Benjamin Drung Sun, 06 Feb 2011 16:47:41 +0100 ubuntu-dev-tools (0.115) unstable; urgency=low diff --git a/ubuntutools/distro_info.py b/ubuntutools/distro_info.py index 32e1aef..1c8b52e 100644 --- a/ubuntutools/distro_info.py +++ b/ubuntutools/distro_info.py @@ -64,7 +64,7 @@ class DistroInfo(object): csv_reader = csv.DictReader(csvfile) self._rows = [] for row in csv_reader: - for column in ("release", "eol", "eol-server"): + for column in ("created", "release", "eol", "eol-server"): if column in row: row[column] = convert_date(row[column]) self._rows.append(row) @@ -75,11 +75,15 @@ class DistroInfo(object): """List all known distributions.""" return [x["series"] for x in self._rows] + def _avail(self, date): + """Return all distributions that were available on the given date.""" + return [x for x in self._rows if date >= x["created"]] + 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._rows + 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"]))] @@ -91,7 +95,7 @@ class DistroInfo(object): """Get latest stable distribution based on the given date.""" if date is None: date = self._date - distros = [x for x in self._rows + distros = [x for x in self._avail(date) if x["release"] is not None and date >= x["release"] and (x["eol"] is None or date <= x["eol"])] if not distros: @@ -105,7 +109,7 @@ class DistroInfo(object): def unsupported(self, date=None): """Get list of all unsupported distributions based on the given date.""" supported = self.supported(date) - distros = [x["series"] for x in self._rows + distros = [x["series"] for x in self._avail(date) if x["series"] not in supported] return distros @@ -134,7 +138,7 @@ class DebianDistroInfo(DistroInfo): """Get old (stable) Debian distribution based on the given date.""" if date is None: date = self._date - distros = [x for x in self._rows + distros = [x for x in self._avail(date) if x["release"] is not None and date >= x["release"]] if len(distros) < 2: raise DistroDataOutdated() @@ -145,7 +149,7 @@ class DebianDistroInfo(DistroInfo): date.""" if date is None: date = self._date - distros = [x["series"] for x in self._rows + distros = [x["series"] for x in self._avail(date) if x["eol"] is None or date <= x["eol"]] return distros @@ -153,7 +157,7 @@ class DebianDistroInfo(DistroInfo): """Get latest testing Debian distribution based on the given date.""" if date is None: date = self._date - distros = [x for x in self._rows + 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"]))] @@ -185,7 +189,7 @@ class UbuntuDistroInfo(DistroInfo): date.""" if date is None: date = self._date - distros = [x["series"] for x in self._rows + distros = [x["series"] for x in self._avail(date) if date <= x["eol"] or (x["eol-server"] is not None and date <= x["eol-server"])] return distros