<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/cp, branch v7.2</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v7.2</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2009-03-27T08:28:08Z</updated>
<entry>
<title>tests: migrate setgid-check into test-lib.sh</title>
<updated>2009-03-27T08:28:08Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-03-27T08:23:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=e65d0d0525159f963b3b859706dc920bcae0a636'/>
<id>urn:sha1:e65d0d0525159f963b3b859706dc920bcae0a636</id>
<content type='text'>
* tests/test-lib.sh (skip_if_setgid_): New function.
* tests/setgid-check: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove setgid-check.
* tests/chmod/c-option: Use the new function rather than sourcing
the separate file.
* tests/cp/cp-parents: Likewise.
* tests/install/install-C: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
</content>
</entry>
<entry>
<title>cp: diagnose invalid "cp -rl dir dir" right away, once again</title>
<updated>2009-02-27T10:44:26Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-02-27T08:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b50a4ae557d6ac479e659f685c8a8ff909e09393'/>
<id>urn:sha1:b50a4ae557d6ac479e659f685c8a8ff909e09393</id>
<content type='text'>
Running "mkdir dir; cp -rl dir dir" would create dir/dir/dir/...
rather than diagnosing the "copy-into-self" failure.

The easy fix would have been to revert this part of the change
[3ece0355 2008-11-09 cp: use far less memory in some cases]
that introduced the bug:

-         remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);
+         if (!x-&gt;hard_link)
+           remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);

However, that would have induced the failure of the new cp/link-heap
test, due to the added memory pressure of recording 10k dev/ino pairs.
And besides, I liked that improvement and wanted to keep it.

Now that it's obvious recording the just-created-directory dev/ino
needn't depend on the setting of hard_link, I realized it is necessary
to record the pair only for the first directory created for each
source command-line argument.

I made that change, then noticed the new test, cp -rl a d d, would pass
when run once, yet output the into-self diagnostic twice.  Also note
the side effect: it creates d/a and d/d.  However, running that same
command a second time, now with the modified directory, would fail.

That turned out to be due to the fact that although the first into-self
failure was detected in copy_dir, that function would continue copying
other entries regardless -- and that would make it fail (eventually)
with the unwanted recursion.

* src/copy.c (copy_internal): This function needed an indicator of
whether, for a give command line argument, it had already created its
first directory.  If so, no more need to record dev/ino pairs.  If this
is the first, then do record its pair.  Hence, the new parameter.
(copy_dir, copy): Update callers.
(copy_dir): Upon any into-self failure, break out of the loop.
* tests/cp/into-self: Test for the above.
Reported by Mikael Magnusson.
</content>
</entry>
<entry>
<title>cp: -a now preserves SELinux context, with reduced diagnostics</title>
<updated>2009-02-18T14:27:10Z</updated>
<author>
<name>Ondřej Vašík</name>
<email>ovasik@redhat.com</email>
</author>
<published>2009-02-17T14:53:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=8c243ff965d477a89582a1b329923516a4d64668'/>
<id>urn:sha1:8c243ff965d477a89582a1b329923516a4d64668</id>
<content type='text'>
* copy.c (copy_reg): Reduce SELinux context diagnostics for 'cp -a'.
(copy_internal): Likewise
* copy.h (cp_options): Add boolean reduce_diagnostics.
* cp.c (usage): Say that --archive (-a) behaves like -dR --preserve=all.
(cp_option_init): Initialize added reduce_diagnostics.
(main): Add reduce_diagnostics for the -a option, and preserve SELinux
context, if possible.
* mv.c (cp_options_init): Initialize new cp_options booleans.
* install.c (cp_option_init): Likewise.
* NEWS: Mention those behaviour changes.
* doc/coreutils.texi: Document --preserve=context, document that
diagnostics are not shown for failures of non-mandatory attributes
(just SELinux at the moment).
* tests/cp/cp-a-selinux: Check not only failures, but succesful use
of preserving SELinux context in cp.
</content>
</entry>
<entry>
<title>add missing copyright dates</title>
<updated>2009-02-18T13:07:30Z</updated>
<author>
<name>Eric Blake</name>
<email>ebb9@byu.net</email>
</author>
<published>2009-02-18T13:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=86cef85b3671ed0a14a444eef3b6cb07fa26ee64'/>
<id>urn:sha1:86cef85b3671ed0a14a444eef3b6cb07fa26ee64</id>
<content type='text'>
* NEWS: Add 2009 to copyright.
* README: Likewise.
* README-hacking: Likewise.
* TODO: Likewise.
* doc/Makefile.am: Likewise.
* m4/prereq.m4: Likewise.
* src/nl.c: Likewise.
* src/seq.c: Likewise.
* tests/cp/cp-i: Likewise.
* tests/install/install-C: Likewise.
* tests/install/install-C-root: Likewise.
* tests/install/install-C-selinux: Likewise.
* tests/misc/seq: Likewise.
* tests/mv/mv-n: Likewise.
</content>
</entry>
<entry>
<title>cp/mv: add --no-clobber (-n) option to not overwrite target</title>
<updated>2009-01-14T08:09:22Z</updated>
<author>
<name>Kamil Dudka</name>
<email>kdudka@redhat.com</email>
</author>
<published>2009-01-13T17:35:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=d01338eb3d30e5634f1b4d4179c229f54eea0b44'/>
<id>urn:sha1:d01338eb3d30e5634f1b4d4179c229f54eea0b44</id>
<content type='text'>
* src/cp.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* src/mv.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* doc/coreutils.texi: Document new cp/mv option -n.
* tests/cp/cp-i: Add tests for -f, -i and -n options.
* tests/mv/mv-n: New test for mv -n.
* tests/Makefile.am: Add test mv/mv-n to the list.
* NEWS: Mention the change.
</content>
</entry>
<entry>
<title>tests: avoid failure of cp/link-heap on some systems</title>
<updated>2008-11-30T18:15:51Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-11-24T09:03:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b5b3690d069b0bd4a1d561a8c1b527768d067b5d'/>
<id>urn:sha1:b5b3690d069b0bd4a1d561a8c1b527768d067b5d</id>
<content type='text'>
* tests/cp/link-heap: Raise virtual memory limit from 10,000
to 14,000, to avoid failure on Debian/unstable (libc6 2.7-16).
</content>
</entry>
<entry>
<title>cp: use far less memory in some cases</title>
<updated>2008-11-20T09:21:52Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-11-19T18:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3ece0355d52e41a1b079c0c46477a32250278c11'/>
<id>urn:sha1:3ece0355d52e41a1b079c0c46477a32250278c11</id>
<content type='text'>
cp --link was "remembering" many name,dev,inode triples unnecessarily.
cp was doing the same, even without --link, for every directory in the
source hierarchy, while it can do its job with entries merely for the
command-line arguments.  Prompted by a report from Patrick Shoenfeld.
Details &lt;http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/15081&gt;.
* src/copy.c (copy_internal): Refrain from remembering
name,dev,inode for most files, when invoked via cp --link.
Record an infloop-avoidance triple for each directory specified
on the command line, not for each directory in the source tree.
Don't record a dir-triple when x-&gt;hard_link is set.
* NEWS (Buf fixes): Mention it.
* tests/cp/link-heap: New file.  Test for cp's lowered memory usage.
* tests/Makefile.am (TESTS): Add link-heap.
</content>
</entry>
<entry>
<title>tests: add a test of cp --preserve=links</title>
<updated>2008-11-20T09:21:52Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-11-19T18:16:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1760ade090cbf8c854c1033399d51ff4fdde3ae0'/>
<id>urn:sha1:1760ade090cbf8c854c1033399d51ff4fdde3ae0</id>
<content type='text'>
* tests/cp/link-preserve: Add a case and comments.
</content>
</entry>
<entry>
<title>fix minor shell issues in test suite</title>
<updated>2008-09-10T11:20:27Z</updated>
<author>
<name>Ralf Wildenhues</name>
<email>Ralf.Wildenhues@gmx.de</email>
</author>
<published>2008-09-09T17:45:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9dcebc51be915fb6d0ab2eca36168f3ab12a45c7'/>
<id>urn:sha1:9dcebc51be915fb6d0ab2eca36168f3ab12a45c7</id>
<content type='text'>
* tests/misc/help-version: Fix bad quoting.
* tests/cp/same-file: Fix unportable shell quoting.
* tests/mv/part-symlink: Likewise.
</content>
</entry>
<entry>
<title>tests: use "Exit $fail", not (exit $fail); exit $fail</title>
<updated>2008-09-10T11:20:10Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-09-07T08:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=68561594ca022703e255b3ef5686f176317e5fd4'/>
<id>urn:sha1:68561594ca022703e255b3ef5686f176317e5fd4</id>
<content type='text'>
* tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63
* tests/**: Convert all uses:

This restrictive change converted the vast majority:

  git grep -l '^(exit \$fail); exit \$fail$' \
    | xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/'

And this did the rest, plus a few undesirable ones, so I manually
backed out the changes to ChangeLog-* and build-aux/check.mk:

  git grep -l -E '\(exit [^)]+\); exit ' \
    | xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/'
</content>
</entry>
</feed>
