Hello community,
here is the log from the commit of package perl-Sort-Naturally for
openSUSE:Factory checked in at 2013-06-21 13:32:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Sort-Naturally (Old)
and /work/SRC/openSUSE:Factory/.perl-Sort-Naturally.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Sort-Naturally"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Sort-Naturally/perl-Sort-Naturally.changes
2011-09-23 12:38:44.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Sort-Naturally.new/perl-Sort-Naturally.changes
2013-06-21 13:37:17.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Jun 4 18:20:57 UTC 2013 - [email protected]
+
+- updated to 1.03
+ * release 1.03 -- modernise the distribution
+
+-------------------------------------------------------------------
Old:
----
Sort-Naturally-1.02.tar.gz
New:
----
Sort-Naturally-1.03.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Sort-Naturally.spec ++++++
--- /var/tmp/diff_new_pack.KnWIEt/_old 2013-06-21 13:37:17.000000000 +0200
+++ /var/tmp/diff_new_pack.KnWIEt/_new 2013-06-21 13:37:17.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Sort-Naturally
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 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
@@ -15,33 +15,77 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
-# norootforbuild
-
Name: perl-Sort-Naturally
+Version: 1.03
+Release: 0
%define cpan_name Sort-Naturally
-Summary: Sort lexically, but sort numeral parts numerically
-Version: 1.02
-Release: 1
-License: GPL-1.0+ or Artistic-1.0
+Summary: sort lexically, but sort numeral parts numerically
+License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Sort-Naturally/
-Source:
http://www.cpan.org/modules/by-module/Sort/Sort-Naturally-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-%{perl_requires}
+Source:
http://www.cpan.org/authors/id/B/BI/BINGOS/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
+#BuildRequires: perl(Sort::Naturally)
+%{perl_requires}
%description
-This module exports two functions, nsort and ncmp; they are used in
+This module exports two functions, 'nsort' and 'ncmp'; they are used in
implementing my idea of a "natural sorting" algorithm. Under natural
-sorting, numeric substrings are compared numerically, and other word-
-characters are compared lexically.
+sorting, numeric substrings are compared numerically, and other
+word-characters are compared lexically.
+
+This is the way I define natural sorting:
+
+* *
+
+ Non-numeric word-character substrings are sorted lexically,
+ case-insensitively: "Foo" comes between "fish" and "fowl".
+
+* *
+
+ Numeric substrings are sorted numerically: "100" comes after "20", not
+ before.
+
+* *
-Authors:
---------
- Sean M. Burke <[email protected]>
+ \W substrings (neither words-characters nor digits) are _ignored_.
+
+* *
+
+ Our use of \w, \d, \D, and \W is locale-sensitive: Sort::Naturally uses a
+ 'use locale' statement.
+
+* *
+
+ When comparing two strings, where a numeric substring in one place is
+ _not_ up against a numeric substring in another, the non-numeric always
+ comes first. This is fudged by reading pretending that the lack of a
+ number substring has the value -1, like so:
+
+ foo => "foo", -1
+ foobar => "foo", -1, "bar"
+ foo13 => "foo", 13,
+ foo13xyz => "foo", 13, "xyz"
+
+ That's so that "foo" will come before "foo13", which will come before
+ "foobar".
+
+* *
+
+ The start of a string is exceptional: leading non-\W (non-word,
+ non-digit) components are are ignored, and numbers come _before_ letters.
+
+* *
+
+ I define "numeric substring" just as sequences matching m/\d+/ --
+ scientific notation, commas, decimals, etc., are not seen. If your data
+ has thousands separators in numbers ("20,000 Leagues Under The Sea" or
+ "20.000 lieues sous les mers"), consider stripping them before feeding
+ them to 'nsort' or 'ncmp'.
%prep
%setup -q -n %{cpan_name}-%{version}
@@ -55,18 +99,11 @@
%install
%perl_make_install
-# do not perl_process_packlist (noarch)
-# remove .packlist file
-%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
-# remove perllocal.pod file
-%{__rm} -rf $RPM_BUILD_ROOT%perl_archlib
+%perl_process_packlist
%perl_gen_filelist
-%clean
-%{__rm} -rf $RPM_BUILD_ROOT
-
%files -f %{name}.files
-%defattr(-,root,root,-)
+%defattr(-,root,root,755)
%doc ChangeLog README
%changelog
++++++ Sort-Naturally-1.02.tar.gz -> Sort-Naturally-1.03.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/ChangeLog
new/Sort-Naturally-1.03/ChangeLog
--- old/Sort-Naturally-1.02/ChangeLog 2004-12-30 04:30:21.000000000 +0100
+++ new/Sort-Naturally-1.03/ChangeLog 2012-04-11 10:47:55.000000000 +0200
@@ -1,10 +1,13 @@
Revision history for Perl module Sort::Naturally
- Time-stamp: "2004-12-29 18:30:21 AST"
+
+2012-04-11 bingos [email protected]
+
+ * release 1.03 -- modernise the distribution
2004-12-29 Sean M. Burke [email protected]
* Release 1.02 -- just rebundling, no code changes
-
+
2001-05-25 Sean M. Burke [email protected]
* Release 1.01 -- first public release.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/MANIFEST
new/Sort-Naturally-1.03/MANIFEST
--- old/Sort-Naturally-1.02/MANIFEST 2004-12-30 08:15:34.000000000 +0100
+++ new/Sort-Naturally-1.03/MANIFEST 2012-04-11 10:48:45.000000000 +0200
@@ -7,3 +7,4 @@
t/00_about_verbose.t
t/01_old_junk.t
META.yml Module meta-data (added by MakeMaker)
+META.json Module JSON meta-data (added by
MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/MANIFEST.SKIP
new/Sort-Naturally-1.03/MANIFEST.SKIP
--- old/Sort-Naturally-1.02/MANIFEST.SKIP 2004-12-30 04:30:25.000000000
+0100
+++ new/Sort-Naturally-1.03/MANIFEST.SKIP 2012-04-11 10:36:16.000000000
+0200
@@ -4,4 +4,5 @@
CVS
blib
~
-
+.git
+.bak$
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/META.json
new/Sort-Naturally-1.03/META.json
--- old/Sort-Naturally-1.02/META.json 1970-01-01 01:00:00.000000000 +0100
+++ new/Sort-Naturally-1.03/META.json 2012-04-11 10:48:45.000000000 +0200
@@ -0,0 +1,46 @@
+{
+ "abstract" : "sort lexically, but sort numeral parts numerically",
+ "author" : [
+ "Sean M. Burke <[email protected]>"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter
version 2.120921",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "Sort-Naturally",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "perl" : "5"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "repository" : {
+ "url" : "https://github.com/bingos/sort-naturally"
+ }
+ },
+ "version" : "1.03"
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/META.yml
new/Sort-Naturally-1.03/META.yml
--- old/Sort-Naturally-1.02/META.yml 2004-12-30 08:15:40.000000000 +0100
+++ new/Sort-Naturally-1.03/META.yml 2012-04-11 10:48:44.000000000 +0200
@@ -1,10 +1,24 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Sort-Naturally
-version: 1.02
-version_from: lib/Sort/Naturally.pm
-installdirs: site
+---
+abstract: 'sort lexically, but sort numeral parts numerically'
+author:
+ - 'Sean M. Burke <[email protected]>'
+build_requires:
+ ExtUtils::MakeMaker: 0
+configure_requires:
+ ExtUtils::MakeMaker: 0
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version
2.120921'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Sort-Naturally
+no_index:
+ directory:
+ - t
+ - inc
requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+ perl: 5
+resources:
+ repository: https://github.com/bingos/sort-naturally
+version: 1.03
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/Makefile.PL
new/Sort-Naturally-1.03/Makefile.PL
--- old/Sort-Naturally-1.02/Makefile.PL 2004-12-30 06:38:56.000000000 +0100
+++ new/Sort-Naturally-1.03/Makefile.PL 2012-04-11 10:43:05.000000000 +0200
@@ -9,9 +9,45 @@
use strict;
use ExtUtils::MakeMaker;
-WriteMakefile(
- 'NAME' => 'Sort::Naturally',
+WriteMakefile1(
+ LICENSE => 'perl',
+ MIN_PERL_VERSION => '5',
+ META_MERGE => {
+ resources => {
+ repository => 'https://github.com/bingos/sort-naturally',
+ },
+ },
+ #BUILD_REQUIRES => {
+ #},
+
+ 'AUTHOR' => 'Sean M. Burke <[email protected]>',
+ 'ABSTRACT' => 'sort lexically, but sort numeral parts numerically',
+ 'NAME' => 'Sort::Naturally',
'VERSION_FROM' => 'lib/Sort/Naturally.pm', # finds $VERSION
'dist' => { COMPRESS => 'gzip -6f', SUFFIX => 'gz', },
);
+
+sub WriteMakefile1 { #Written by Alexandr Ciornii, version 0.21. Added by
eumm-upgrade.
+ my %params=@_;
+ my $eumm_version=$ExtUtils::MakeMaker::VERSION;
+ $eumm_version=eval $eumm_version;
+ die "EXTRA_META is deprecated" if exists $params{EXTRA_META};
+ die "License not specified" if not exists $params{LICENSE};
+ if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) {
+ #EUMM 6.5502 has problems with BUILD_REQUIRES
+ $params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} ,
%{$params{BUILD_REQUIRES}} };
+ delete $params{BUILD_REQUIRES};
+ }
+ delete $params{CONFIGURE_REQUIRES} if $eumm_version < 6.52;
+ delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48;
+ delete $params{META_MERGE} if $eumm_version < 6.46;
+ delete $params{META_ADD} if $eumm_version < 6.46;
+ delete $params{LICENSE} if $eumm_version < 6.31;
+ delete $params{AUTHOR} if $] < 5.005;
+ delete $params{ABSTRACT_FROM} if $] < 5.005;
+ delete $params{BINARY_LOCATION} if $] < 5.005;
+
+ WriteMakefile(%params);
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/lib/Sort/Naturally.pm
new/Sort-Naturally-1.03/lib/Sort/Naturally.pm
--- old/Sort-Naturally-1.02/lib/Sort/Naturally.pm 2004-12-30
04:30:03.000000000 +0100
+++ new/Sort-Naturally-1.03/lib/Sort/Naturally.pm 2012-04-11
10:46:08.000000000 +0200
@@ -1,7 +1,7 @@
require 5;
package Sort::Naturally; # Time-stamp: "2004-12-29 18:30:03 AST"
-$VERSION = '1.02';
+$VERSION = '1.03';
@EXPORT = ('nsort', 'ncmp');
require Exporter;
@ISA = ('Exporter');
@@ -55,24 +55,24 @@
} else {
$rv = 0;
}
-
+
unless($rv) {
# Normal case:
$rv = 0;
DEBUG and print "<$x> and <$y> compared...\n";
-
+
Consideration:
while(length $x and length $y) {
-
+
DEBUG > 2 and print " <$x> and <$y>...\n";
-
+
# First, non-numeric comparison:
$x2 = ($x =~ m/^(\D+)/s) ? length($1) : 0;
$y2 = ($y =~ m/^(\D+)/s) ? length($1) : 0;
# Now make x2 the min length of the two:
$x2 = $y2 if $x2 > $y2;
if($x2) {
- DEBUG > 1 and printf " <%s> and <%s> lexically for length $x2...\n",
+ DEBUG > 1 and printf " <%s> and <%s> lexically for length $x2...\n",
substr($x,0,$x2), substr($y,0,$x2);
do {
my $i = substr($x,0,$x2);
@@ -81,10 +81,10 @@
print "SCREAM! on <$i><$j> -- $sv != $rv \n" unless $rv == $sv;
last;
}
-
-
+
+
if $rv =
- # The ''. things here force a copy that seems to work around a
+ # The ''. things here force a copy that seems to work around a
# mysterious intermittent bug that 'use locale' provokes in
# many versions of Perl.
$cmp
@@ -100,7 +100,7 @@
substr($x,0,$x2) = '';
substr($y,0,$x2) = '';
}
-
+
# Now numeric:
# (actually just using $x2 and $y2 as scratch)
@@ -114,12 +114,12 @@
last if $rv = $x2 <=> $1;
} else {
# ARBITRARILY large integers!
-
+
# This saves on loss of precision that could happen
# with actual stringification.
# Also, I sense that very large numbers aren't too
# terribly common in sort data.
-
+
# trim leading 0's:
($y2 = $1) =~ s/^0+//s;
$x2 =~ s/^0+//s;
@@ -138,7 +138,7 @@
# X is numeric but Y isn't
$rv = Y_FIRST;
last;
- }
+ }
} elsif( $y =~ s/^\d+//s ) { # we don't need to capture the substring
$rv = X_FIRST;
last;
@@ -166,7 +166,7 @@
($cmp,$lc) = @{shift @_} if @_ and ref($_[0]) eq 'ARRAY';
return @_ unless @_ > 1 or wantarray; # be clever
-
+
my($x, $x2, $y, $y2, $rv); # scratch vars
# We use a Schwartzian xform to memoize the lc'ing and \W-removal
@@ -175,7 +175,7 @@
sort {
if($a->[0] eq $b->[0]) { 0 } # trap this expensive case
else {
-
+
$x = $a->[1];
$y = $b->[1];
@@ -188,7 +188,7 @@
|| ($x cmp $y )
|| ($a->[0] cmp $b->[0])
;
-
+
DEBUG > 1 and print " <${$a}[0]> cmp <${$b}[0]> is $rv ($ORD[$rv])\n";
$rv;
}}
@@ -220,7 +220,7 @@
}
my($a,$b) = @_;
my($x, $x2, $y, $y2, $rv); # scratch vars
-
+
DEBUG > 1 and print "ncmp args <$a><$b>\n";
if($a eq $b) { # trap this expensive case
0;
@@ -229,7 +229,7 @@
$x =~ s/\W+//s;
$y = ($lc ? $lc->($b) : lc($b));
$y =~ s/\W+//s;
-
+
~COMPARATOR~
@@ -240,7 +240,7 @@
|| ($x cmp $y)
|| ($a cmp $b)
;
-
+
DEBUG > 1 and print " <$a> cmp <$b> is $rv\n";
$rv;
}
@@ -391,7 +391,7 @@
map { [$_, make_a_sort_key_from($_) ]
@_
;
-
+
...you wight want something that replaces not C<sort>, but C<cmp>.
That's what Sort::Naturally's C<ncmp> function is for. Call it with
the syntax C<ncmp($left,$right)> instead of C<$left cmp $right>,
@@ -503,11 +503,11 @@
sub nsort {
my($cmp, $lc);
return @_ if @_ < 2; # Just to be CLEVER.
-
+
my($x, $i); # scratch vars
-
+
# And now, the GREAT BIG Schwartzian transform:
-
+
map
$_->[0],
@@ -542,7 +542,7 @@
map {
my @bit = ($x = defined($_) ? $_ : '');
-
+
if($x =~ m/^[+-]?(?=\d|\.\d)\d*(?:\.\d*)?(?:[Ee](?:[+-]?\d+))?\z/s) {
# It's entirely purely numeric, so treat it specially:
push @bit, '', $x;
@@ -565,7 +565,7 @@
# ['foo32.pl' => 'foo', 32, , '.pl', 0 ]
# ['foo325.pl' => 'foo', 325, , '.pl', 0 ]
# Yes, always an ODD number of elements.
-
+
\@bit;
}
@_;
@@ -576,11 +576,11 @@
sub nsorts {
return @_ if @_ < 2; # Just to be CLEVER.
-
+
my($x, $i); # scratch vars
-
+
# And now, the GREAT BIG Schwartzian transform:
-
+
map
$_->[0],
@@ -615,7 +615,7 @@
map {
my @bit = ($x = defined($_) ? $_ : '');
-
+
while(length $x) {
push @bit, ($x =~ s/^(\D+)//s) ? lc($1) : '';
push @bit, ($x =~ s/^(\d+)//s) ? $1 : 0;
@@ -632,7 +632,7 @@
# ['foo32.pl' => 'foo', 32, , '.pl', 0 ]
# ['foo325.pl' => 'foo', 325, , '.pl', 0 ]
# Yes, always an ODD number of elements.
-
+
\@bit;
}
@_;
@@ -643,11 +643,11 @@
sub nsort0 {
return @_ if @_ < 2; # Just to be CLEVER.
-
+
my($x, $i); # scratch vars
-
+
# And now, the GREAT BIG Schwartzian transform:
-
+
map
$_->[0],
@@ -682,7 +682,7 @@
map {
my @bit = ($x = defined($_) ? $_ : '');
-
+
if($x =~ m/^[+-]?(?=\d|\.\d)\d*(?:\.\d*)?(?:[Ee](?:[+-]?\d+))?\z/s) {
# It's entirely purely numeric, so treat it specially:
push @bit, '', $x;
@@ -703,7 +703,7 @@
}
}
DEBUG and print "$bit[0] => ", map("{$_} ", @bit), "\n";
-
+
\@bit;
}
@_;
@@ -715,11 +715,11 @@
sub nsortf {
return @_ if @_ < 2; # Just to be CLEVER.
-
+
my($x, $i); # scratch vars
-
+
# And now, the GREAT BIG Schwartzian transform:
-
+
map
$_->[0],
@@ -749,20 +749,20 @@
$x || (@$a <=> @$b ) || ($a->[1] cmp $b->[1])
|| ($a->[2] <=> $b->[2]) || ($a->[0] cmp $b->[0]);
# unless we found a result for $x in the while loop,
- # use length as a tiebreaker, otherwise use the
+ # use length as a tiebreaker, otherwise use the
# lc'd extension, otherwise the verison, otherwise use
# the original string as a fallback tiebreaker.
}
map {
my @bit = ( ($x = defined($_) ? $_ : ''), '',0 );
-
+
{
# Consume the string.
-
+
# First, pull off any VAX-style version
$bit[2] = $1 if $x =~ s/;(\d+)$//;
-
+
# Then pull off any apparent extension
if( $x !~ m/^\.+$/s and # don't mangle ".", "..", or "..."
$x =~ s/(\.[^\.\;]*)$//sg
@@ -800,9 +800,9 @@
}
}
}
-
+
DEBUG and print "$bit[0] => ", map("{$_} ", @bit), "\n";
-
+
\@bit;
}
@_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/t/00_about_verbose.t
new/Sort-Naturally-1.03/t/00_about_verbose.t
--- old/Sort-Naturally-1.02/t/00_about_verbose.t 2004-12-30
06:53:16.000000000 +0100
+++ new/Sort-Naturally-1.03/t/00_about_verbose.t 2012-04-11
10:28:40.000000000 +0200
@@ -37,7 +37,7 @@
next if $this eq 'main'; # %main:: is %::
#print "Peeking at $this => ${$this . '::VERSION'}\n";
-
+
if(defined ${$this . '::VERSION'} ) {
$v{$this} = ${$this . '::VERSION'}
} elsif(
@@ -51,7 +51,7 @@
# It's probably an unpopulated package.
## $v{$this} = '...';
}
-
+
$pref = length($this) ? "$this\::" : '';
push @stack, map m/^(.+)::$/ ? "$pref$1" : (), keys %{$this . '::'};
#print "Stack: @stack\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Sort-Naturally-1.02/t/01_old_junk.t
new/Sort-Naturally-1.03/t/01_old_junk.t
--- old/Sort-Naturally-1.02/t/01_old_junk.t 2004-12-30 04:29:18.000000000
+0100
+++ new/Sort-Naturally-1.03/t/01_old_junk.t 2012-04-11 10:28:40.000000000
+0200
@@ -30,19 +30,19 @@
foo12a foo12z foo13a foo 14 9x foo12 fooa foolio Foolio Foo12a
)
;
-
+
print "#\n# In: <@x>\n";
print "# nsort ...\n";
my @y = nsort(map $_, @x);
print "# ncmp ...\n";
my @z = sort {&ncmp($a,$b)}
- # map $_,
+ # map $_,
@x
;
#print "OK, <@x> => <@y>\n";
- print(
+ print(
"@y" eq "@z"
- ? scalar(ok(1), "# Good, eq") : scalar(ok(0), "# Feh, NE!\n< <@x>"),
+ ? scalar(ok(1), "# Good, eq") : scalar(ok(0), "# Feh, NE!\n< <@x>"),
"\n# <@y>\n# :<@z>\n"
);
if("@y" eq $ok1) {
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]