]> git.donarmstrong.com Git - neurodebian.git/commitdiff
More polish and DDE updates.
authorMichael Hanke <michael.hanke@gmail.com>
Tue, 25 Aug 2009 15:39:48 +0000 (11:39 -0400)
committerMichael Hanke <michael.hanke@gmail.com>
Tue, 25 Aug 2009 15:39:48 +0000 (11:39 -0400)
neurodebian/dde.py
neurodebian/templates/pkg.rst
sphinx/_static/neurodebian.css
sphinx/index.rst

index 6593e44433f0bdd080cb210f5ab588bcdcba373a..bc03b8c5cb370807ceeeb4f7a1c579b90ee9ae3c 100644 (file)
@@ -364,34 +364,67 @@ def import_dde(cfg, db):
         q = dde_get(query_url + "/packages/all/%s" % p)
         if q:
             db[p]['main'] = q
-        for d in dists:
-            dist, release = d.split('-')
-            q = dde_get(query_url + "/dist/d:%s/r:%s/p:%s" % (dist, release, p))
-            if not q:
-                continue
+            # get latest popcon info for debian and ubuntu
+            # cannot use origin field itself, since it is none for few packages
+            # i.e. python-nifti
+            origin = q['drc'].split()[0]
+            print 'popcon query for', p
+            if origin == 'ubuntu':
+                print 'have ubuntu first'
+                if q.has_key('popcon'):
+                    print 'ubuntu has popcon'
+                    db[p]['main']['ubuntu_popcon'] = q['popcon']
+                # if we have ubuntu, need to get debian
+                q = dde_get(query_url + "/packages/prio-debian-sid/%s" % p)
+                if q and q.has_key('popcon'):
+                    print 'debian has popcon'
+                    db[p]['main']['debian_popcon'] = q['popcon']
+            elif origin == 'debian':
+                print 'have debian first'
+                if q.has_key('popcon'):
+                    print 'debian has popcon'
+                    db[p]['main']['debian_popcon'] = q['popcon']
+                # if we have debian, need to get ubuntu
+                q = dde_get(query_url + "/packages/prio-ubuntu-karmic/%s" % p)
+                if q and q.has_key('popcon'):
+                    print 'ubuntu has popcon'
+                    db[p]['main']['ubuntu_popcon'] = q['popcon']
+            else:
+                print("Ignoring unkown origin '%s' for package '%s'." \
+                        % (origin, p))
+
+        # now get info for package from all releases in UDD
+        q = dde_get(query_url + "/dist/p:%s" % p)
+        if not q:
+            continue
+        # hold all info about this package per distribution release
+        info = {}
+        for cp in q:
+            distkey = (trans_codename(cp['release'], cfg),
+                       "%s-%s" % (cp['distribution'], cp['release']))
+            if not info.has_key(distkey):
+                info[distkey] = cp
+                # turn into a list to append others later
+                info[distkey]['architecture'] = [info[distkey]['architecture']]
             # accumulate data for multiple over archs
-            item = None
-            for i in q:
-                if item is None:
-                    item = i
+            else:
+                comp = apt.VersionCompare(cp['version'],
+                                          info[distkey]['version'])
+                # found another arch for the same version
+                if comp == 0:
+                    info[distkey]['architecture'].append(cp['architecture'])
+                # found newer version, dump the old ones
+                elif comp > 0:
+                    info[distkey] = cp
                     # turn into a list to append others later
-                    item['architecture'] = [item['architecture']]
+                    info[distkey]['architecture'] = [info[distkey]['architecture']]
+                # simply ignore older versions
                 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
+                    pass
+
+        # finally assign the new package data
+        for k, v in info.iteritems():
+            db[p][k] = v
 
     return db
 
index 7f12e1c4eb18891e2ddfa483063bdbb91627351f..e5009f02f7a6666197e41bd920432269401ef73a 100644 (file)
@@ -15,6 +15,23 @@ Associated `Debian Pure Blends <http://wiki.debian.org/DebianPureBlends>`_:
 {% endfor %}
 {% endif %}
 
+{% if db.main.debian_popcon or db.main.ubuntu_popcon %}
+Number of reported installations [#]_:
+{% if db.main.debian_popcon %}
+- Debian: {{ db.main.debian_popcon.insts }} (`more info <http://qa.debian.org/popcon.php?package={{ pkg }}>`_)
+{% endif %}
+{% if db.main.ubuntu_popcon %}
+- Ubuntu: {{ db.main.ubuntu_popcon.insts }}
+{% endif %}
+
+.. [#] Due to the nature of this data, the reported number can only be
+       considered a conservative estimate of the lower bound of the true
+       number of installations.
+
+{% endif %}
+
+
+
 Binary packages
 ===============
 
@@ -61,9 +78,6 @@ Debian
 
   - Maintainer: {{ distpkg.maintainer }}
   - 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 %}
 {% endif %}
 {% else %}
 *There are no official Debian packages available.*
@@ -91,9 +105,6 @@ Ubuntu
 
   - Maintainer: {{ distpkg.maintainer }}
   - Bug reports: `Ubuntu Launchpad <https://bugs.launchpad.net/ubuntu/+source/{{ distpkg.source }}>`_
-{% if distpkg.popcon %}
-  - Reported installations: {{ distpkg.popcon.insts }}
-{% endif %}
 {% endif %}
 {% else %}
 *There are no official Ubuntu packages available.*
index a7bf88af289af1d48ef77f32084686e6458d3b83..ed9017685f4311ee17011c386b20441897fed3ab 100644 (file)
@@ -445,8 +445,8 @@ div.warning {
 }
 
 div.note {
-    background-color: #eee;
-    border: 1px solid #ccc;
+    background-color: #eaf2f9;
+    border: 1px solid #3d7aa5;
     border-left: none;
     border-right: none;
 }
@@ -484,6 +484,7 @@ table.field-list td, table.field-list th {
 
 table.footnote td, table.footnote th {
     border: 0 !important;
+    font-size: 0.7em;
 }
 
 .field-list ul {
@@ -579,7 +580,12 @@ tt.xref, a tt {
     font-weight: bold;
 }
 
-.footnote:target  { background-color: #ffa }
+.footnote:target { background-color: #ffa }
+
+.footnote-reference {
+    font-size: 0.7em;
+    vertical-align: top;
+}
 
 h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
     background-color: transparent;
index 7e21af17c3278f6981d6cfd253953489a467a5ae..d9ef80b6529a8b0ecb8e02e355f4d1f718006c83 100644 (file)
@@ -37,6 +37,10 @@ releases and repository mirrors:
 .. include:: sources_lists
 
 .. note::
+  Thanks to the Department of Experimental Psychology at the University of
+  Mageburg, and the Department of Psychological and Brain Sciences at Dartmouth
+  College for hosting a mirror.
+
   If your are interested in mirroring the repository, please see the :ref:`faq`.
 
 Once this is done, you have to update the package index. Use your favorite