Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ignore prerelease versions in rpg-parse-index for now

  • Loading branch information...
commit 2b5fb2bfd95fb575b42448541fda8a052cd07221 1 parent a925852
@rtomayko authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 rpg-parse-index.rb
View
10 rpg-parse-index.rb
@@ -104,15 +104,22 @@ def marshal_load(data)
map! { |p| p.to_i }
end
+ def prerelease?
+ @string.match(/[^0-9.]/)
+ end
+
def to_s
@string
end
end
end
-# Load packages in from STDIN.
+# Load packages in from STDIN and unmarshal.
packages = Marshal.load(STDIN)
+# XXX reject prerelease packages for now until we can deal with them.
+packages.reject! { |name,version,platform| version.prerelease? }
+
# Sort packages by name and then reverse version number.
#
# TODO prelease version sorting.
@@ -126,6 +133,7 @@ def to_s
# Finally, run over the sorted list and write a line of output for each package.
packages.each do |name,version,platform|
+ platform.gsub!(/[^A-Za-z0-9_-]/, '_')
puts "#{name} #{version} #{platform}"
end
Please sign in to comment.
Something went wrong with that request. Please try again.