Skip to content

Commit

Permalink
[JENKINS-43849] Order by version
Browse files Browse the repository at this point in the history
  • Loading branch information
armfergom committed Apr 26, 2017
1 parent 679f755 commit 6a1e0c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/list-packages.rb
Expand Up @@ -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')
Expand Down

0 comments on commit 6a1e0c3

Please sign in to comment.