aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Marchese <maffblaster@gentoo.org>2017-06-22 00:49:53 -0700
committerMatthew Marchese <maffblaster@gentoo.org>2017-06-22 00:49:53 -0700
commit76a438f2a8b9361315f1484a1898ee2162e8cbc7 (patch)
tree30c19347b7998896f31f15e63d85f96afb20b0e9
downloadoverlays-76a438f2a8b9361315f1484a1898ee2162e8cbc7.tar.gz
overlays-76a438f2a8b9361315f1484a1898ee2162e8cbc7.tar.bz2
overlays-76a438f2a8b9361315f1484a1898ee2162e8cbc7.zip
Initial commit.
Signed-off-by: Matthew Marchese <maffblaster@gentoo.org>
-rw-r--r--README6
-rw-r--r--gen99
2 files changed, 105 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..aaaa036
--- /dev/null
+++ b/README
@@ -0,0 +1,6 @@
+## Instructions
+
+1. Install the dependencies.
+2. Run the following command: `ruby gen > index.html`
+3. Open index.html in a web browser.
+4. Pay dirt.
diff --git a/gen b/gen
new file mode 100644
index 0000000..4d8fff4
--- /dev/null
+++ b/gen
@@ -0,0 +1,99 @@
+#!/usr/bin/env ruby
+# Creates the overlays.gentoo.org webpage
+# Alex Legler <a3li@gentoo.org>
+
+require 'erb'
+require 'nokogiri'
+require 'open-uri'
+
+REPOSITORIES_XML = 'https://api.gentoo.org/overlays/repositories.xml'.freeze
+$xml = Nokogiri::XML(open(REPOSITORIES_XML))
+
+def render_table
+ r = ''
+ $xml.xpath('//repo').each do |repo|
+ repo_name = repo.xpath('./name/text()').first.content
+
+ repo_uri = nil
+ xpath = repo.xpath('./homepage/text()')
+ if xpath.length > 0
+ repo_uri = repo.xpath('./homepage/text()').first.content
+ end
+
+ repo_desc = repo.xpath('./description/text()').first.content
+ repo_qual = repo['quality']
+ repo_stat = repo['status']
+
+ repo_ownr = nil
+ xpath = repo.xpath('./owner/name/text()')
+ if xpath.length > 0
+ repo_ownr = xpath.first.content
+ end
+
+ repo_mail = repo.xpath('./owner/email/text()').first.content.gsub('@', '(at)')
+
+ r += '<tr>'
+ r += '<th>'
+
+ if repo_stat == 'official'
+ r += '<span class="fa fa-fw fa-institution" title="Official repository"></span> '
+ else
+ r += '<span class="fa fa-fw fa-group" title="Unofficial repository"></span> '
+ end
+
+ if repo_uri
+ r += "<a href='%s'>%s</a>" % [repo_uri, repo_name]
+ else
+ r += repo_name
+ end
+
+ r += '</th>'
+
+ r += '<td>' + repo_desc + '</td>'
+ r += '<td>'
+ r += "<a href='mailto:%s'>%s</a>" % [repo_mail, repo_ownr ? repo_ownr : repo_mail]
+ r += '</td>'
+
+ r += "</tr>\n"
+ end
+
+ r
+end
+
+renderer = ERB.new(DATA.read)
+puts renderer.result
+
+__END__
+<h1 class="first-header">Gentoo Repositories</h1>
+
+<p>
+ <a href="https://wiki.gentoo.org/wiki/Overlay">Ebuild repositories</a> contain additional packages for your Gentoo system.
+ Gentoo maintains a list of repositories for use in tools such as <code>layman</code>. You can find them below.
+</p>
+
+<div class="alert alert-info">
+ <strong>Using these repositories:</strong>
+ You can enable these repositories in your system using <a href="https://wiki.gentoo.org/wiki/Layman"><kbd>layman</kbd></a>.
+ They appear by the same name as on this page.
+ <br><br>
+ <strong>Adding your own repository:</strong>
+ Please see the <a href="https://wiki.gentoo.org/wiki/Project:Overlays/Overlays_guide" class="alert-link">Overlays guide</a>
+ to either request a Git repository on git.gentoo.org and/or add your repository to the list.
+</div>
+
+<div class="alert alert-danger">
+ <strong>Repository URL changes</strong>
+ <br><br>
+ We recently restructured the way you can access repositories hosted by Gentoo.<br>
+ Any overlays from <code>git.overlays.gentoo.org</code> or <code>overlays.gentoo.org</code> need to be changed to a new URL.
+ You can find more information in the <a href="https://www.gentoo.org/news/2015/04/25/anongit-overlays.html" class="alert-link">news item</a>.
+</div>
+
+<table class="table">
+ <tr>
+ <th>Repository Name</th>
+ <th>Description</th>
+ <th>Contact</th>
+ </tr>
+ <%= render_table %>
+</table>