Handle case where archive.json contains old entries (those with .HHMM in versions)

This commit is contained in:
Steve Purcell 2012-09-01 20:26:20 +01:00
parent 55139921af
commit df1201cff2

View file

@ -21,7 +21,7 @@
package = OpenStruct.new
package.name = pkgname
package.version = version
hour_portion = sprintf("%04d", versions[1])
hour_portion = versions[1] ? sprintf("%04d", versions[1]) : "0000"
package.build_time = Time.new(version[0..3].to_i, version[4..5].to_i, version[6..7].to_i, hour_portion[0..1].to_i, hour_portion[2..3].to_i)
package.url = "#{base_url}packages/#{pkgname}-#{version}." + (pkgtype == "single" ? "el" : "tar")
package.info_url = "#{base_url}##{pkgname}"
@ -35,4 +35,4 @@
</item>
<% end %>
</channel>
</rss>
</rss>