Skip to content
Permalink
Browse files

[JENKINS-43849] Order by version

  • Loading branch information
armfergom committed Apr 26, 2017
1 parent 679f755 commit 6a1e0c31df4626e7a7fb11147e3e6a54e9c7086b
Showing with 3 additions and 3 deletions.
  1. +3 −3 bin/list-packages.rb
@@ -17,9 +17,9 @@ def list_packages(path,glob,rel)
debs = [];
sftp.dir.glob(path,glob) { |f| debs << f }

p=/^[^_-]+/
debs.sort {|x,y| y.name.gsub(p,"")<=>x.name.gsub(p,"")}.each do |f|
versionRE=/^([^\d]+[-_])(.*)([-_].+)$/

debs.sort {|x,y| Gem::Version.new(y.name.match(versionRE).captures[1])<=>Gem::Version.new(x.name.match(versionRE).captures[1])}.each do |f|
puts "<tr><td><a href='#{rel}/#{f.name}'>#{f.name}</a></td>"

t=Time.at(f.attributes.mtime).strftime('%Y/%m/%d')

0 comments on commit 6a1e0c3

Please sign in to comment.
You can’t perform that action at this time.