]> git.donarmstrong.com Git - neurodebian.git/commitdiff
Adjust to changes in DDE and build for more releases.
authorMichael Hanke <michael.hanke@gmail.com>
Thu, 20 Aug 2009 19:04:56 +0000 (15:04 -0400)
committerMichael Hanke <michael.hanke@gmail.com>
Thu, 20 Aug 2009 19:04:56 +0000 (15:04 -0400)
neurodebian.cfg
neurodebian/dde.py
neurodebian/templates/pkg.rst

index 9d4608723c22081269747bf27aa9036eb4483705..c289d956b81fe3950e1ce045b5956afc4aef453c 100644 (file)
@@ -1,6 +1,8 @@
 [dde]
 [dde]
-dists = debian-lenny debian-squeeze debian-sid ubuntu-jaunty
-pkgquery_url = http://dde.debian.net/dde/q/udd/packages
+dists = debian-lenny debian-squeeze debian-sid debian-experimental
+  ubuntu-hardy ubuntu-intrepid ubuntu-jaunty ubuntu-karmic
+
+pkgquery_url = http://dde.debian.net/dde/q/udd
 
 [packages]
 # Packages listed in the following taskfiles will be featured on the website
 
 [packages]
 # Packages listed in the following taskfiles will be featured on the website
@@ -49,3 +51,4 @@ gutsy = Ubuntu 7.10 "Gutsy Gibbon" (gutsy)
 hardy = Ubuntu 8.04 LTS "Hardy Heron" (hardy)
 intrepid = Ubuntu 8.10 "Intrepid Ibex" (intrepid)
 jaunty = Ubuntu 9.04 "Jaunty Jackalope" (jaunty)
 hardy = Ubuntu 8.04 LTS "Hardy Heron" (hardy)
 intrepid = Ubuntu 8.10 "Intrepid Ibex" (intrepid)
 jaunty = Ubuntu 9.04 "Jaunty Jackalope" (jaunty)
+karmic = Ubuntu upcoming release (karmic)
index 746fee192080f5e518b0f4ed9f3b75bf4629a541..6593e44433f0bdd080cb210f5ab588bcdcba373a 100644 (file)
@@ -5,6 +5,7 @@
 import pysvn
 import json
 from debian_bundle import deb822
 import pysvn
 import json
 from debian_bundle import deb822
+import apt
 from ConfigParser import SafeConfigParser
 from optparse import OptionParser, Option, OptionGroup, OptionConflictError
 import sys
 from ConfigParser import SafeConfigParser
 from optparse import OptionParser, Option, OptionGroup, OptionConflictError
 import sys
@@ -300,7 +301,9 @@ def _store_pkg(cfg, db, st, origin, codename, component, baseurl):
     info['version'] = st['Version']
 
     # origin
     info['version'] = st['Version']
 
     # origin
-    info['drc'] = '%s %s %s' % (origin, codename, component)
+    info['distribution'] = origin
+    info['release'] = codename
+    info['component'] = component
 
     # pool url
     info['poolurl'] = '/'.join([os.path.dirname(st['Filename'])])
 
     # pool url
     info['poolurl'] = '/'.join([os.path.dirname(st['Filename'])])
@@ -358,13 +361,37 @@ def import_dde(cfg, db):
     query_url = cfg.get('dde', 'pkgquery_url')
     for p in db.keys():
         # get freshest
     query_url = cfg.get('dde', 'pkgquery_url')
     for p in db.keys():
         # get freshest
-        q = dde_get(query_url + "/all/%s" % p)
+        q = dde_get(query_url + "/packages/all/%s" % p)
         if q:
             db[p]['main'] = q
         for d in dists:
         if q:
             db[p]['main'] = q
         for d in dists:
-            q = dde_get(query_url + "/prio-%s/%s" % (d, p))
-            if q:
-                db[p][(trans_codename(d.split('-')[1], cfg),d)] = q
+            dist, release = d.split('-')
+            q = dde_get(query_url + "/dist/d:%s/r:%s/p:%s" % (dist, release, p))
+            if not q:
+                continue
+            # accumulate data for multiple over archs
+            item = None
+            for i in q:
+                if item is None:
+                    item = i
+                    # turn into a list to append others later
+                    item['architecture'] = [item['architecture']]
+                else:
+                    comp = apt.VersionCompare(i['version'], item['version'])
+                    # found another arch for the same version
+                    if comp == 0:
+                        item['architecture'].append(i['architecture'])
+                    # found newer version, dump the old ones
+                    elif comp > 0:
+                        item = i
+                        # turn into a list to append others later
+                        item['architecture'] = [item['architecture']]
+                    # simply ignore older versions
+                    else:
+                        pass
+
+            # finally assign the new package data
+            db[p][(trans_codename(d.split('-')[1], cfg),d)] = item
 
     return db
 
 
     return db
 
index ec84f12eab6fee45efe70b0d5fd3eec072a889da..7f12e1c4eb18891e2ddfa483063bdbb91627351f 100644 (file)
@@ -18,11 +18,11 @@ Associated `Debian Pure Blends <http://wiki.debian.org/DebianPureBlends>`_:
 Binary packages
 ===============
 
 Binary packages
 ===============
 
-{% for dist, distpkg in db|dictsort if dist[1].startswith('neurodebian') %}
-{% if loop.first %}
 NeuroDebian
 -----------
 
 NeuroDebian
 -----------
 
+{% for dist, distpkg in db|dictsort if dist[1].startswith('neurodebian') %}
+{% if loop.first %}
 The repository contains binary packages for the following distribution
 releases and system architectures. The corresponding source packages
 are available too.
 The repository contains binary packages for the following distribution
 releases and system architectures. The corresponding source packages
 are available too.
@@ -34,7 +34,7 @@ are available too.
   :ref:`front page <repository_howto>`.
 
 {% endif %}
   :ref:`front page <repository_howto>`.
 
 {% endif %}
-{{ dist[0] }} [{{ distpkg.drc.split()[2]}}]:
+{{ dist[0] }} [{{ distpkg.component}}]:
   `{{distpkg.version}} <../../debian/{{ distpkg.poolurl }}>`_ [{{ ', '.join(distpkg.architecture) }}]
 
 {% if loop.last %}
   `{{distpkg.version}} <../../debian/{{ distpkg.poolurl }}>`_ [{{ ', '.join(distpkg.architecture) }}]
 
 {% if loop.last %}
@@ -47,20 +47,20 @@ are available too.
 {% endfor %}
 
 
 {% endfor %}
 
 
-{% for dist, distpkg in db|dictsort if dist[1].startswith('debian') %}
-{% if loop.first %}
 Debian
 ------
 
 Debian
 ------
 
+{% for dist, distpkg in db|dictsort if dist[1].startswith('debian') %}
+{% if loop.first %}
 {% endif %}
 {% endif %}
-{{ dist[0] }} [{{ distpkg.drc.split()[2]}}]:
-  `{{distpkg.version}} <http://packages.debian.org/search?suite={{ distpkg.drc.split()[1]}}&keywords={{ pkg }}>`_ [{{ ', '.join(distpkg.architecture) }}]
+{{ dist[0] }} [{{ distpkg.component}}]:
+  `{{distpkg.version}} <http://packages.debian.org/search?suite={{ distpkg.release}}&keywords={{ pkg }}>`_ [{{ ', '.join(distpkg.architecture) }}]
 
 {% if loop.last %}
 .. seealso::
 
   - Maintainer: {{ distpkg.maintainer }}
 
 {% if loop.last %}
 .. seealso::
 
   - Maintainer: {{ distpkg.maintainer }}
-  - Bug reports: `Debian bugtracking system <http://bugs.debian.org/src:{{ distpkg.sv.split()[0] }}>`_
+  - Bug reports: `Debian bugtracking system <http://bugs.debian.org/src:{{ distpkg.source }}>`_
 {% if distpkg.popcon %}
   - Reported installations: {{ distpkg.popcon.insts }} (`more info <http://qa.debian.org/popcon.php?package={{ pkg }}>`_)
 {% endif %}
 {% if distpkg.popcon %}
   - Reported installations: {{ distpkg.popcon.insts }} (`more info <http://qa.debian.org/popcon.php?package={{ pkg }}>`_)
 {% endif %}
@@ -77,20 +77,20 @@ for more information about its current status.
 {% endfor %}
 
 
 {% endfor %}
 
 
-{% for dist, distpkg in db.iteritems() if dist[1].startswith('ubuntu') %}
-{% if loop.first %}
 Ubuntu
 ------
 
 Ubuntu
 ------
 
+{% for dist, distpkg in db.iteritems() if dist[1].startswith('ubuntu') %}
+{% if loop.first %}
 {% endif %}
 {% endif %}
-{{ dist[0] }} [{{ distpkg.drc.split()[2]}}]:
-  `{{distpkg.version}} <http://packages.ubuntu.com/search?suite={{ distpkg.drc.split()[1]}}&keywords={{ pkg }}>`_ [{{ ', '.join(distpkg.architecture) }}]
+{{ dist[0] }} [{{ distpkg.component }}]:
+  `{{distpkg.version}} <http://packages.ubuntu.com/search?suite={{ distpkg.release }}&keywords={{ pkg }}>`_ [{{ ', '.join(distpkg.architecture) }}]
 
 {% if loop.last %}
 .. seealso::
 
   - Maintainer: {{ distpkg.maintainer }}
 
 {% if loop.last %}
 .. seealso::
 
   - Maintainer: {{ distpkg.maintainer }}
-  - Bug reports: `Ubuntu Launchpad <https://bugs.launchpad.net/ubuntu/+source/{{ distpkg.sv.split()[0] }}>`_
+  - Bug reports: `Ubuntu Launchpad <https://bugs.launchpad.net/ubuntu/+source/{{ distpkg.source }}>`_
 {% if distpkg.popcon %}
   - Reported installations: {{ distpkg.popcon.insts }}
 {% endif %}
 {% if distpkg.popcon %}
   - Reported installations: {{ distpkg.popcon.insts }}
 {% endif %}