]> git.donarmstrong.com Git - neurodebian.git/blob - neurodebian/templates/sources_lists.rst
New repository setup instruction.
[neurodebian.git] / neurodebian / templates / sources_lists.rst
1 .. raw:: html
2
3  <select id="release" name="release">
4    <option value="">Select a release</option>
5 {%- for id, relname in id2relname|dictsort(true, 'value') %}
6    <option value="{{ id }}">{{ relname }}</option>
7 {%- endfor %}
8  </select>
9  <select id="mirror" name="mirror">
10 {%- for id, mirrorname in mirror2name|dictsort %}
11 {%- if id == 'us-nh' %}
12    <option selected value="{{ id }}">{{ mirrorname }}</option>
13 {%- else %}
14    <option value="{{ id }}">{{ mirrorname }}</option>
15 {%- endif %}
16 {%- endfor %}
17  </select>
18
19  <div class="highlight-python" id="reposetup">
20  <pre id="code">
21  After selecting a release the setup code will be shown here.
22  </pre>
23  </div>
24  <script>
25  <!--
26  
27   var rel2name =  {
28 {%- for id, codename in id2codename|dictsort %}
29    "{{ id }}" : "{{ codename }}",
30 {%- endfor %}
31   };
32
33   var mirrors =  {
34 {%- for id, url in mirror2url|dictsort %}
35    "{{ id }}" : "{{ url }}",
36 {%- endfor %}
37   };
38
39   function createrepourl(rel, mir) {
40     if(rel in rel2name && mir in mirrors) {
41
42         var retrepo = "sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9\n" +
43          "wget -O- http://neuro.debian.net/lists/" + rel2name[rel] + "."
44          + mir + " | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list\n";
45         return retrepo;
46     }
47
48   };
49   function updateout(rel, mir) {
50         $('#code').text(createrepourl(rel, mir));
51   };
52    $('#release').change(function() {
53      var singleValues = $("#release").val();
54      var mirrorVal = $("#mirror").val();
55      updateout(singleValues, mirrorVal);
56    });
57    $('#mirror').change(function() {
58      var singleValues = $("#release").val();
59      var mirrorVal = $("#mirror").val();
60      updateout(singleValues, mirrorVal);
61    });
62
63  //-->
64  </script>
65