Hello community,

here is the log from the commit of package perl-Hash-MoreUtils for 
openSUSE:Factory checked in at 2014-02-12 07:17:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Hash-MoreUtils (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Hash-MoreUtils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Hash-MoreUtils"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Hash-MoreUtils/perl-Hash-MoreUtils.changes  
2013-10-11 09:00:34.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Hash-MoreUtils.new/perl-Hash-MoreUtils.changes 
    2014-02-12 09:48:14.000000000 +0100
@@ -1,0 +2,6 @@
+Sun Feb  9 13:33:37 UTC 2014 - co...@suse.com
+
+- updated to 0.05
+ - Fix hashsort with sort block (Koichi Nakashima - http://nksm.name)
+
+-------------------------------------------------------------------

Old:
----
  Hash-MoreUtils-0.04.tar.gz

New:
----
  Hash-MoreUtils-0.05.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Hash-MoreUtils.spec ++++++
--- /var/tmp/diff_new_pack.5JnDdc/_old  2014-02-12 09:48:15.000000000 +0100
+++ /var/tmp/diff_new_pack.5JnDdc/_new  2014-02-12 09:48:15.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Hash-MoreUtils
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Hash-MoreUtils
-Version:        0.04
+Version:        0.05
 Release:        0
 %define cpan_name Hash-MoreUtils
 Summary:        Provide the stuff missing in Hash::Util
@@ -29,9 +29,8 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
 BuildRequires:  perl-macros
-BuildRequires:  perl(Module::Build) >= 0.40
+BuildRequires:  perl(Module::Build) >= 0.4200
 BuildRequires:  perl(Test::More) >= 0.90
-#BuildRequires: perl(Hash::MoreUtils)
 %{perl_requires}
 
 %description

++++++ Hash-MoreUtils-0.04.tar.gz -> Hash-MoreUtils-0.05.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Hash-MoreUtils-0.04/Changes 
new/Hash-MoreUtils-0.05/Changes
--- old/Hash-MoreUtils-0.04/Changes     2013-10-04 21:08:43.000000000 +0200
+++ new/Hash-MoreUtils-0.05/Changes     2013-12-09 09:34:28.000000000 +0100
@@ -1,17 +1,20 @@
 Revision history for Hash-MoreUtils
 
-0.04  2013-10-04
+0.05   2013-12-09
+    - Fix hashsort with sort block (Koichi Nakashima - http://nksm.name)
+
+0.04   2013-10-04
     - add slice_map family
     - Changes reformatted as per CPAN::Changes::Spec
 
-0.03  2013-09-07
+0.03   2013-09-07
     - Add documentation about intended behaviour of slice* when no
       list given (fixing RT#77429 and RT#57095), thanks to Titi Ala'ilima
       and Bernhard Graf
     - Changes reformatted as per CPAN::Changes::Spec
     - Move to GitHub.com
 
-0.02  2010-04-28
+0.02   2010-04-28
     - Taking maintainership (Jens Rehsack)
     - Implement optimized versions for slice, slice_exists and
       slice_def
@@ -19,5 +22,5 @@
     - Add safe_reverse as wished in RT#48403 (Ed Davis)
     - Add test for hashsort
 
-0.01  2005-11-05
+0.01   2005-11-05
     - First version, released on an unsuspecting world.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Hash-MoreUtils-0.04/META.json 
new/Hash-MoreUtils-0.05/META.json
--- old/Hash-MoreUtils-0.04/META.json   2013-10-04 21:08:43.000000000 +0200
+++ new/Hash-MoreUtils-0.05/META.json   2013-12-09 09:34:28.000000000 +0100
@@ -5,7 +5,7 @@
       "Jens Rehsack <rehs...@cpan.org>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "Module::Build version 0.4007, CPAN::Meta::Converter 
version 2.132661",
+   "generated_by" : "Module::Build version 0.4203",
    "license" : [
       "perl_5"
    ],
@@ -22,14 +22,14 @@
       },
       "configure" : {
          "requires" : {
-            "Module::Build" : "0.40"
+            "Module::Build" : "0.42"
          }
       }
    },
    "provides" : {
       "Hash::MoreUtils" : {
          "file" : "lib/Hash/MoreUtils.pm",
-         "version" : "0.04"
+         "version" : "0.05"
       }
    },
    "release_status" : "stable",
@@ -41,5 +41,5 @@
          "url" : "https://github.com/perl5-utils/Hash-MoreUtils";
       }
    },
-   "version" : "0.04"
+   "version" : "0.05"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Hash-MoreUtils-0.04/META.yml 
new/Hash-MoreUtils-0.05/META.yml
--- old/Hash-MoreUtils-0.04/META.yml    2013-10-04 21:08:43.000000000 +0200
+++ new/Hash-MoreUtils-0.05/META.yml    2013-12-09 09:34:28.000000000 +0100
@@ -6,9 +6,9 @@
 build_requires:
   Test::More: 0.90
 configure_requires:
-  Module::Build: 0.40
+  Module::Build: 0.42
 dynamic_config: 1
-generated_by: 'Module::Build version 0.4007, CPAN::Meta::Converter version 
2.132661'
+generated_by: 'Module::Build version 0.4203, CPAN::Meta::Converter version 
2.132830'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -17,8 +17,8 @@
 provides:
   Hash::MoreUtils:
     file: lib/Hash/MoreUtils.pm
-    version: 0.04
+    version: 0.05
 resources:
   license: http://dev.perl.org/licenses/
   repository: https://github.com/perl5-utils/Hash-MoreUtils
-version: 0.04
+version: 0.05
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Hash-MoreUtils-0.04/lib/Hash/MoreUtils.pm 
new/Hash-MoreUtils-0.05/lib/Hash/MoreUtils.pm
--- old/Hash-MoreUtils-0.04/lib/Hash/MoreUtils.pm       2013-10-04 
21:08:43.000000000 +0200
+++ new/Hash-MoreUtils-0.05/lib/Hash/MoreUtils.pm       2013-12-09 
09:34:28.000000000 +0100
@@ -19,7 +19,7 @@
 
 @EXPORT_OK = ( @{ $EXPORT_TAGS{all} } );
 
-$VERSION = '0.04';
+$VERSION = '0.05';
 
 =head1 NAME
 
@@ -187,12 +187,23 @@
 sub hashsort
 {
     my ( $code, $hash ) = @_;
-    unless ($hash)
+    my $cmp;
+    if ( $hash )
+    {
+        my $package = caller;
+        $cmp = sub {
+          no strict 'refs';
+          local ${$package.'::a'} = $a;
+          local ${$package.'::b'} = $b;
+          $code->();
+        };
+    }
+    else
     {
         $hash = $code;
-        $code = sub { $a cmp $b };
+        $cmp = sub { $a cmp $b };
     }
-    return map { ( $_ => $hash->{$_} ) } sort { $code->() } keys %$hash;
+    return map { ( $_ => $hash->{$_} ) } sort { $cmp->() } keys %$hash;
 }
 
 =head2 C<safe_reverse> [BLOCK,] HASHREF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Hash-MoreUtils-0.04/t/01-hash.t 
new/Hash-MoreUtils-0.05/t/01-hash.t
--- old/Hash-MoreUtils-0.04/t/01-hash.t 2013-10-04 21:08:43.000000000 +0200
+++ new/Hash-MoreUtils-0.05/t/01-hash.t 2013-12-09 09:34:28.000000000 +0100
@@ -135,6 +135,18 @@
   "hashsort with default function",
 );
 
+is_deeply(
+  [ hashsort sub { $a cmp $b }, \%h ],
+  [ 'a', 1, 'b', 2, 'c', undef ],
+  "hashsort with sort block",
+);
+
+is_deeply(
+  [ hashsort sub { $b cmp $a }, \%h ],
+  [ 'c', undef, 'b', 2, 'a', 1 ],
+  "hashsort with sort block (reverse)",
+);
+
 my %he = slice_def(\%h);
 is_deeply( 
   { safe_reverse(\%he), },

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to