commit:     213108f9e46766379a262747723072f9021c622c
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sun Jan 31 00:49:48 2016 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sun Jan 31 00:49:48 2016 +0000
URL:        https://gitweb.gentoo.org/sites/www.git/commit/?id=213108f9

Adapt downloads to arches who need to do their own thing

*sigh*

 _includes/downloads/experimental.html | 11 +++++++----
 _plugins/downloads.rb                 | 12 +++++++++++-
 bin/update-downloads.sh               |  9 ++++++++-
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/_includes/downloads/experimental.html 
b/_includes/downloads/experimental.html
index 0adc955..ca920a3 100644
--- a/_includes/downloads/experimental.html
+++ b/_includes/downloads/experimental.html
@@ -9,10 +9,13 @@
 
   <h4 id="s390">s390</h4>
   <div class="list-group">
-    <a href="http://distfiles.gentoo.org/releases/s390/autobuilds/"; 
data-relurl="../releases/s390/stages/" class="list-group-item download-link 
download-link-mirrorable">
-      <span class="fa fa-download fa-fw"></span>
-      <strong>S390 stages and boot media</strong>
-    </a>
+    {% include partials/download-link.html type="iso" arch="s390" 
id="netboot-s390-initramfs" title="Netboot Initramfs" tag="S390" %}
+    {% include partials/download-link.html type="iso" arch="s390" 
id="netboot-s390-kernel" title="Netboot Kernel" tag="S390" %}
+    {% include partials/download-link.html type="stage3" arch="s390" id="s390" 
title="Stage 3" tag="S390" %}
+
+    {% include partials/download-link.html type="iso" arch="s390" 
id="netboot-s390x-initramfs" title="Netboot Initramfs" tag="S390X" %}
+    {% include partials/download-link.html type="iso" arch="s390" 
id="netboot-s390x-kernel" title="Netboot Kernel" tag="S390X" %}
+    {% include partials/download-link.html type="stage3" arch="s390" 
id="s390x" title="Stage 3" tag="S390X" %}
   </div>
 
   <h4 id="sh">sh</h4>

diff --git a/_plugins/downloads.rb b/_plugins/downloads.rb
index 42c7fb2..22d58e2 100644
--- a/_plugins/downloads.rb
+++ b/_plugins/downloads.rb
@@ -16,7 +16,14 @@ module Gentoo
           if line =~ /^(\d{8})\/(\S+) (\d+)$/
             date = Date.parse('%s-%s-%s' % [$1[0..3], $1[4..5], $1[6..7]])
             site.data['downloads'][arch]['iso'] ||= {}
-            site.data['downloads'][arch]['iso']['minimal'] = { 'date' => date, 
'filename' => "%s/%s" % [$1, $2], 'size' => $3 }
+
+            if $2.include? 'minimal'
+              site.data['downloads'][arch]['iso']['minimal'] = { 'date' => 
date, 'filename' => '%s/%s' % [$1, $2], 'size' => $3 }
+            else
+              subdir, filename, size = $1, $2, $3
+              iso_name = $2.gsub(/-#{$1}.*$/, '')
+              site.data['downloads'][arch]['iso'][iso_name] = { 'date' => 
date, 'filename' => '%s/%s' % [subdir, filename], 'size' => size }
+            end
           end
         end
 
@@ -37,6 +44,9 @@ module Gentoo
           end
         end
       end
+
+      require 'pp'
+      pp site.data['downloads']
     end
   end
 end

diff --git a/bin/update-downloads.sh b/bin/update-downloads.sh
index 9836ad7..2191f13 100755
--- a/bin/update-downloads.sh
+++ b/bin/update-downloads.sh
@@ -7,6 +7,13 @@ for arch in "${ARCHES[@]}"; do
   mkdir -p _data/downloads/${arch}/
   wget 
"http://distfiles.gentoo.org/releases/${arch}/autobuilds/latest-iso.txt"; -O 
_data/downloads/${arch}/iso.txt 2>/dev/null
   wget 
"http://distfiles.gentoo.org/releases/${arch}/autobuilds/latest-stage3.txt"; -O 
_data/downloads/${arch}/stage3.txt 2>/dev/null
+
+  if [ ${arch} = "s390" ]; then
+    wget 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390-initramfs.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390-kernel.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390x-initramfs.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+    wget 
"http://distfiles.gentoo.org/releases/s390/autobuilds/latest-netboot-s390x-kernel.txt";
 -O - >> _data/downloads/${arch}/iso.txt 2>/dev/null
+  fi
 done
 
-echo 'done.'
\ No newline at end of file
+echo 'done.'

Reply via email to