New upstream bugfix release 7.2, removed applied patches

This commit is contained in:
Ondrej Vasik 2009-03-31 15:48:26 +00:00
parent 81a387abc6
commit ca7ca126aa
7 changed files with 8 additions and 463 deletions

View File

@ -1 +1 @@
coreutils-7.1.tar.gz
coreutils-7.2.tar.gz

View File

@ -23,43 +23,6 @@ diff -urNp coreutils-6.11-orig/tests/test-lib.sh coreutils-6.11/tests/test-lib.s
skip_test_ "this system (or maybe just" \
"the current file system) lacks SELinux support"
;;
diff -urNp coreutils-7.1-orig/gnulib-tests/test-getaddrinfo.c coreutils-7.1/gnulib-tests/test-getaddrinfo.c
--- coreutils-7.1-orig/gnulib-tests/test-getaddrinfo.c 2009-01-27 21:33:19.000000000 +0100
+++ coreutils-7.1/gnulib-tests/test-getaddrinfo.c 2009-02-25 13:52:59.000000000 +0100
@@ -36,6 +36,8 @@
# define dbgprintf if (0) printf
#endif
+static int skip = 0;
+
/* BeOS does not have AF_UNSPEC. */
#ifndef AF_UNSPEC
# define AF_UNSPEC 0
@@ -52,6 +54,9 @@ int simple (char *host, char *service)
struct addrinfo *ai0, *ai;
int res;
+ if (skip)
+ return 0;
+
dbgprintf ("Finding %s service %s...\n", host, service);
/* This initializes "hints" but does not use it. Is there a reason
@@ -72,8 +77,12 @@ int simple (char *host, char *service)
in-law's farm. */
if (res == EAI_AGAIN)
{
- fprintf (stderr, "skipping getaddrinfo test: no network?\n");
- return 77;
+ if (!skip)
+ {
+ skip++;
+ fprintf (stderr, "skipping getaddrinfo test: no network?\n");
+ return 77;
+ }
}
/* IRIX reports EAI_NONAME for "https". Don't fail the test
merely because of this. */
diff -urNp coreutils-7.1-orig/src/ls.c coreutils-7.1/src/ls.c
--- coreutils-7.1-orig/src/ls.c 2009-02-25 13:23:59.000000000 +0100
+++ coreutils-7.1/src/ls.c 2009-02-25 13:25:20.000000000 +0100

View File

@ -1,160 +0,0 @@
From 2c0ac0d7fc6bce3abdbad8529e44318f1370a948 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <ovasik@redhat.com>
Date: Wed, 11 Mar 2009 16:08:20 +0100
Subject: [PATCH] cp: make -a option preserve xattrs with reduced diagnostics
* copy.c (copy_attr_by_fd): Reduce xattr diagnostics for 'cp -a'.
(copy_attr_by_name): Likewise.
* cp.c (main): preserve xattrs with -a option, when possible
* doc/coreutils.texi: document that xattrs are preserved with
cp -a, with no added diagnostics
* tests/misc/xattr: Add tests for 'cp --preserve=all' and 'cp -a'.
---
doc/coreutils.texi | 7 +++----
src/copy.c | 22 +++++++++++++---------
src/cp.c | 1 +
tests/misc/xattr | 15 +++++++++++++--
4 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 2c1fae5..0bf978a 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -7262,10 +7262,9 @@ Preserve as much as possible of the structure and attributes of the
original files in the copy (but do not attempt to preserve internal
directory structure; i.e., @samp{ls -U} may list the entries in a copied
directory in a different order).
-Try to preserve SELinux security context, but ignore any failure to do that
-and print no corresponding diagnostic.
-This option does not preserve extended attributes(xattr) at the moment.
-Equivalent to @option{-dR --preserve=all} with a few exceptions.
+Try to preserve SELinux security context and extended attributes (xattr),
+but ignore any failure to do that and print no corresponding diagnostic.
+Equivalent to @option{-dR --preserve=all} with the reduced diagnostics.
@item -b
@itemx @w{@kbd{--backup}[=@var{method}]}
diff --git a/src/copy.c b/src/copy.c
index e37fead..7b4dc08 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -153,13 +153,13 @@ copy_attr_quote (struct error_context *ctx ATTRIBUTE_UNUSED, char const *str)
static void
copy_attr_free (struct error_context *ctx ATTRIBUTE_UNUSED,
- char const *str ATTRIBUTE_UNUSED)
+ char const *str ATTRIBUTE_UNUSED)
{
}
static bool
copy_attr_by_fd (char const *src_path, int src_fd,
- char const *dst_path, int dst_fd)
+ char const *dst_path, int dst_fd, const struct cp_options *x)
{
struct error_context ctx =
{
@@ -167,11 +167,13 @@ copy_attr_by_fd (char const *src_path, int src_fd,
.quote = copy_attr_quote,
.quote_free = copy_attr_free
};
- return 0 == attr_copy_fd (src_path, src_fd, dst_path, dst_fd, 0, &ctx);
+ return 0 == attr_copy_fd (src_path, src_fd, dst_path, dst_fd, 0,
+ x->reduce_diagnostics ? NULL : &ctx);
}
static bool
-copy_attr_by_name (char const *src_path, char const *dst_path)
+copy_attr_by_name (char const *src_path, char const *dst_path,
+ const struct cp_options *x)
{
struct error_context ctx =
{
@@ -179,19 +181,21 @@ copy_attr_by_name (char const *src_path, char const *dst_path)
.quote = copy_attr_quote,
.quote_free = copy_attr_free
};
- return 0 == attr_copy_file (src_path, dst_path, 0, &ctx);
+ return 0 == attr_copy_file (src_path, dst_path, 0,
+ x-> reduce_diagnostics ? NULL :&ctx);
}
#else /* USE_XATTR */
static bool
copy_attr_by_fd (char const *src_path, int src_fd,
- char const *dst_path, int dst_fd)
+ char const *dst_path, int dst_fd, const struct cp_options *x)
{
return true;
}
static bool
-copy_attr_by_name (char const *src_path, char const *dst_path)
+copy_attr_by_name (char const *src_path, char const *dst_path,
+ const struct cp_options *x)
{
return true;
}
@@ -759,7 +763,7 @@ copy_reg (char const *src_name, char const *dst_name,
set_author (dst_name, dest_desc, src_sb);
if (x->preserve_xattr && ! copy_attr_by_fd (src_name, source_desc,
- dst_name, dest_desc)
+ dst_name, dest_desc, x)
&& x->require_preserve_xattr)
return false;
@@ -2076,7 +2080,7 @@ copy_internal (char const *src_name, char const *dst_name,
set_author (dst_name, -1, &src_sb);
- if (x->preserve_xattr && ! copy_attr_by_name (src_name, dst_name)
+ if (x->preserve_xattr && ! copy_attr_by_name (src_name, dst_name, x)
&& x->require_preserve_xattr)
return false;
diff --git a/src/cp.c b/src/cp.c
index af4bd60..8785076 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -925,6 +925,7 @@ main (int argc, char **argv)
x.require_preserve = true;
if (selinux_enabled)
x.preserve_security_context = true;
+ x.preserve_xattr = true;
x.reduce_diagnostics = true;
x.recursive = true;
break;
diff --git a/tests/misc/xattr b/tests/misc/xattr
index 4137c53..f067ff5 100755
--- a/tests/misc/xattr
+++ b/tests/misc/xattr
@@ -1,6 +1,7 @@
#!/bin/sh
-# Ensure that cp --preserve=xattr and mv preserve extended attributes and
-# install does not preserve extended attributes.
+# Ensure that cp --preserve=xattr, cp --preserve=all and mv preserve extended
+# attributes and install does not preserve extended attributes.
+# cp -a should preserve xattr, error diagnostics should not be displayed
# Copyright (C) 2009 Free Software Foundation, Inc.
@@ -66,6 +67,16 @@ cp --preserve=xattr a b || fail=1
getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
grep -F "$xattr_pair" out_b >/dev/null || fail=1
+#test if --preserve=all option works
+cp --preserve=all a c || fail=1
+getfattr -d c >out_c || skip_test_ "failed to get xattr of file"
+grep -F "$xattr_pair" out_c >/dev/null || fail=1
+
+#test if -a option works without any diagnostics
+cp -a a d 2>err && test -s err && fail=1
+getfattr -d d >out_d || skip_test_ "failed to get xattr of file"
+grep -F "$xattr_pair" out_d >/dev/null || fail=1
+
rm b || framework_failure
# install should never preserve xattr
--
1.5.6.1.156.ge903b

View File

@ -1,154 +0,0 @@
diff -urNp coreutils-7.1-orig/src/copy.c coreutils-7.1/src/copy.c
--- coreutils-7.1-orig/src/copy.c 2009-02-27 12:07:29.000000000 +0100
+++ coreutils-7.1/src/copy.c 2009-02-27 12:14:29.000000000 +0100
@@ -104,6 +104,7 @@ static bool copy_internal (char const *s
struct dir_list *ancestors,
const struct cp_options *x,
bool command_line_arg,
+ bool *first_dir_created_per_command_line_arg,
bool *copy_into_self,
bool *rename_succeeded);
static bool owner_failure_ok (struct cp_options const *x);
@@ -201,13 +202,16 @@ copy_attr_by_name (char const *src_path,
DST_NAME_IN is a directory that was created previously in the
recursion. SRC_SB and ANCESTORS describe SRC_NAME_IN.
Set *COPY_INTO_SELF if SRC_NAME_IN is a parent of
+ FIRST_DIR_CREATED_PER_COMMAND_LINE_ARG FIXME
(or the same as) DST_NAME_IN; otherwise, clear it.
Return true if successful. */
static bool
copy_dir (char const *src_name_in, char const *dst_name_in, bool new_dst,
const struct stat *src_sb, struct dir_list *ancestors,
- const struct cp_options *x, bool *copy_into_self)
+ const struct cp_options *x,
+ bool *first_dir_created_per_command_line_arg,
+ bool *copy_into_self)
{
char *name_space;
char *namep;
@@ -237,12 +241,20 @@ copy_dir (char const *src_name_in, char
ok &= copy_internal (src_name, dst_name, new_dst, src_sb->st_dev,
ancestors, &non_command_line_options, false,
+ first_dir_created_per_command_line_arg,
&local_copy_into_self, NULL);
*copy_into_self |= local_copy_into_self;
free (dst_name);
free (src_name);
+ /* If we're copying into self, there's no point in continuing,
+ and in fact, that would even infloop, now that we record only
+ the first created directory per command line argument. */
+ if (local_copy_into_self)
+ break;
+
+
namep += strlen (namep) + 1;
}
free (name_space);
@@ -1125,6 +1137,7 @@ restore_default_fscreatecon_or_die (void
not known. ANCESTORS points to a linked, null terminated list of
devices and inodes of parent directories of SRC_NAME. COMMAND_LINE_ARG
is true iff SRC_NAME was specified on the command line.
+ FIRST_DIR_CREATED_PER_COMMAND_LINE_ARG is both input and output.
Set *COPY_INTO_SELF if SRC_NAME is a parent of (or the
same as) DST_NAME; otherwise, clear it.
Return true if successful. */
@@ -1135,6 +1148,7 @@ copy_internal (char const *src_name, cha
struct dir_list *ancestors,
const struct cp_options *x,
bool command_line_arg,
+ bool *first_dir_created_per_command_line_arg,
bool *copy_into_self,
bool *rename_succeeded)
{
@@ -1815,11 +1829,15 @@ copy_internal (char const *src_name, cha
}
}
- /* Insert the created directory's inode and device
- numbers into the search structure, so that we can
- avoid copying it again. */
- if (!x->hard_link)
- remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);
+ /* Record the created directory's inode and device numbers into
+ the search structure, so that we can avoid copying it again.
+ Do this only for the first directory that is created for each
+ source command line argument. */
+ if (!*first_dir_created_per_command_line_arg)
+ {
+ remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);
+ *first_dir_created_per_command_line_arg = true;
+ }
if (x->verbose)
emit_verbose (src_name, dst_name, NULL);
@@ -1840,6 +1858,7 @@ copy_internal (char const *src_name, cha
in a source directory would cause the containing destination
directory not to have owner/perms set properly. */
delayed_ok = copy_dir (src_name, dst_name, new_dst, &src_sb, dir, x,
+ first_dir_created_per_command_line_arg,
copy_into_self);
}
}
@@ -2187,8 +2206,11 @@ copy (char const *src_name, char const *
top_level_src_name = src_name;
top_level_dst_name = dst_name;
+ bool first_dir_created_per_command_line_arg = false;
return copy_internal (src_name, dst_name, nonexistent_dst, 0, NULL,
- options, true, copy_into_self, rename_succeeded);
+ options, true,
+ &first_dir_created_per_command_line_arg,
+ copy_into_self, rename_succeeded);
}
/* Set *X to the default options for a value of type struct cp_options. */
diff -urNp coreutils-7.1-orig/tests/cp/into-self coreutils-7.1/tests/cp/into-self
--- coreutils-7.1-orig/tests/cp/into-self 2008-09-18 09:06:57.000000000 +0200
+++ coreutils-7.1/tests/cp/into-self 2009-02-27 12:16:21.000000000 +0100
@@ -1,7 +1,7 @@
#!/bin/sh
# Confirm that copying a directory into itself gets a proper diagnostic.
-# Copyright (C) 2001, 2002, 2004, 2006-2008 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 2006-2009 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,15 +28,32 @@ fi
. $srcdir/test-lib.sh
-mkdir dir || framework_failure
+mkdir a dir || framework_failure
fail=0
# This command should exit nonzero.
cp -R dir dir 2> out && fail=1
+echo 1 >> out
+
+# This should, too. However, with coreutils-7.1 it would infloop.
+cp -rl dir dir 2>> out && fail=1
+echo 2 >> out
+
+cp -rl a dir dir 2>> out && fail=1
+echo 3 >> out
+cp -rl a dir dir 2>> out && fail=1
+echo 4 >> out
cat > exp <<\EOF
cp: cannot copy a directory, `dir', into itself, `dir/dir'
+1
+cp: cannot copy a directory, `dir', into itself, `dir/dir'
+2
+cp: cannot copy a directory, `dir', into itself, `dir/dir'
+3
+cp: cannot copy a directory, `dir', into itself, `dir/dir'
+4
EOF
#'

View File

@ -1,102 +0,0 @@
diff -urNp coreutils-7.1-orig/src/sort.c coreutils-7.1/src/sort.c
--- coreutils-7.1-orig/src/sort.c 2009-02-25 16:15:52.000000000 +0100
+++ coreutils-7.1/src/sort.c 2009-02-25 16:20:35.000000000 +0100
@@ -1598,6 +1598,9 @@ limfield_uni (const struct line *line, c
size_t eword = key->eword, echar = key->echar;
size_t remaining_bytes;
+ if (echar == 0)
+ eword++; /* skip all of end field. */
+
/* Move PTR past EWORD fields or to one past the last byte on LINE,
whichever comes first. If there are more than EWORD fields, leave
PTR pointing at the beginning of the field having zero-based index,
@@ -1673,19 +1676,22 @@ limfield_uni (const struct line *line, c
}
#endif
- /* If we're ignoring leading blanks when computing the End
- of the field, don't start counting bytes until after skipping
- past any leading blanks. */
- if (key->skipeblanks)
- while (ptr < lim && blanks[to_uchar (*ptr)])
- ++ptr;
- /* Advance PTR by ECHAR (if possible), but no further than LIM. */
- remaining_bytes = lim - ptr;
- if (echar < remaining_bytes)
- ptr += echar;
- else
- ptr = lim;
+ if (echar != 0) /* We need to skip over a portion of the end field. */
+ {
+ if (key->skipeblanks) /* blanks not counted in echar. */
+ {
+ while (ptr < lim && blanks[to_uchar (*ptr)])
+ ++ptr;
+ }
+
+ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
+ remaining_bytes = lim - ptr;
+ if (echar < remaining_bytes)
+ ptr += echar;
+ else
+ ptr = lim;
+ }
return ptr;
}
@@ -3736,12 +3742,9 @@ main (int argc, char **argv)
badfieldspec (optarg, N_("field number is zero"));
}
if (*s == '.')
- s = parse_field_count (s + 1, &key->echar,
- N_("invalid number after `.'"));
- else
{
- /* `-k 2,3' is equivalent to `+1 -3'. */
- key->eword++;
+ s = parse_field_count (s + 1, &key->echar,
+ N_("invalid number after `.'"));
}
s = set_ordering (s, key, bl_end);
}
diff -urNp coreutils-7.1-orig/tests/misc/sort coreutils-7.1/tests/misc/sort
--- coreutils-7.1-orig/tests/misc/sort 2009-01-27 22:11:25.000000000 +0100
+++ coreutils-7.1/tests/misc/sort 2009-02-25 16:21:48.000000000 +0100
@@ -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 '-'.
@@ -110,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"}],
+["07e", '-k 2,3.0', {IN=>"a a b\nz a a\n"}, {OUT=>"z a a\na a b\n"}],
+
#
# report an error for `.' without following char spec
["08a", '-k 2.,3', {EXIT=>2},
@@ -210,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"}],
+# When ignoring leading blanks for end position, ensure blanks from
+# 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"}],

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 7.1
Release: 7%{?dist}
Version: 7.2
Release: 1%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -19,8 +19,6 @@ Source202: coreutils-su-l.pamd
Source203: coreutils-runuser-l.pamd
# From upstream
Patch1: coreutils-7.1-sort-endoffields.patch
Patch2: coreutils-7.1-cp-recursiveinfloop.patch
# Our patches
Patch100: coreutils-6.10-configuration.patch
@ -50,7 +48,6 @@ Patch916: coreutils-getfacl-exit-code.patch
#(upstream did some SELinux implementation unlike with RedHat patch)
Patch950: coreutils-selinux.patch
Patch951: coreutils-selinuxmanpages.patch
Patch952: coreutils-7.1-cp-a-xattrs.patch
BuildRequires: libselinux-devel >= 1.25.6-1
BuildRequires: libacl-devel
@ -101,8 +98,6 @@ the old GNU fileutils, sh-utils, and textutils packages.
%setup -q
# From upstream
%patch1 -p1 -b .endfield
%patch2 -p1 -b .recinfloop
# Our patches
%patch100 -p1 -b .configure
@ -128,7 +123,6 @@ the old GNU fileutils, sh-utils, and textutils packages.
#SELinux
%patch950 -p1 -b .selinux
%patch951 -p1 -b .selinuxman
%patch952 -p1 -b .xattrs
chmod a+x tests/misc/sort-mb-tests
@ -315,6 +309,10 @@ fi
/sbin/runuser
%changelog
* Tue Mar 31 2009 Ondrej Vasik <ovasik@redhat.com> 7.2-1
- New upstream bugfix release 7.2
- removed applied patches
* Thu Mar 19 2009 Ondrej Vasik <ovasik@redhat.com> 7.1-7
- do not ship /etc/DIR_COLORS.xterm - as many terminals
use TERM xterm and black background as default - making

View File

@ -1 +1 @@
cbb2b3d1718ee1237b808e00b5c11b1e coreutils-7.1.tar.gz
427c2914d3eab956f317c9ec6a45e62a coreutils-7.2.tar.gz