Skip to content
Permalink
Browse files

Merge pull request #97 from armfergom/JENKINS-43849

[JENKINS-43849] Sort RPM and DEV packages by date instead of by name
  • Loading branch information
svanoort committed May 18, 2017
2 parents ddd86a8 + 6a1e0c3 commit 84993c2d5ed4f1777702fea2125afa4f29081f78
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 84993c2

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