[DRE-commits] [librarian-puppet] 01/97: Correctly sort tagged version numbers

Stig Sandbeck Mathisen ssm at debian.org
Tue Mar 11 12:12:46 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository librarian-puppet.

commit e1f647c3d8bca6b7ac19aa7b2267cfbe1af5f1a6
Author: Jozef Izso <jozef.izso at gmail.com>
Date:   Fri Jul 12 18:37:32 2013 +0200

    Correctly sort tagged version numbers
    
    Removes the "v" char from tags before sorting.
    Some repositories contain tags using both "1.0.0" and "v1.0.1" version formats. In those cases tags were incorrectly sorted.
---
 lib/librarian/puppet/source/githubtarball.rb | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/librarian/puppet/source/githubtarball.rb b/lib/librarian/puppet/source/githubtarball.rb
index 719fa00..4c05dd9 100644
--- a/lib/librarian/puppet/source/githubtarball.rb
+++ b/lib/librarian/puppet/source/githubtarball.rb
@@ -24,11 +24,7 @@ module Librarian
               raise Error, "Unable to find module '#{source.uri}' on https://github.com"
             end
 
-            all_versions = data.map { |r| r['name'] }.sort.reverse
-
-            all_versions = all_versions.map do |version|
-              version.gsub(/^v/, '')
-            end
+            all_versions = data.map { |r| r['name'].gsub(/^v/, '') }.sort.reverse
 
             all_versions.delete_if do |version|
               version !~ /\A\d\.\d(\.\d.*)?\z/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/librarian-puppet.git



More information about the Pkg-ruby-extras-commits mailing list