]> git.donarmstrong.com Git - neurodebian.git/commitdiff
New repository setup instruction.
authorMichael Hanke <michael.hanke@gmail.com>
Tue, 22 Mar 2011 13:03:53 +0000 (09:03 -0400)
committerMichael Hanke <michael.hanke@gmail.com>
Tue, 22 Mar 2011 13:03:53 +0000 (09:03 -0400)
Javascript-based selection menu and setup code generation.
Advantages: users can now simply copy/paste two lines and get the full
setup, instead of having to figure out what to copy where, after
downloading into a temporary directory and post-hoc enabling the gpg
key.

Makefile
neurodebian/dde.py
neurodebian/templates/sources_lists.rst
sphinx/index.rst

index 4f37cf71ae3b7012393a60c6a02db4bc7fabd198..880f0d2f4123dccda9de3cafeb38c2dfd791ea09 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ html: pics source
        cd artwork;     cp button_w200.png logo_tuned/fmri_w200.png ../build/src/_static; cd ..
        cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build 2>&1
        mv $(WWW_DIR)/_static/robots.txt $(WWW_DIR)/
+       cp -r build/src/lists $(WWW_DIR)/
 
 
 clean:
index aac6a64cea86e96bbc8f039a5a2b2a5b91f67de1..c80ab18ceac10a347ec1a00542dd15b53688c979 100755 (executable)
@@ -639,7 +639,7 @@ def read_db(filename):
 
 def write_sourceslist(jinja_env, cfg, outdir):
     create_dir(outdir)
-    create_dir(os.path.join(outdir, '_static'))
+    create_dir(os.path.join(outdir, 'lists'))
 
     repos = {}
     for release in cfg.options('release codenames'):
@@ -649,9 +649,9 @@ def write_sourceslist(jinja_env, cfg, outdir):
         transrel = trans_codename(release, cfg)
         repos[transrel] = []
         for mirror in cfg.options('mirrors'):
-            listname = 'neurodebian.%s.%s.sources.list' % (release, mirror)
+            listname = '%s.%s' % (release, mirror)
             repos[transrel].append((mirror, listname))
-            lf = open(os.path.join(outdir, '_static', listname), 'w')
+            lf = open(os.path.join(outdir, 'lists', listname), 'w')
             for rel in ('data', release):
                 aptcfg = '%s %s main contrib non-free\n' % (cfg.get('mirrors', mirror),
                                                           rel)
@@ -659,9 +659,20 @@ def write_sourceslist(jinja_env, cfg, outdir):
                 lf.write('#deb-src %s' % aptcfg)
             lf.close()
 
+    id2codename = dict([(cfg.get('release backport ids', r), r)
+                            for r in cfg.options('release codenames')])
+    id2relname = dict([(cfg.get('release backport ids', r), trans_codename(r, cfg))
+                            for r in cfg.options('release codenames')])
+    mirror2name = dict([(m, cfg.get('mirror names', m))
+                            for m in cfg.options('mirrors')])
+    mirror2url = dict([(m, cfg.get('mirrors', m))
+                            for m in cfg.options('mirrors')])
     srclist_template = jinja_env.get_template('sources_lists.rst')
     sl = open(os.path.join(outdir, 'sources_lists'), 'w')
-    sl.write(srclist_template.render(repos=repos))
+    sl.write(srclist_template.render(id2codename=id2codename,
+                                     id2relname=id2relname,
+                                     mirror2name=mirror2name,
+                                     mirror2url=mirror2url))
     sl.close()
 
 
index 58dd044565799ccb7b2036c2172f7da57c114583..e48025e9e727221448554203185f3325af1b84c7 100644 (file)
@@ -1,4 +1,65 @@
-{% for dist, mirrors in repos|dictsort %}
-* {{ dist }}: {% for mirror, list in mirrors|sort %}[`{{ mirror }} <_static/{{ list }}>`__] {% endfor %}
-{% endfor %}
+.. raw:: html
+
+ <select id="release" name="release">
+   <option value="">Select a release</option>
+{%- for id, relname in id2relname|dictsort(true, 'value') %}
+   <option value="{{ id }}">{{ relname }}</option>
+{%- endfor %}
+ </select>
+ <select id="mirror" name="mirror">
+{%- for id, mirrorname in mirror2name|dictsort %}
+{%- if id == 'us-nh' %}
+   <option selected value="{{ id }}">{{ mirrorname }}</option>
+{%- else %}
+   <option value="{{ id }}">{{ mirrorname }}</option>
+{%- endif %}
+{%- endfor %}
+ </select>
+
+ <div class="highlight-python" id="reposetup">
+ <pre id="code">
+ After selecting a release the setup code will be shown here.
+ </pre>
+ </div>
+ <script>
+ <!--
+  var rel2name =  {
+{%- for id, codename in id2codename|dictsort %}
+   "{{ id }}" : "{{ codename }}",
+{%- endfor %}
+  };
+
+  var mirrors =  {
+{%- for id, url in mirror2url|dictsort %}
+   "{{ id }}" : "{{ url }}",
+{%- endfor %}
+  };
+
+  function createrepourl(rel, mir) {
+    if(rel in rel2name && mir in mirrors) {
+
+        var retrepo = "sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9\n" +
+         "wget -O- http://neuro.debian.net/lists/" + rel2name[rel] + "."
+         + mir + " | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list\n";
+        return retrepo;
+    }
+
+  };
+  function updateout(rel, mir) {
+        $('#code').text(createrepourl(rel, mir));
+  };
+   $('#release').change(function() {
+     var singleValues = $("#release").val();
+     var mirrorVal = $("#mirror").val();
+     updateout(singleValues, mirrorVal);
+   });
+   $('#mirror').change(function() {
+     var singleValues = $("#release").val();
+     var mirrorVal = $("#mirror").val();
+     updateout(singleValues, mirrorVal);
+   });
+
+ //-->
+ </script>
 
index 951e6e1fd5dbda57b7491851623d8ded4a3b34aa..85c9341b69db986b10cc099222c02393a688c02f 100644 (file)
@@ -87,61 +87,30 @@ Follow us on identi.ca_ or twitter_ to subscribe to the NeuroDebian news.
 How to use this repository
 ==========================
 
-The easiest way to use this repository is to download an APT-configuration file
-(`sources.list`). Simply choose your target distribution/release and download
-the configuration for a mirror close to you (depending on your browser, you
-might have to right-click and choose 'save as'). Once downloaded, put the file
-in the `/etc/apt/sources.list.d/` directory on your system. Moving files in
-this directory will require superuser privileges, therefore you should probably
-download the file into a temporary directory and subsequently move it into
-`/etc/apt/sources.list.d/`. APT-configurations are available for the following
-releases and repository mirrors:
+To enable the NeuroDebian repository on your system, select your Debian or
+Ubuntu release and a repository mirror from the lists below. Upon selection
+a short command snippet will be displayed that can be copied and pasted into
+a terminal session. These commands will configure the system package manager
+with the NeuroDebian repository key and package source information.
 
 .. include:: sources_lists
 
-.. note::
-  Thanks to the following institutions and individuals for hosting a mirror:
-
-  * `Department of Psychological and Brain Sciences at Dartmouth College`_
-    *[us-nh]* (primary mirror)
-  * `Department of Experimental Psychology at the University of Magdeburg`_
-    *[de]*
-  * `Neurobot at Aristotle University of Thessaloniki, Greece`_ *[gr]*
-  * `Paul Ivanov`_ *[us-ca]*
-  * `Medical-image Analysis and Statistical Interpretation lab at Vanderbilt`_
-    *[us-tn]*
-
-  If your are interested in mirroring the repository, please see the :ref:`faq`.
-
-.. _Department of Psychological and Brain Sciences at Dartmouth College: http://www.dartmouth.edu/~psych
-.. _Department of Experimental Psychology at the University of Magdeburg: http://apsy.gse.uni-magdeburg.de
-.. _Neurobot at Aristotle University of Thessaloniki, Greece: http://neurobot.bio.auth.gr
-.. _Paul Ivanov: http://www.pirsquared.org
-.. _Medical-image Analysis and Statistical Interpretation lab at Vanderbilt: https://masi.vuse.vanderbilt.edu
-
 Once this is done, you have to update the package index. Use your favorite
-package manager, e.g. synaptic, adept, or whatever you like. In the terminal
-you can use :command:`aptitude` to achieve the same::
+package manager, e.g. synaptic, adept. In the terminal you can use
+:command:`apt-get` to achieve this::
 
-  sudo aptitude update
+  sudo apt-get update
 
-Now, you can proceed to install packages, e.g.::
+Now, you can install packages, e.g.::
 
-  sudo aptitude install lipsia
+  sudo apt-get install mricron
 
 .. note::
+
   Not every package is available for all distributions/releases. For information
   about which package version is available for which release and architecture,
   please have a look at the corresponding package pages.
 
-After this initial setup you probably also want to configure your package
-manager to recognize the NeuroDebian archive key. With this key the package
-manager can verify that packages haven't been modified and are identical with
-the ones in the main NeuroDebian archive, regardless of which mirror you
-downloaded them from. The NeuroDebian key id is **2649A5A9**. If you need further
-help setting up package authentication, please take a look at
-:ref:`corresponding FAQ <sec_pkg_authentication>`.
-
 
 .. _chap_installation:
 
@@ -223,6 +192,26 @@ Italian espresso <coffeeart>`.
 
 .. _Jim Haxby: http://haxbylab.dartmouth.edu/ppl/jim.html
 
+Thanks to the following institutions and individuals for hosting a mirror:
+
+* `Department of Psychological and Brain Sciences at Dartmouth College`_
+  *[us-nh]* (primary mirror)
+* `Department of Experimental Psychology at the University of Magdeburg`_
+  *[de]*
+* `Neurobot at Aristotle University of Thessaloniki, Greece`_ *[gr]*
+* `Paul Ivanov`_ *[us-ca]*
+* `Medical-image Analysis and Statistical Interpretation lab at Vanderbilt`_
+  *[us-tn]*
+
+If your are interested in mirroring the repository, please see the :ref:`faq`.
+
+.. _Department of Psychological and Brain Sciences at Dartmouth College: http://www.dartmouth.edu/~psych
+.. _Department of Experimental Psychology at the University of Magdeburg: http://apsy.gse.uni-magdeburg.de
+.. _Neurobot at Aristotle University of Thessaloniki, Greece: http://neurobot.bio.auth.gr
+.. _Paul Ivanov: http://www.pirsquared.org
+.. _Medical-image Analysis and Statistical Interpretation lab at Vanderbilt: https://masi.vuse.vanderbilt.edu
+
+
 Publications
 ============