]> git.donarmstrong.com Git - neurodebian.git/commitdiff
NF: List recommened and suggested packages as 'related packages'.
authorMichael Hanke <michael.hanke@gmail.com>
Tue, 13 Oct 2009 13:45:16 +0000 (09:45 -0400)
committerMichael Hanke <michael.hanke@gmail.com>
Tue, 13 Oct 2009 13:45:16 +0000 (09:45 -0400)
neurodebian/dde.py
neurodebian/templates/pkg.rst
pkgs/fsl.rst
tools/nd_login

index 8160fe9ad60d672141bdcde337b3d8d773990e6c..f3c959e25dfd285f2bbc1d4f6021945830275469 100644 (file)
@@ -231,7 +231,6 @@ def import_blendstask(db, url):
 
             # Registration
             if st.has_key('Registration'):
 
             # Registration
             if st.has_key('Registration'):
-                print 'HAVE REGISTRATION:', p
                 db[p]['main']['registration'] = st['Registration']
 
             # Remarks
                 db[p]['main']['registration'] = st['Registration']
 
             # Remarks
@@ -349,8 +348,14 @@ def _store_pkg(cfg, db, st, origin, codename, component, baseurl):
     # charge the basic property set
     db[pkg]['main']['description'] = info['description']
     db[pkg]['main']['long_description'] = info['long_description']
     # charge the basic property set
     db[pkg]['main']['description'] = info['description']
     db[pkg]['main']['long_description'] = info['long_description']
+    if st.has_key('Source'):
+        db[pkg]['main']['sv'] = "%s %s" % (st['Source'], st['Version'])
+    else:
+        db[pkg]['main']['sv'] = "%s %s" % (st['Package'], st['Version'])
     if st.has_key('Homepage'):
         db[pkg]['main']['homepage'] = st['Homepage']
     if st.has_key('Homepage'):
         db[pkg]['main']['homepage'] = st['Homepage']
+    if st.has_key('Recommends'):
+        db[pkg]['main']['recommends'] = st['Recommends']
 
     return db
 
 
     return db
 
@@ -384,7 +389,7 @@ def dde_get(url):
     try:
         return json.read(urllib2.urlopen(url+"?t=json").read())['r']
     except (urllib2.HTTPError, StopIteration):
     try:
         return json.read(urllib2.urlopen(url+"?t=json").read())['r']
     except (urllib2.HTTPError, StopIteration):
-        print "SCREWED:", url
+        print "NO PKG INFO AT:", url
         return False
 
 
         return False
 
 
@@ -474,20 +479,21 @@ def convert_longdescr(ld):
 
 def generate_pkgpage(pkg, cfg, db, template, addenum_dir):
     # local binding for ease of use
 
 def generate_pkgpage(pkg, cfg, db, template, addenum_dir):
     # local binding for ease of use
-    db = db[pkg]
+    pkgdb = db[pkg]
     # do nothing if there is not at least the very basic stuff
     # do nothing if there is not at least the very basic stuff
-    if not db['main'].has_key('description'):
+    if not pkgdb['main'].has_key('description'):
         return
         return
-    title = '**%s** -- %s' % (pkg, db['main']['description'])
+    title = '**%s** -- %s' % (pkg, pkgdb['main']['description'])
     underline = '*' * (len(title) + 2)
     title = '%s\n %s\n%s' % (underline, title, underline)
 
     page = template.render(
             pkg=pkg,
             title=title,
     underline = '*' * (len(title) + 2)
     title = '%s\n %s\n%s' % (underline, title, underline)
 
     page = template.render(
             pkg=pkg,
             title=title,
-            long_description=convert_longdescr(db['main']['long_description']),
+            long_description=convert_longdescr(pkgdb['main']['long_description']),
             cfg=cfg,
             cfg=cfg,
-            db=db)
+            db=pkgdb,
+            fulldb=db)
     # the following can be replaced by something like
     # {% include "sidebar.html" ignore missing %}
     # in the template whenever jinja 2.2 becomes available
     # the following can be replaced by something like
     # {% include "sidebar.html" ignore missing %}
     # in the template whenever jinja 2.2 becomes available
index 4c0b36f79106814652c53a5d37555c02cf74eaed..dc827b0ecf79883ba04cc9ed9a629d5621586093 100644 (file)
@@ -18,23 +18,21 @@ Citable reference:
   {%- endif %}
 {% endif %}
 
   {%- endif %}
 {% endif %}
 
-{% if db.main.registration %}
+{% if db.main.registration -%}
 .. note::
   The software authors ask users to
   `register <{{ db.main.registration }}>`_. Available user statistics might be 
   helpful to acquire funding for this project and therefore foster continued
   developement in the future.
 .. note::
   The software authors ask users to
   `register <{{ db.main.registration }}>`_. Available user statistics might be 
   helpful to acquire funding for this project and therefore foster continued
   developement in the future.
-{% endif %}
-
-{% if db.blends or db.main.debian_popcon or db.main.ubuntu_popcon %}
+{% endif -%}
 
 
+{% if db.blends or db.main.debian_popcon or db.main.ubuntu_popcon or
+      db.main.recommends or db.main.suggests -%}
 Package Details
 ===============
 Package Details
 ===============
-
 {% if db.blends %}
 `Debian Pure Blends <http://wiki.debian.org/DebianPureBlends>`_ Status
 ----------------------------------------------------------------------
 {% if db.blends %}
 `Debian Pure Blends <http://wiki.debian.org/DebianPureBlends>`_ Status
 ----------------------------------------------------------------------
-
 Associated blends:
 
 {% for blend, name, url in db.blends.tasks %}
 Associated blends:
 
 {% for blend, name, url in db.blends.tasks %}
@@ -43,38 +41,52 @@ Associated blends:
 {% if db.blends.remark %}
 .. note::
 {{ db.blends.remark | indent(width=2, indentfirst=true) }}
 {% if db.blends.remark %}
 .. note::
 {{ db.blends.remark | indent(width=2, indentfirst=true) }}
-{% endif %}
-{% endif %}
+{% endif -%}
+{% endif -%}
 
 {% if db.main.debian_popcon or db.main.ubuntu_popcon %}
 Reported installations [#]_
 ---------------------------
 
 {% if db.main.debian_popcon or db.main.ubuntu_popcon %}
 Reported installations [#]_
 ---------------------------
-
-{% if db.main.debian_popcon %}
+{% if db.main.debian_popcon -%}
 - Debian: {{ db.main.debian_popcon.insts }} (`more info <http://qa.debian.org/popcon.php?package={{ pkg }}>`_)
 - Debian: {{ db.main.debian_popcon.insts }} (`more info <http://qa.debian.org/popcon.php?package={{ pkg }}>`_)
-{% endif %}
-{% if db.main.ubuntu_popcon %}
+{% 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.
 - 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 %}
-
+{% endif -%}
+{% endif -%}
+
+{% if db.main.recommends or db.main.suggests %}
+Related packages
+----------------
+{% if db.main.recommends %}
+{%- for pkg in db.main.recommends.split(',') %}
+{%- if pkg.split('|')[0].strip() in fulldb %}
+* :ref:`pkg_{{ pkg.strip() }}`
+{%- else %}
+* {{ pkg }}
+{% endif -%}{% endfor %}{% endif %}
+{%- if db.main.suggests %}
+{%- for pkg in db.main.suggests.split(',') %}
+{%- if pkg.split('|')[0].strip() in fulldb %}
+* :ref:`pkg_{{ pkg.strip() }}`
+{%- else %}
+* {{ pkg.strip() }}
+{% endif -%}{% endfor %}{% endif %}
 {% endif %}
 
 {% endif %}
 
-
-
 Binary packages
 ===============
 
 NeuroDebian
 -----------
 
 Binary packages
 ===============
 
 NeuroDebian
 -----------
 
-{% for dist, distpkg in db|dictsort if dist[1].startswith('neurodebian') %}
-{% if loop.first %}
+{% 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.
@@ -84,7 +96,6 @@ are available too.
   regularly. Instead configure your package manager to use this
   repository by following the instructions on the
   :ref:`front page <repository_howto>`.
   regularly. Instead configure your package manager to use this
   repository by following the instructions on the
   :ref:`front page <repository_howto>`.
-
 {% endif %}
 {{ dist[0] }} [{{ distpkg.component}}]:
   `{{distpkg.version}} <../../debian/{{ distpkg.poolurl }}>`_ [{{ ', '.join(distpkg.architecture) }}]
 {% endif %}
 {{ dist[0] }} [{{ distpkg.component}}]:
   `{{distpkg.version}} <../../debian/{{ distpkg.poolurl }}>`_ [{{ ', '.join(distpkg.architecture) }}]
index b92265f09c5a3934676ae60f5a56b30e76dc1266..d44679e489ec7483e6af03b484d4f3d1f5c31338 100644 (file)
@@ -1,5 +1,5 @@
-Related packages
-================
+Packages for the complete FSL suite
+===================================
 
 Since FSL covers a very broad range of analysis techniques the suite is split
 into a number of separate packages to allow a more fine-grained selection of
 
 Since FSL covers a very broad range of analysis techniques the suite is split
 into a number of separate packages to allow a more fine-grained selection of
index 409cddc1538306a389243e1df14c116dc8d6d47e..fa5612389c160f0cd095cb515504c534fd1060e5 100755 (executable)
@@ -41,7 +41,7 @@ fi
 opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
 
 
 opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
 
 
-if [ -z "bmdir" ]; then
+if [ -n "bmdir" ]; then
   options="$opts --bindmounts $bmdir"
 else
   options="$opts"
   options="$opts --bindmounts $bmdir"
 else
   options="$opts"