rpms/coreutils/F-10 coreutils-6.12-sort-endoffields.patch, 1.1, 1.2 coreutils-i18n.patch, 1.27, 1.28 coreutils.spec, 1.237, 1.238
Ondrej Vasik
ovasik at fedoraproject.org
Mon Mar 2 13:51:19 UTC 2009
Author: ovasik
Update of /cvs/extras/rpms/coreutils/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15763
Modified Files:
coreutils-6.12-sort-endoffields.patch coreutils-i18n.patch
coreutils.spec
Log Message:
fix sort bugs (including #485715) for multibyte locales
coreutils-6.12-sort-endoffields.patch:
Index: coreutils-6.12-sort-endoffields.patch
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-10/coreutils-6.12-sort-endoffields.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- coreutils-6.12-sort-endoffields.patch 26 Feb 2009 16:28:44 -0000 1.1
+++ coreutils-6.12-sort-endoffields.patch 2 Mar 2009 13:51:18 -0000 1.2
@@ -79,7 +79,18 @@
diff -urNp coreutils-6.12-orig/tests/misc/sort coreutils-6.12/tests/misc/sort
--- coreutils-6.12-orig/tests/misc/sort 2008-05-17 08:41:12.000000000 +0200
+++ coreutils-6.12/tests/misc/sort 2009-02-26 16:25:39.000000000 +0100
-@@ -108,6 +108,8 @@ my @Tests =
+@@ -24,6 +24,10 @@ my $prog = 'sort';
+ # Turn off localization of executable's output.
+ @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
+
++my $mb_locale = $ENV{LOCALE_FR_UTF8};
++! defined $mb_locale || $mb_locale eq 'none'
++ and $mb_locale = 'C';
++
+ # Since each test is run with a file name and with redirected stdin,
+ # the name in the diagnostic is either the file name or "-".
+ # Normalize each diagnostic to use '-'.
+@@ -108,6 +114,8 @@ my @Tests =
["07b", '-k 2,3', {IN=>"a a b\nz a a\n"}, {OUT=>"z a a\na a b\n"}],
["07c", '-k 2,3', {IN=>"y k b\nz k a\n"}, {OUT=>"z k a\ny k b\n"}],
["07d", '+1 -3', {IN=>"y k b\nz k a\n"}, {OUT=>"z k a\ny k b\n"}],
@@ -88,7 +99,7 @@
#
# report an error for `.' without following char spec
["08a", '-k 2.,3', {EXIT=>2},
-@@ -208,6 +210,10 @@ my @Tests =
+@@ -208,6 +216,15 @@ my @Tests =
# key start and key end.
["18e", '-nb -k1.1,1.2', {IN=>" 901\n100\n"}, {OUT=>"100\n 901\n"}],
@@ -96,6 +107,11 @@
+# next field are not included in the sort. I.E. order should not change here.
+["18f", '-k1,1b', {IN=>"a y\na z\n"}, {OUT=>"a y\na z\n"}],
+
++# When ignoring leading blanks for start position, ensure blanks from
++# next field are not included in the sort. I.E. order should not change here.
++# This was noticed as an issue on fedora 8 (only in multibyte locales).
++["18g", '-k1b,1', {IN=>"a y\na z\n"}, {OUT=>"a y\na z\n"},
++ {ENV => "LC_ALL=$mb_locale"}],
# This looks odd, but works properly -- 2nd keyspec is never
# used because all lines are different.
["19a", '+0 +1nr', {IN=>"b 2\nb 1\nb 3\n"}, {OUT=>"b 1\nb 2\nb 3\n"}],
coreutils-i18n.patch:
Index: coreutils-i18n.patch
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-10/coreutils-i18n.patch,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- coreutils-i18n.patch 16 Jul 2008 14:22:18 -0000 1.27
+++ coreutils-i18n.patch 2 Mar 2009 13:51:18 -0000 1.28
@@ -1919,7 +1919,7 @@
if (newlim)
lim = newlim;
}
-@@ -1384,6 +1570,107 @@
+@@ -1384,6 +1570,113 @@
return ptr;
}
@@ -1931,7 +1931,10 @@
+ size_t eword = key->eword, echar = key->echar;
+ int i;
+ size_t mblength;
++
+ mbstate_t state;
++ if (echar == 0)
++ eword++; /* skip all of end field. */
+
+ memset (&state, '\0', sizeof(mbstate_t));
+
@@ -2001,24 +2004,27 @@
+ }
+# endif
+
-+ /* If we're skipping leading blanks, don't start counting characters
-+ * until after skipping past any leading blanks. */
-+ if (key->skipsblanks)
-+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
-+ ptr += mblength;
++ if (echar != 0)
++ {
++ /* If we're skipping leading blanks, don't start counting characters
++ * until after skipping past any leading blanks. */
++ if (key->skipsblanks)
++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++ ptr += mblength;
+
-+ memset (&state, '\0', sizeof(mbstate_t));
++ memset (&state, '\0', sizeof(mbstate_t));
+
-+ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
-+ for (i = 0; i < echar; i++)
-+ {
-+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
++ for (i = 0; i < echar; i++)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
+
-+ if (ptr + mblength > lim)
-+ break;
-+ else
-+ ptr += mblength;
-+ }
++ if (ptr + mblength > lim)
++ break;
++ else
++ ptr += mblength;
++ }
++ }
+
+ return ptr;
+}
Index: coreutils.spec
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-10/coreutils.spec,v
retrieving revision 1.237
retrieving revision 1.238
diff -u -r1.237 -r1.238
--- coreutils.spec 26 Feb 2009 16:28:44 -0000 1.237
+++ coreutils.spec 2 Mar 2009 13:51:18 -0000 1.238
@@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 6.12
-Release: 19%{?dist}
+Release: 20%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -342,6 +342,10 @@
/sbin/runuser
%changelog
+* Mon Mar 02 2009 Ondrej Vasik <ovasik at redhat.com> - 6.12-20
+- fix sort bugs (including #485715) for multibyte locales
+ as well
+
* Thu Feb 26 2009 Ondrej Vasik <ovasik at redhat.com> - 6.12-19
- fix showing ACL's for ls -Z (#487374), fix automatic
column width for it as well
More information about the fedora-extras-commits
mailing list