Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 140861 Details for
Bug 141909
GLSA RSS Feed has incorrect dates
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Ruby script that creates a new glsa-index.xml
glsa-extract.rb (text/plain), 3.38 KB, created by
Xavier Neys (RETIRED)
on 2008-01-13 15:02:18 UTC
(
hide
)
Description:
Ruby script that creates a new glsa-index.xml
Filename:
MIME Type:
Creator:
Xavier Neys (RETIRED)
Created:
2008-01-13 15:02:18 UTC
Size:
3.38 KB
patch
obsolete
>#!/usr/bin/ruby > ># Build the GLSA index ># Index is ouptut on STDOUT ># Script takes a single arg that is the directory containing the GLSAs ># e.g. glsa-extract.rb /var/www/www.gentoo.org/htdocs/security/en/glsa > >require "gorg/xsl" > >$X=Gorg::XSL.new >$X.xsl=<<-EOXSL ><?xml version="1.0" encoding="UTF-8"?> ><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> > ><xsl:output encoding="UTF-8" > method="xml" > indent="yes" > omit-xml-declaration="yes"/> > ><xsl:template match="glsa"> ><glsa id='{@id}'> ><xsl:apply-templates select="revised[1]"/> ><title><xsl:value-of select="title"/></title> ><synopsis><xsl:value-of select="synopsis"/></synopsis> ><link><xsl:value-of select="concat('/security/en/glsa/glsa-',@id,'.xml')"/></link> ><impact><xsl:value-of select="concat(translate(substring(impact/@type,1,1),'qwertyuiopasdfghjklzxcvbnm','QWERTYUIOPASDFGHJKLZXCVBNM'),substring(impact/@type,2))"/></impact> ><xsl:for-each select="affected/package"> ><package><xsl:value-of select="@name"/></package> ></xsl:for-each> ><xsl:for-each select="bug"> ><bug><xsl:value-of select="."/></bug> ></xsl:for-each> ></glsa> ></xsl:template> > ><xsl:template match="revised"> ><!-- convert bloody dates like 'July 29, 2006: 02' to YYYY-MM-DD --> ><date> ><xsl:choose> > <xsl:when test="string-length(substring(.,1,10))=10 and substring(.,5,1)='-' and substring(.,8,1)='-' and contains('|01|02|03|04|05|06|07|08|09|10|11|12|',concat('|',substring(.,6,2),'|'))"> > <xsl:value-of select="substring(.,1,10)"/> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select="substring(substring-after(substring-after(.,' '),' '),1,4)"/> > <xsl:text>-</xsl:text> > <xsl:choose> > <xsl:when test="substring-before(.,' ')='January'">01</xsl:when> > <xsl:when test="substring-before(.,' ')='February'">02</xsl:when> > <xsl:when test="substring-before(.,' ')='March'">03</xsl:when> > <xsl:when test="substring-before(.,' ')='April'">04</xsl:when> > <xsl:when test="substring-before(.,' ')='May'">05</xsl:when> > <xsl:when test="substring-before(.,' ')='June'">06</xsl:when> > <xsl:when test="substring-before(.,' ')='July'">07</xsl:when> > <xsl:when test="substring-before(.,' ')='August'">08</xsl:when> > <xsl:when test="substring-before(.,' ')='September'">09</xsl:when> > <xsl:when test="substring-before(.,' ')='October'">10</xsl:when> > <xsl:when test="substring-before(.,' ')='November'">11</xsl:when> > <xsl:when test="substring-before(.,' ')='December'">12</xsl:when> > <xsl:otherwise>00</xsl:otherwise> > </xsl:choose> > <xsl:text>-</xsl:text> > <xsl:value-of select="substring-before(substring-after(.,' '),',')"/> > </xsl:otherwise> ></xsl:choose> ></date> ></xsl:template> > ></xsl:stylesheet> >EOXSL > >def glsainfo(f) > $X.xml = IO.read(f) > $X.process > puts $X.xres if $X.xerr["xmlErrCode"] = 0 >end > > >puts <<-EOT ><?xml version="1.0" encoding="utf-8"?> ><!DOCTYPE glsa-index [ > <!ELEMENT glsa-index (glsa+)> > <!ELEMENT glsa (date,title,synopsis,link,impact,package*,bug*)> > <!ATTLIST glsa id CDATA #REQUIRED> > <!ELEMENT date (#PCDATA)> > <!ELEMENT title (#PCDATA)> > <!ELEMENT synopsis (#PCDATA)> > <!ELEMENT link (#PCDATA)> > <!ELEMENT impact (#PCDATA)> > <!ELEMENT package (#PCDATA)> > <!ELEMENT bug (#PCDATA)> >]> ><glsa-index> >EOT > >ar = Dir.glob("#{ARGV[0]}/glsa-??????-??.xml").sort.reverse >while glsa=ar.shift do > glsainfo(glsa) >end > >puts '</glsa-index>'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 141909
:
140861
|
148646