rpms/coreutils/F-7 coreutils-6.9-cp-i-u.patch, NONE, 1.1 coreutils-5.2.1-runuser.patch, 1.15, 1.16 coreutils.spec, 1.173, 1.174
Ondrej Vasik (ovasik)
fedora-extras-commits at redhat.com
Thu Oct 25 11:21:13 UTC 2007
Author: ovasik
Update of /cvs/extras/rpms/coreutils/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31262
Modified Files:
coreutils-5.2.1-runuser.patch coreutils.spec
Added Files:
coreutils-6.9-cp-i-u.patch
Log Message:
upstream patch - fixing cp -iu options(#248591) + runuser patch backport from F8(#241662)
coreutils-6.9-cp-i-u.patch:
--- NEW FILE coreutils-6.9-cp-i-u.patch ---
When "cp -i --update old new" would do nothing because "new" is
newer than "old", cp would nonetheless prompt for whether it is
ok to overwrite "new". Then, regardless of the response (because
of the --update option), cp would do nothing.
The following patch eliminates the unnecessary prompt in that case.
diff --git a/src/copy.c b/src/copy.c
index b7bf73b..0e549d2 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -1210,6 +1210,30 @@ copy_internal (char const *src_name, char const *dst_name,
return false;
}
+ if (!S_ISDIR (src_mode) && x->update)
+ {
+ /* When preserving time stamps (but not moving within a file
+ system), don't worry if the destination time stamp is
+ less than the source merely because of time stamp
+ truncation. */
+ int options = ((x->preserve_timestamps
+ && ! (x->move_mode
+ && dst_sb.st_dev == src_sb.st_dev))
+ ? UTIMECMP_TRUNCATE_SOURCE
+ : 0);
+
+ if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
+ {
+ /* We're using --update and the destination is not older
+ than the source, so do not copy or move. Pretend the
+ rename succeeded, so the caller (if it's mv) doesn't
+ end up removing the source file. */
+ if (rename_succeeded)
+ *rename_succeeded = true;
+ return true;
+ }
+ }
+
/* When there is an existing destination file, we may end up
returning early, and hence not copying/moving the file.
This may be due to an interactive `negative' reply to the
@@ -1302,30 +1326,6 @@ copy_internal (char const *src_name, char const *dst_name,
return false;
}
}
-
- if (x->update)
- {
- /* When preserving time stamps (but not moving within a file
- system), don't worry if the destination time stamp is
- less than the source merely because of time stamp
- truncation. */
- int options = ((x->preserve_timestamps
- && ! (x->move_mode
- && dst_sb.st_dev == src_sb.st_dev))
- ? UTIMECMP_TRUNCATE_SOURCE
- : 0);
-
- if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
- {
- /* We're using --update and the destination is not older
- than the source, so do not copy or move. Pretend the
- rename succeeded, so the caller (if it's mv) doesn't
- end up removing the source file. */
- if (rename_succeeded)
- *rename_succeeded = true;
- return true;
- }
- }
}
if (x->move_mode)
diff --git a/tests/mv/update b/tests/mv/update
index 0c06024..6c3d149 100755
--- a/tests/mv/update
+++ b/tests/mv/update
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure --update works as advertised
-# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004, 2006-2007 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
@@ -46,11 +46,16 @@ fi
fail=0
-for cp_or_mv in cp mv; do
- # This is a no-op.
- $cp_or_mv --update old new || fail=1
- case "`cat new`" in new) ;; *) fail=1 ;; esac
- case "`cat old`" in old) ;; *) fail=1 ;; esac
+for interactive in '' -i; do
+ for cp_or_mv in cp mv; do
+ # This is a no-op, with no prompt.
+ # With coreutils-6.9 and earlier, using --update with -i would
+ # mistakenly elicit a prompt.
+ $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1
+ test -s out && fail=1
+ case "`cat new`" in new) ;; *) fail=1 ;; esac
+ case "`cat old`" in old) ;; *) fail=1 ;; esac
+ done
done
# This will actually perform the rename.
--
1.5.3.rc1.16.g9d6f
coreutils-5.2.1-runuser.patch:
Index: coreutils-5.2.1-runuser.patch
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-7/coreutils-5.2.1-runuser.patch,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- coreutils-5.2.1-runuser.patch 9 Jan 2007 19:29:30 -0000 1.15
+++ coreutils-5.2.1-runuser.patch 25 Oct 2007 11:21:09 -0000 1.16
@@ -304,14 +304,6 @@
shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
-@@ -105,6 +105,7 @@
- readlink.1: $(common_dep) $(srcdir)/readlink.x ../src/readlink.c
- rm.1: $(common_dep) $(srcdir)/rm.x ../src/rm.c
- rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c
-+runuser.1: $(common_dep) $(srcdir)/runuser.x ../src/su.c
- seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
- sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
- sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c
--- /dev/null 2007-01-09 09:38:07.860075128 +0000
+++ coreutils-6.7/man/runuser.x 2007-01-09 17:27:56.000000000 +0000
@@ -0,0 +1,4 @@
Index: coreutils.spec
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-7/coreutils.spec,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -r1.173 -r1.174
--- coreutils.spec 13 Jun 2007 14:01:02 -0000 1.173
+++ coreutils.spec 25 Oct 2007 11:21:09 -0000 1.174
@@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 6.9
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPL
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -19,6 +19,7 @@
# From upstream
Patch1: coreutils-futimens.patch
Patch2: coreutils-ls-x.patch
+Patch3: coreutils-6.9-cp-i-u.patch
# Our patches
Patch100: coreutils-chgrp.patch
@@ -85,6 +86,7 @@
# From upstream
%patch1 -p1 -b .futimens
%patch2 -p1 -b .ls-x
+%patch3 -p1 -b .cp-i-u
# Our patches
%patch100 -p1 -b .chgrp
@@ -271,6 +273,11 @@
/sbin/runuser
%changelog
+* Thu Oct 25 2007 Ondrej Vasik <ovasik at redhat.com> 6.9-4
+- applied upstream patch for cp and mv(bug #248591)
+- Don't generate runuser.1 since we ship a complete manpage for it
+ (bug #241662).
+
* Wed Jun 13 2007 Tim Waugh <twaugh at redhat.com> 6.9-3
- Fixed 'ls -x' output (bug #240298).
- Disambiguate futimens() from the glibc implementation (bug #242321).
More information about the fedora-extras-commits
mailing list