New upstream release (+ amending/droping patches)
This commit is contained in:
parent
e464e338f2
commit
e18e41532f
@ -25,8 +25,8 @@ diff -urNp coreutils-6.12-orig/src/chcon.c coreutils-6.12/src/chcon.c
|
|||||||
- V_off
|
- V_off
|
||||||
-};
|
-};
|
||||||
|
|
||||||
/* The name the program was run with. */
|
/* If nonzero, and the systems has support for it, change the context
|
||||||
char *program_name;
|
of symbolic links rather than any files they point to. */
|
||||||
@@ -374,7 +355,6 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\
|
@@ -374,7 +355,6 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\
|
||||||
Change the SELinux security context of each FILE to CONTEXT.\n\
|
Change the SELinux security context of each FILE to CONTEXT.\n\
|
||||||
With --reference, change the security context of each FILE to that of RFILE.\n\
|
With --reference, change the security context of each FILE to that of RFILE.\n\
|
||||||
|
@ -3,7 +3,7 @@ diff -urNp coreutils-6.12-orig/AUTHORS coreutils-6.12/AUTHORS
|
|||||||
+++ coreutils-6.12/AUTHORS 2008-10-21 15:00:05.000000000 +0200
|
+++ coreutils-6.12/AUTHORS 2008-10-21 15:00:05.000000000 +0200
|
||||||
@@ -63,6 +63,7 @@ pwd: Jim Meyering
|
@@ -63,6 +63,7 @@ pwd: Jim Meyering
|
||||||
readlink: Dmitry V. Levin
|
readlink: Dmitry V. Levin
|
||||||
rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
|
rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
|
||||||
rmdir: David MacKenzie
|
rmdir: David MacKenzie
|
||||||
+runuser: David MacKenzie, Dan Walsh
|
+runuser: David MacKenzie, Dan Walsh
|
||||||
runcon: Russell Coker
|
runcon: Russell Coker
|
||||||
@ -23,17 +23,21 @@ diff -urNp coreutils-6.12-orig/man/Makefile.am coreutils-6.12/man/Makefile.am
|
|||||||
diff -urNp coreutils-6.12-orig/README coreutils-6.12/README
|
diff -urNp coreutils-6.12-orig/README coreutils-6.12/README
|
||||||
--- coreutils-6.12-orig/README 2008-05-15 20:44:37.000000000 +0200
|
--- coreutils-6.12-orig/README 2008-05-15 20:44:37.000000000 +0200
|
||||||
+++ coreutils-6.12/README 2008-10-21 14:59:29.000000000 +0200
|
+++ coreutils-6.12/README 2008-10-21 14:59:29.000000000 +0200
|
||||||
@@ -12,8 +12,8 @@ The programs that can be built with this
|
@@ -12,10 +12,10 @@ The programs that can be built with this
|
||||||
factor false fmt fold groups head hostid hostname id install join kill
|
factor false fmt fold groups head hostid hostname id install join kill
|
||||||
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
|
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
|
||||||
od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
|
od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
|
||||||
- runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
|
- runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
|
||||||
- sleep sort split stat stty su sum sync tac tail tee test touch tr true
|
- sleep sort split stat stty su sum sync tac tail tee test timeout touch tr
|
||||||
|
- true truncate tsort tty uname unexpand uniq unlink uptime users vdir wc who
|
||||||
|
- whoami yes
|
||||||
+ runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
|
+ runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
|
||||||
+ shuf sleep sort split stat stty su sum sync tac tail tee test touch tr true
|
+ shuf sleep sort split stat stty su sum sync tac tail tee test timeout touch
|
||||||
tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes
|
+ tr true truncate tsort tty uname unexpand uniq unlink uptime users vdir wc
|
||||||
|
+ who whoami yes
|
||||||
|
|
||||||
See the file NEWS for a list of major changes in the current release.
|
See the file NEWS for a list of major changes in the current release.
|
||||||
|
|
||||||
diff -urNp coreutils-6.12-orig/src/Makefile.am coreutils-6.12/src/Makefile.am
|
diff -urNp coreutils-6.12-orig/src/Makefile.am coreutils-6.12/src/Makefile.am
|
||||||
--- coreutils-6.12-orig/src/Makefile.am 2008-10-21 14:58:31.000000000 +0200
|
--- coreutils-6.12-orig/src/Makefile.am 2008-10-21 14:58:31.000000000 +0200
|
||||||
+++ coreutils-6.12/src/Makefile.am 2008-10-21 14:59:58.000000000 +0200
|
+++ coreutils-6.12/src/Makefile.am 2008-10-21 14:59:58.000000000 +0200
|
||||||
@ -43,7 +47,7 @@ diff -urNp coreutils-6.12-orig/src/Makefile.am coreutils-6.12/src/Makefile.am
|
|||||||
id kill logname pathchk printenv printf pwd \
|
id kill logname pathchk printenv printf pwd \
|
||||||
- runcon seq sleep tee \
|
- runcon seq sleep tee \
|
||||||
+ runcon runuser seq sleep tee \
|
+ runcon runuser seq sleep tee \
|
||||||
test true tty whoami yes \
|
test timeout true truncate tty whoami yes \
|
||||||
base64
|
base64
|
||||||
|
|
||||||
@@ -142,6 +142,10 @@ cp_LDADD += $(LIB_ACL)
|
@@ -142,6 +142,10 @@ cp_LDADD += $(LIB_ACL)
|
||||||
@ -251,7 +255,7 @@ diff -urNp coreutils-6.12-orig/src/su.c coreutils-6.12/src/su.c
|
|||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
initialize_main (&argc, &argv);
|
initialize_main (&argc, &argv);
|
||||||
program_name = argv[0];
|
set_program_name (argv[0]);
|
||||||
@@ -670,7 +742,11 @@ main (int argc, char **argv)
|
@@ -670,7 +742,11 @@ main (int argc, char **argv)
|
||||||
simulate_login = false;
|
simulate_login = false;
|
||||||
change_environment = true;
|
change_environment = true;
|
||||||
@ -343,9 +347,9 @@ diff -urNp coreutils-6.12-orig/tests/misc/help-version coreutils-6.12/tests/misc
|
|||||||
sleep_args=0
|
sleep_args=0
|
||||||
su_args=--version
|
su_args=--version
|
||||||
+runuser_args=--version
|
+runuser_args=--version
|
||||||
|
timeout_args=--version
|
||||||
|
|
||||||
# I'd rather not run sync, since it spins up disks that I've
|
# I'd rather not run sync, since it spins up disks that I've
|
||||||
# deliberately caused to spin down (but not unmounted).
|
|
||||||
--- /dev/null 2007-01-09 09:38:07.860075128 +0000
|
--- /dev/null 2007-01-09 09:38:07.860075128 +0000
|
||||||
+++ coreutils-6.7/man/runuser.x 2007-01-09 17:27:56.000000000 +0000
|
+++ coreutils-6.7/man/runuser.x 2007-01-09 17:27:56.000000000 +0000
|
||||||
@@ -0,0 +1,12 @@
|
@@ -0,0 +1,12 @@
|
||||||
|
@ -10,20 +10,10 @@ diff -urNp coreutils-6.12-orig/src/md5sum.c coreutils-6.12/src/md5sum.c
|
|||||||
+"), stdout);
|
+"), stdout);
|
||||||
fputs (_("\
|
fputs (_("\
|
||||||
\n\
|
\n\
|
||||||
The following two options are useful only when verifying checksums:\n\
|
The following three options are useful only when verifying checksums:\n\
|
||||||
diff -urNp coreutils-6.12-orig/src/sort.c coreutils-6.12/src/sort.c
|
diff -urNp coreutils-6.12-orig/src/sort.c coreutils-6.12/src/sort.c
|
||||||
--- coreutils-6.12-orig/src/sort.c 2008-10-21 16:04:50.000000000 +0200
|
--- coreutils-6.12-orig/src/sort.c 2008-10-21 16:04:50.000000000 +0200
|
||||||
+++ coreutils-6.12/src/sort.c 2008-10-22 10:52:30.000000000 +0200
|
+++ coreutils-6.12/src/sort.c 2008-10-22 10:52:30.000000000 +0200
|
||||||
@@ -375,7 +375,8 @@ Other options:\n\
|
|
||||||
-C, --check=quiet, --check=silent like -c, but do not report first bad line\n\
|
|
||||||
--compress-program=PROG compress temporaries with PROG;\n\
|
|
||||||
decompress them with PROG -d\n\
|
|
||||||
- -k, --key=POS1[,POS2] start a key at POS1, end it at POS2 (origin 1)\n\
|
|
||||||
+ -k, --key=POS1[,POS2] start a key at POS1, end it at POS2 (origin 1) -\n\
|
|
||||||
+ when no POS2 specified, end of line is used\n\
|
|
||||||
-m, --merge merge already sorted files; do not sort\n\
|
|
||||||
"), stdout);
|
|
||||||
fputs (_("\
|
|
||||||
@@ -412,7 +413,7 @@ With no FILE, or when FILE is -, read st
|
@@ -412,7 +413,7 @@ With no FILE, or when FILE is -, read st
|
||||||
\n\
|
\n\
|
||||||
*** WARNING ***\n\
|
*** WARNING ***\n\
|
||||||
|
@ -4,7 +4,7 @@ diff -up coreutils-6.11/src/Makefile.am.sparc coreutils-6.11/src/Makefile.am
|
|||||||
@@ -101,6 +101,7 @@ shred_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
@@ -101,6 +101,7 @@ shred_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
||||||
shuf_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
shuf_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
||||||
tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
||||||
vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX)
|
vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP)
|
||||||
+tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
+tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
||||||
|
|
||||||
## If necessary, add -lm to resolve use of pow in lib/strtod.c.
|
## If necessary, add -lm to resolve use of pow in lib/strtod.c.
|
||||||
@ -13,8 +13,8 @@ diff -up coreutils-6.11/src/Makefile.in.sparc coreutils-6.11/src/Makefile.in
|
|||||||
--- coreutils-6.11/src/Makefile.in.sparc 2008-04-19 16:50:10.000000000 -0500
|
--- coreutils-6.11/src/Makefile.in.sparc 2008-04-19 16:50:10.000000000 -0500
|
||||||
+++ coreutils-6.11/src/Makefile.in 2008-05-29 18:40:36.000000000 -0500
|
+++ coreutils-6.11/src/Makefile.in 2008-05-29 18:40:36.000000000 -0500
|
||||||
@@ -1251,6 +1251,7 @@ shuf_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
@@ -1251,6 +1251,7 @@ shuf_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
||||||
tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP) \
|
||||||
vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_ACL)
|
$(LIB_ACL)
|
||||||
sort_LDADD = $(LDADD) $(POW_LIB) $(LIB_GETHRXTIME)
|
sort_LDADD = $(LDADD) $(POW_LIB) $(LIB_GETHRXTIME)
|
||||||
+tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
+tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
||||||
|
|
||||||
|
@ -1,90 +0,0 @@
|
|||||||
diff -Naurp coreutils-6.12.orig/tests/cp/cp-a-selinux coreutils-6.12/tests/cp/cp-a-selinux
|
|
||||||
--- coreutils-6.12.orig/tests/cp/cp-a-selinux 2008-05-27 07:39:18.000000000 -0400
|
|
||||||
+++ coreutils-6.12/tests/cp/cp-a-selinux 2008-10-06 16:16:38.000000000 -0400
|
|
||||||
@@ -33,7 +33,8 @@ cleanup_() { cd /; umount "$cwd/mnt"; }
|
|
||||||
dd if=/dev/zero of=blob bs=8192 count=200 > /dev/null 2>&1 \
|
|
||||||
|| framework_failure
|
|
||||||
mkdir mnt || framework_failure
|
|
||||||
-mkfs -t ext2 -F blob || framework_failure
|
|
||||||
+mkfs -t ext2 -F blob ||
|
|
||||||
+ skip_test_ "failed to create an ext2 file system"
|
|
||||||
|
|
||||||
# This context is special: it works even when mcstransd isn't running.
|
|
||||||
ctx=root:object_r:tmp_t:s0
|
|
||||||
diff -Naurp coreutils-6.12.orig/tests/cp/preserve-gid coreutils-6.12/tests/cp/preserve-gid
|
|
||||||
--- coreutils-6.12.orig/tests/cp/preserve-gid 2008-05-27 07:39:18.000000000 -0400
|
|
||||||
+++ coreutils-6.12/tests/cp/preserve-gid 2008-10-06 16:16:41.000000000 -0400
|
|
||||||
@@ -19,6 +19,10 @@
|
|
||||||
. $srcdir/test-lib.sh
|
|
||||||
require_root_
|
|
||||||
|
|
||||||
+# Record primary group number, usually 0.
|
|
||||||
+# This is the group ID used when cp (without -p) creates a new file.
|
|
||||||
+primary_group_num=$(id -g)
|
|
||||||
+
|
|
||||||
create() {
|
|
||||||
echo "$1" > "$1" || exit 1
|
|
||||||
chown "+$2:+$3" "$1" || exit 1
|
|
||||||
@@ -34,7 +38,7 @@ t0() {
|
|
||||||
if test "x$s" != "x$u $g"; then
|
|
||||||
# Allow the actual group to match that of the parent directory
|
|
||||||
# (it was set to 0 above).
|
|
||||||
- if test "x$s" = "x$u 0"; then
|
|
||||||
+ if test "x$s" = "x$u $primary_group_num"; then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
echo "$0: $* $f b: $u $g != $s" 1>&2
|
|
||||||
diff -Naurp coreutils-6.12.orig/tests/misc/runcon-no-reorder coreutils-6.12/tests/misc/runcon-no-reorder
|
|
||||||
--- coreutils-6.12.orig/tests/misc/runcon-no-reorder 2008-05-27 07:39:18.000000000 -0400
|
|
||||||
+++ coreutils-6.12/tests/misc/runcon-no-reorder 2008-10-06 16:16:41.000000000 -0400
|
|
||||||
@@ -23,9 +23,8 @@ fi
|
|
||||||
|
|
||||||
. $srcdir/test-lib.sh
|
|
||||||
|
|
||||||
-cat <<\EOF > exp || framework_failure
|
|
||||||
-runcon: runcon may be used only on a SELinux kernel
|
|
||||||
-EOF
|
|
||||||
+diag='runcon: runcon may be used only on a SELinux kernel'
|
|
||||||
+echo "$diag" > exp || framework_failure
|
|
||||||
|
|
||||||
fail=0
|
|
||||||
|
|
||||||
@@ -35,6 +34,14 @@ fail=0
|
|
||||||
# about -j being an invalid option.
|
|
||||||
runcon $(id -Z) true -j 2> out && : > exp
|
|
||||||
|
|
||||||
+# When run on a system with no /selinux/context (i.e., in a chroot),
|
|
||||||
+# it chcon fails with this: "runcon: invalid context: \
|
|
||||||
+# root:system_r:unconfined_t:s0-s0:c0.c1023: No such file or directory"
|
|
||||||
+# That diagnostic is ok, too, so map it to the more common one.
|
|
||||||
+case `cat out` in
|
|
||||||
+ 'runcon: invalid context: '*) echo "$diag" > out;;
|
|
||||||
+esac
|
|
||||||
+
|
|
||||||
compare out exp || fail=1
|
|
||||||
|
|
||||||
(exit $fail); exit $fail
|
|
||||||
diff -Naurp coreutils-6.12.orig/tests/rm/fail-2eperm coreutils-6.12/tests/rm/fail-2eperm
|
|
||||||
--- coreutils-6.12.orig/tests/rm/fail-2eperm 2008-05-27 07:39:18.000000000 -0400
|
|
||||||
+++ coreutils-6.12/tests/rm/fail-2eperm 2008-10-06 16:16:38.000000000 -0400
|
|
||||||
@@ -39,8 +39,7 @@ fail=0
|
|
||||||
rm_version=`setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version|sed -n '1s/.* //p'`
|
|
||||||
case $rm_version in
|
|
||||||
$PACKAGE_VERSION) ;;
|
|
||||||
- *) echo "$0: cannot access just-built rm as user $NON_ROOT_USERNAME" 1>&2
|
|
||||||
- fail=1 ;;
|
|
||||||
+ *) skip_test_ "cannot access just-built rm as user $NON_ROOT_USERNAME";;
|
|
||||||
esac
|
|
||||||
setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm -rf a 2> out-t && fail=1
|
|
||||||
|
|
||||||
diff -Naurp coreutils-6.12.orig/THANKS coreutils-6.12/THANKS
|
|
||||||
--- coreutils-6.12.orig/THANKS 2008-05-06 05:28:24.000000000 -0400
|
|
||||||
+++ coreutils-6.12/THANKS 2008-10-06 16:16:38.000000000 -0400
|
|
||||||
@@ -237,6 +237,7 @@ Jan Moringen jan.
|
|
||||||
Jan Nieuwenhuizen janneke@gnu.org
|
|
||||||
Janos Farkas chexum@shadow.banki.hu
|
|
||||||
Jarkko Hietaniemi jhi@epsilon.hut.fi
|
|
||||||
+Jarod Wilson jwilson@redhat.com
|
|
||||||
Jean Charles Delepine delepine@u-picardie.fr
|
|
||||||
Jeff Moore jbm@mordor.com
|
|
||||||
Jeff Sheinberg jeff@bsrd.net
|
|
@ -1,381 +0,0 @@
|
|||||||
diff -urNp coreutils-6.12-orig/lib/getdate.y coreutils-6.12/lib/getdate.y
|
|
||||||
--- coreutils-6.12-orig/lib/getdate.y 2008-01-31 19:37:19.000000000 +0100
|
|
||||||
+++ coreutils-6.12/lib/getdate.y 2008-10-08 15:49:35.000000000 +0200
|
|
||||||
@@ -1,8 +1,8 @@
|
|
||||||
%{
|
|
||||||
/* Parse a string into an internal time stamp.
|
|
||||||
|
|
||||||
- Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
|
||||||
- Foundation, Inc.
|
|
||||||
+ Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
|
||||||
+ 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
|
|
||||||
@@ -60,7 +60,7 @@
|
|
||||||
# undef static
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-#include <ctype.h>
|
|
||||||
+#include <c-ctype.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
@@ -205,7 +205,7 @@ typedef struct
|
|
||||||
union YYSTYPE;
|
|
||||||
static int yylex (union YYSTYPE *, parser_control *);
|
|
||||||
static int yyerror (parser_control const *, char const *);
|
|
||||||
-static long int time_zone_hhmm (textint, long int);
|
|
||||||
+static long int time_zone_hhmm (parser_control *, textint, long int);
|
|
||||||
|
|
||||||
/* Extract into *PC any date and time info from a string of digits
|
|
||||||
of the form e.g., YYYYMMDD, YYMMDD, HHMM, HH (and sometimes YYY,
|
|
||||||
@@ -246,6 +246,31 @@ digits_to_date_time (parser_control *pc,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+/* Increment PC->rel by FACTOR * REL (FACTOR is 1 or -1). */
|
|
||||||
+static void
|
|
||||||
+apply_relative_time (parser_control *pc, relative_time rel, int factor)
|
|
||||||
+{
|
|
||||||
+ pc->rel.ns += factor * rel.ns;
|
|
||||||
+ pc->rel.seconds += factor * rel.seconds;
|
|
||||||
+ pc->rel.minutes += factor * rel.minutes;
|
|
||||||
+ pc->rel.hour += factor * rel.hour;
|
|
||||||
+ pc->rel.day += factor * rel.day;
|
|
||||||
+ pc->rel.month += factor * rel.month;
|
|
||||||
+ pc->rel.year += factor * rel.year;
|
|
||||||
+ pc->rels_seen = true;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/* Set PC-> hour, minutes, seconds and nanoseconds members from arguments. */
|
|
||||||
+static void
|
|
||||||
+set_hhmmss (parser_control *pc, long int hour, long int minutes,
|
|
||||||
+ time_t sec, long int nsec)
|
|
||||||
+{
|
|
||||||
+ pc->hour = hour;
|
|
||||||
+ pc->minutes = minutes;
|
|
||||||
+ pc->seconds.tv_sec = sec;
|
|
||||||
+ pc->seconds.tv_nsec = nsec;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
%}
|
|
||||||
|
|
||||||
/* We want a reentrant parser, even if the TZ manipulation and the calls to
|
|
||||||
@@ -268,7 +293,7 @@ digits_to_date_time (parser_control *pc,
|
|
||||||
%token tAGO tDST
|
|
||||||
|
|
||||||
%token tYEAR_UNIT tMONTH_UNIT tHOUR_UNIT tMINUTE_UNIT tSEC_UNIT
|
|
||||||
-%token <intval> tDAY_UNIT
|
|
||||||
+%token <intval> tDAY_UNIT tDAY_SHIFT
|
|
||||||
|
|
||||||
%token <intval> tDAY tDAYZONE tLOCAL_ZONE tMERIDIAN
|
|
||||||
%token <intval> tMONTH tORDINAL tZONE
|
|
||||||
@@ -279,7 +304,7 @@ digits_to_date_time (parser_control *pc,
|
|
||||||
%type <intval> o_colon_minutes o_merid
|
|
||||||
%type <timespec> seconds signed_seconds unsigned_seconds
|
|
||||||
|
|
||||||
-%type <rel> relunit relunit_snumber
|
|
||||||
+%type <rel> relunit relunit_snumber dayshift
|
|
||||||
|
|
||||||
%%
|
|
||||||
|
|
||||||
@@ -313,7 +338,6 @@ item:
|
|
||||||
| day
|
|
||||||
{ pc->days_seen++; }
|
|
||||||
| rel
|
|
||||||
- { pc->rels_seen = true; }
|
|
||||||
| number
|
|
||||||
| hybrid
|
|
||||||
;
|
|
||||||
@@ -321,45 +345,32 @@ item:
|
|
||||||
time:
|
|
||||||
tUNUMBER tMERIDIAN
|
|
||||||
{
|
|
||||||
- pc->hour = $1.value;
|
|
||||||
- pc->minutes = 0;
|
|
||||||
- pc->seconds.tv_sec = 0;
|
|
||||||
- pc->seconds.tv_nsec = 0;
|
|
||||||
+ set_hhmmss (pc, $1.value, 0, 0, 0);
|
|
||||||
pc->meridian = $2;
|
|
||||||
}
|
|
||||||
| tUNUMBER ':' tUNUMBER o_merid
|
|
||||||
{
|
|
||||||
- pc->hour = $1.value;
|
|
||||||
- pc->minutes = $3.value;
|
|
||||||
- pc->seconds.tv_sec = 0;
|
|
||||||
- pc->seconds.tv_nsec = 0;
|
|
||||||
+ set_hhmmss (pc, $1.value, $3.value, 0, 0);
|
|
||||||
pc->meridian = $4;
|
|
||||||
}
|
|
||||||
| tUNUMBER ':' tUNUMBER tSNUMBER o_colon_minutes
|
|
||||||
{
|
|
||||||
- pc->hour = $1.value;
|
|
||||||
- pc->minutes = $3.value;
|
|
||||||
- pc->seconds.tv_sec = 0;
|
|
||||||
- pc->seconds.tv_nsec = 0;
|
|
||||||
+ set_hhmmss (pc, $1.value, $3.value, 0, 0);
|
|
||||||
pc->meridian = MER24;
|
|
||||||
pc->zones_seen++;
|
|
||||||
- pc->time_zone = time_zone_hhmm ($4, $5);
|
|
||||||
+ pc->time_zone = time_zone_hhmm (pc, $4, $5);
|
|
||||||
}
|
|
||||||
| tUNUMBER ':' tUNUMBER ':' unsigned_seconds o_merid
|
|
||||||
{
|
|
||||||
- pc->hour = $1.value;
|
|
||||||
- pc->minutes = $3.value;
|
|
||||||
- pc->seconds = $5;
|
|
||||||
+ set_hhmmss (pc, $1.value, $3.value, $5.tv_sec, $5.tv_nsec);
|
|
||||||
pc->meridian = $6;
|
|
||||||
}
|
|
||||||
| tUNUMBER ':' tUNUMBER ':' unsigned_seconds tSNUMBER o_colon_minutes
|
|
||||||
{
|
|
||||||
- pc->hour = $1.value;
|
|
||||||
- pc->minutes = $3.value;
|
|
||||||
- pc->seconds = $5;
|
|
||||||
+ set_hhmmss (pc, $1.value, $3.value, $5.tv_sec, $5.tv_nsec);
|
|
||||||
pc->meridian = MER24;
|
|
||||||
pc->zones_seen++;
|
|
||||||
- pc->time_zone = time_zone_hhmm ($6, $7);
|
|
||||||
+ pc->time_zone = time_zone_hhmm (pc, $6, $7);
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
@@ -381,16 +392,9 @@ zone:
|
|
||||||
{ pc->time_zone = $1; }
|
|
||||||
| tZONE relunit_snumber
|
|
||||||
{ pc->time_zone = $1;
|
|
||||||
- pc->rel.ns += $2.ns;
|
|
||||||
- pc->rel.seconds += $2.seconds;
|
|
||||||
- pc->rel.minutes += $2.minutes;
|
|
||||||
- pc->rel.hour += $2.hour;
|
|
||||||
- pc->rel.day += $2.day;
|
|
||||||
- pc->rel.month += $2.month;
|
|
||||||
- pc->rel.year += $2.year;
|
|
||||||
- pc->rels_seen = true; }
|
|
||||||
+ apply_relative_time (pc, $2, 1); }
|
|
||||||
| tZONE tSNUMBER o_colon_minutes
|
|
||||||
- { pc->time_zone = $1 + time_zone_hhmm ($2, $3); }
|
|
||||||
+ { pc->time_zone = $1 + time_zone_hhmm (pc, $2, $3); }
|
|
||||||
| tDAYZONE
|
|
||||||
{ pc->time_zone = $1 + 60; }
|
|
||||||
| tZONE tDST
|
|
||||||
@@ -495,25 +499,11 @@ date:
|
|
||||||
|
|
||||||
rel:
|
|
||||||
relunit tAGO
|
|
||||||
- {
|
|
||||||
- pc->rel.ns -= $1.ns;
|
|
||||||
- pc->rel.seconds -= $1.seconds;
|
|
||||||
- pc->rel.minutes -= $1.minutes;
|
|
||||||
- pc->rel.hour -= $1.hour;
|
|
||||||
- pc->rel.day -= $1.day;
|
|
||||||
- pc->rel.month -= $1.month;
|
|
||||||
- pc->rel.year -= $1.year;
|
|
||||||
- }
|
|
||||||
+ { apply_relative_time (pc, $1, -1); }
|
|
||||||
| relunit
|
|
||||||
- {
|
|
||||||
- pc->rel.ns += $1.ns;
|
|
||||||
- pc->rel.seconds += $1.seconds;
|
|
||||||
- pc->rel.minutes += $1.minutes;
|
|
||||||
- pc->rel.hour += $1.hour;
|
|
||||||
- pc->rel.day += $1.day;
|
|
||||||
- pc->rel.month += $1.month;
|
|
||||||
- pc->rel.year += $1.year;
|
|
||||||
- }
|
|
||||||
+ { apply_relative_time (pc, $1, 1); }
|
|
||||||
+ | dayshift
|
|
||||||
+ { apply_relative_time (pc, $1, 1); }
|
|
||||||
;
|
|
||||||
|
|
||||||
relunit:
|
|
||||||
@@ -575,6 +565,11 @@ relunit_snumber:
|
|
||||||
{ $$ = RELATIVE_TIME_0; $$.seconds = $1.value; }
|
|
||||||
;
|
|
||||||
|
|
||||||
+dayshift:
|
|
||||||
+ tDAY_SHIFT
|
|
||||||
+ { $$ = RELATIVE_TIME_0; $$.day = $1; }
|
|
||||||
+ ;
|
|
||||||
+
|
|
||||||
seconds: signed_seconds | unsigned_seconds;
|
|
||||||
|
|
||||||
signed_seconds:
|
|
||||||
@@ -600,14 +595,7 @@ hybrid:
|
|
||||||
/* Hybrid all-digit and relative offset, so that we accept e.g.,
|
|
||||||
"YYYYMMDD +N days" as well as "YYYYMMDD N days". */
|
|
||||||
digits_to_date_time (pc, $1);
|
|
||||||
- pc->rel.ns += $2.ns;
|
|
||||||
- pc->rel.seconds += $2.seconds;
|
|
||||||
- pc->rel.minutes += $2.minutes;
|
|
||||||
- pc->rel.hour += $2.hour;
|
|
||||||
- pc->rel.day += $2.day;
|
|
||||||
- pc->rel.month += $2.month;
|
|
||||||
- pc->rel.year += $2.year;
|
|
||||||
- pc->rels_seen = true;
|
|
||||||
+ apply_relative_time (pc, $2, 1);
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
@@ -688,10 +676,10 @@ static table const time_units_table[] =
|
|
||||||
/* Assorted relative-time words. */
|
|
||||||
static table const relative_time_table[] =
|
|
||||||
{
|
|
||||||
- { "TOMORROW", tDAY_UNIT, 1 },
|
|
||||||
- { "YESTERDAY",tDAY_UNIT, -1 },
|
|
||||||
- { "TODAY", tDAY_UNIT, 0 },
|
|
||||||
- { "NOW", tDAY_UNIT, 0 },
|
|
||||||
+ { "TOMORROW", tDAY_SHIFT, 1 },
|
|
||||||
+ { "YESTERDAY",tDAY_SHIFT, -1 },
|
|
||||||
+ { "TODAY", tDAY_SHIFT, 0 },
|
|
||||||
+ { "NOW", tDAY_SHIFT, 0 },
|
|
||||||
{ "LAST", tORDINAL, -1 },
|
|
||||||
{ "THIS", tORDINAL, 0 },
|
|
||||||
{ "NEXT", tORDINAL, 1 },
|
|
||||||
@@ -814,15 +802,33 @@ static table const military_table[] =
|
|
||||||
|
|
||||||
/* Convert a time zone expressed as HH:MM into an integer count of
|
|
||||||
minutes. If MM is negative, then S is of the form HHMM and needs
|
|
||||||
- to be picked apart; otherwise, S is of the form HH. */
|
|
||||||
+ to be picked apart; otherwise, S is of the form HH. As specified in
|
|
||||||
+ http://www.opengroup.org/susv3xbd/xbd_chap08.html#tag_08_03, allow
|
|
||||||
+ only valid TZ range, and consider first two digits as hours, if no
|
|
||||||
+ minutes specified. */
|
|
||||||
|
|
||||||
static long int
|
|
||||||
-time_zone_hhmm (textint s, long int mm)
|
|
||||||
+time_zone_hhmm (parser_control *pc, textint s, long int mm)
|
|
||||||
{
|
|
||||||
+ long int n_minutes;
|
|
||||||
+
|
|
||||||
+ /* If the length of S is 1 or 2 and no minutes are specified,
|
|
||||||
+ interpret it as a number of hours. */
|
|
||||||
+ if (s.digits <= 2 && mm < 0)
|
|
||||||
+ s.value *= 100;
|
|
||||||
+
|
|
||||||
if (mm < 0)
|
|
||||||
- return (s.value / 100) * 60 + s.value % 100;
|
|
||||||
+ n_minutes = (s.value / 100) * 60 + s.value % 100;
|
|
||||||
else
|
|
||||||
- return s.value * 60 + (s.negative ? -mm : mm);
|
|
||||||
+ n_minutes = s.value * 60 + (s.negative ? -mm : mm);
|
|
||||||
+
|
|
||||||
+ /* If the absolute number of minutes is larger than 24 hours,
|
|
||||||
+ arrange to reject it by incrementing pc->zones_seen. Thus,
|
|
||||||
+ we allow only values in the range UTC-24:00 to UTC+24:00. */
|
|
||||||
+ if (24 * 60 < abs (n_minutes))
|
|
||||||
+ pc->zones_seen++;
|
|
||||||
+
|
|
||||||
+ return n_minutes;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
@@ -919,7 +925,7 @@ lookup_word (parser_control const *pc, c
|
|
||||||
for (p = word; *p; p++)
|
|
||||||
{
|
|
||||||
unsigned char ch = *p;
|
|
||||||
- *p = toupper (ch);
|
|
||||||
+ *p = c_toupper (ch);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (tp = meridian_table; tp->name; tp++)
|
|
||||||
@@ -984,7 +990,7 @@ yylex (YYSTYPE *lvalp, parser_control *p
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
- while (c = *pc->input, isspace (c))
|
|
||||||
+ while (c = *pc->input, c_isspace (c))
|
|
||||||
pc->input++;
|
|
||||||
|
|
||||||
if (ISDIGIT (c) || c == '-' || c == '+')
|
|
||||||
@@ -995,7 +1001,7 @@ yylex (YYSTYPE *lvalp, parser_control *p
|
|
||||||
if (c == '-' || c == '+')
|
|
||||||
{
|
|
||||||
sign = c == '-' ? -1 : 1;
|
|
||||||
- while (c = *++pc->input, isspace (c))
|
|
||||||
+ while (c = *++pc->input, c_isspace (c))
|
|
||||||
continue;
|
|
||||||
if (! ISDIGIT (c))
|
|
||||||
/* skip the '-' sign */
|
|
||||||
@@ -1099,7 +1105,7 @@ yylex (YYSTYPE *lvalp, parser_control *p
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (isalpha (c))
|
|
||||||
+ if (c_isalpha (c))
|
|
||||||
{
|
|
||||||
char buff[20];
|
|
||||||
char *p = buff;
|
|
||||||
@@ -1111,7 +1117,7 @@ yylex (YYSTYPE *lvalp, parser_control *p
|
|
||||||
*p++ = c;
|
|
||||||
c = *++pc->input;
|
|
||||||
}
|
|
||||||
- while (isalpha (c) || c == '.');
|
|
||||||
+ while (c_isalpha (c) || c == '.');
|
|
||||||
|
|
||||||
*p = '\0';
|
|
||||||
tp = lookup_word (pc, buff);
|
|
||||||
@@ -1224,7 +1230,7 @@ get_date (struct timespec *result, char
|
|
||||||
if (! tmp)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
- while (c = *p, isspace (c))
|
|
||||||
+ while (c = *p, c_isspace (c))
|
|
||||||
p++;
|
|
||||||
|
|
||||||
if (strncmp (p, "TZ=\"", 4) == 0)
|
|
||||||
@@ -1436,25 +1442,6 @@ get_date (struct timespec *result, char
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (pc.zones_seen)
|
|
||||||
- {
|
|
||||||
- long int delta = pc.time_zone * 60;
|
|
||||||
- time_t t1;
|
|
||||||
-#ifdef HAVE_TM_GMTOFF
|
|
||||||
- delta -= tm.tm_gmtoff;
|
|
||||||
-#else
|
|
||||||
- time_t t = Start;
|
|
||||||
- struct tm const *gmt = gmtime (&t);
|
|
||||||
- if (! gmt)
|
|
||||||
- goto fail;
|
|
||||||
- delta -= tm_diff (&tm, gmt);
|
|
||||||
-#endif
|
|
||||||
- t1 = Start - delta;
|
|
||||||
- if ((Start < t1) != (delta < 0))
|
|
||||||
- goto fail; /* time_t overflow */
|
|
||||||
- Start = t1;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
/* Add relative date. */
|
|
||||||
if (pc.rel.year | pc.rel.month | pc.rel.day)
|
|
||||||
{
|
|
||||||
@@ -1477,6 +1464,27 @@ get_date (struct timespec *result, char
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* The only "output" of this if-block is an updated Start value,
|
|
||||||
+ so this block must follow others that clobber Start. */
|
|
||||||
+ if (pc.zones_seen)
|
|
||||||
+ {
|
|
||||||
+ long int delta = pc.time_zone * 60;
|
|
||||||
+ time_t t1;
|
|
||||||
+#ifdef HAVE_TM_GMTOFF
|
|
||||||
+ delta -= tm.tm_gmtoff;
|
|
||||||
+#else
|
|
||||||
+ time_t t = Start;
|
|
||||||
+ struct tm const *gmt = gmtime (&t);
|
|
||||||
+ if (! gmt)
|
|
||||||
+ goto fail;
|
|
||||||
+ delta -= tm_diff (&tm, gmt);
|
|
||||||
+#endif
|
|
||||||
+ t1 = Start - delta;
|
|
||||||
+ if ((Start < t1) != (delta < 0))
|
|
||||||
+ goto fail; /* time_t overflow */
|
|
||||||
+ Start = t1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/* Add relative hours, minutes, and seconds. On hosts that support
|
|
||||||
leap seconds, ignore the possibility of leap seconds; e.g.,
|
|
||||||
"+ 10 minutes" adds 600 seconds, even if one of them is a
|
|
@ -1,173 +0,0 @@
|
|||||||
From 9f8be4b0b83d1e0cbf1326f8cb7e077d026d9b0b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kamil Dudka <kdudka@redhat.com>
|
|
||||||
Date: Wed, 23 Jul 2008 11:29:21 +0200
|
|
||||||
Subject: [PATCH] dd: iflag=fullblock now read full blocks if possible
|
|
||||||
* src/dd.c (iread_fullblock): New function for reading full blocks.
|
|
||||||
(scanargs): Check for new parameter iflag=fullblock.
|
|
||||||
(skip): Use iread_fnc pointer instead of iread function.
|
|
||||||
(dd_copy): Use iread_fnc pointer instead of iread function.
|
|
||||||
* tests/dd/misc: Add test for dd - read full blocks.
|
|
||||||
* doc/coretuils.texi: Mention new parameter iflag=fullblock.
|
|
||||||
* NEWS: Mentioned the change.
|
|
||||||
|
|
||||||
---
|
|
||||||
NEWS | 4 ++++
|
|
||||||
doc/coreutils.texi | 6 ++++++
|
|
||||||
src/dd.c | 39 +++++++++++++++++++++++++++++++++++++--
|
|
||||||
tests/dd/misc | 9 +++++++++
|
|
||||||
4 files changed, 56 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
|
|
||||||
index 81e3b91..b95f8dc 100644
|
|
||||||
--- a/doc/coreutils.texi
|
|
||||||
+++ b/doc/coreutils.texi
|
|
||||||
@@ -7719,6 +7719,12 @@ platforms that distinguish binary from text I/O.
|
|
||||||
Use text I/O. Like @samp{binary}, this option has no effect on
|
|
||||||
standard platforms.
|
|
||||||
|
|
||||||
+@item fullblock
|
|
||||||
+@opindex fullblock
|
|
||||||
+Read full blocks from input if possible. read() may return early
|
|
||||||
+if a full block is not available, so retry until data is available
|
|
||||||
+or end of file is reached. This flag can be used only for the iflag option.
|
|
||||||
+
|
|
||||||
@end table
|
|
||||||
|
|
||||||
These flags are not supported on all systems, and @samp{dd} rejects
|
|
||||||
diff --git a/src/dd.c b/src/dd.c
|
|
||||||
index ead9574..1b620df 100644
|
|
||||||
--- a/src/dd.c
|
|
||||||
+++ b/src/dd.c
|
|
||||||
@@ -225,6 +225,9 @@ static sig_atomic_t volatile interrupt_signal;
|
|
||||||
/* A count of the number of pending info signals that have been received. */
|
|
||||||
static sig_atomic_t volatile info_signal_count;
|
|
||||||
|
|
||||||
+/* Function used for read (to handle iflag=fullblock parameter) */
|
|
||||||
+static ssize_t (*iread_fnc) (int fd, char *buf, size_t size);
|
|
||||||
+
|
|
||||||
/* A longest symbol in the struct symbol_values tables below. */
|
|
||||||
#define LONGEST_SYMBOL "fdatasync"
|
|
||||||
|
|
||||||
@@ -257,6 +260,7 @@ static struct symbol_value const conversions[] =
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Flags, for iflag="..." and oflag="...". */
|
|
||||||
+#define O_FULLBLOCK 010000000 /* Read only full blocks from input */
|
|
||||||
static struct symbol_value const flags[] =
|
|
||||||
{
|
|
||||||
{"append", O_APPEND},
|
|
||||||
@@ -271,6 +275,7 @@ static struct symbol_value const flags[] =
|
|
||||||
{"nonblock", O_NONBLOCK},
|
|
||||||
{"sync", O_SYNC},
|
|
||||||
{"text", O_TEXT},
|
|
||||||
+ {"fullblock", O_FULLBLOCK}, /* Read only full blocks from input */
|
|
||||||
{"", 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -496,6 +496,8 @@ Each FLAG symbol may be:\n\
|
|
||||||
fputs (_(" dsync use synchronized I/O for data\n"), stdout);
|
|
||||||
if (O_SYNC)
|
|
||||||
fputs (_(" sync likewise, but also for metadata\n"), stdout);
|
|
||||||
+ fputs (_(" fullblock accumulate full blocks of input (iflag only)\n"),
|
|
||||||
+ stdout);
|
|
||||||
if (O_NONBLOCK)
|
|
||||||
fputs (_(" nonblock use non-blocking I/O\n"), stdout);
|
|
||||||
if (O_NOATIME)
|
|
||||||
@@ -762,6 +769,27 @@ iread (int fd, char *buf, size_t size)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+/* Wrapper around iread function which reads full blocks if possible */
|
|
||||||
+static ssize_t
|
|
||||||
+iread_fullblock (int fd, char *buf, size_t size)
|
|
||||||
+{
|
|
||||||
+ ssize_t nread = 0;
|
|
||||||
+
|
|
||||||
+ while (0 < size)
|
|
||||||
+ {
|
|
||||||
+ ssize_t ncurr = iread(fd, buf, size);
|
|
||||||
+ if (ncurr < 0)
|
|
||||||
+ return ncurr;
|
|
||||||
+ if (ncurr == 0)
|
|
||||||
+ break;
|
|
||||||
+ nread += ncurr;
|
|
||||||
+ buf += ncurr;
|
|
||||||
+ size -= ncurr;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return nread;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/* Write to FD the buffer BUF of size SIZE, processing any signals
|
|
||||||
that arrive. Return the number of bytes written, setting errno if
|
|
||||||
this is less than SIZE. Keep trying if there are partial
|
|
||||||
@@ -1000,6 +1028,15 @@ scanargs (int argc, char *const *argv)
|
|
||||||
if (input_flags & (O_DSYNC | O_SYNC))
|
|
||||||
input_flags |= O_RSYNC;
|
|
||||||
|
|
||||||
+ if (output_flags & O_FULLBLOCK)
|
|
||||||
+ {
|
|
||||||
+ error (0, 0, "%s: %s", _("invalid output flag"), "'fullblock'");
|
|
||||||
+ usage (EXIT_FAILURE);
|
|
||||||
+ }
|
|
||||||
+ iread_fnc = (input_flags & O_FULLBLOCK)?
|
|
||||||
+ iread_fullblock:
|
|
||||||
+ iread;
|
|
||||||
+
|
|
||||||
if (multiple_bits_set (conversions_mask & (C_ASCII | C_EBCDIC | C_IBM)))
|
|
||||||
error (EXIT_FAILURE, 0, _("cannot combine any two of {ascii,ebcdic,ibm}"));
|
|
||||||
if (multiple_bits_set (conversions_mask & (C_BLOCK | C_UNBLOCK)))
|
|
||||||
@@ -1197,7 +1234,7 @@ skip (int fdesc, char const *file, uintmax_t records, size_t blocksize,
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
- ssize_t nread = iread (fdesc, buf, blocksize);
|
|
||||||
+ ssize_t nread = iread_fnc (fdesc, buf, blocksize);
|
|
||||||
if (nread < 0)
|
|
||||||
{
|
|
||||||
if (fdesc == STDIN_FILENO)
|
|
||||||
@@ -1508,7 +1545,7 @@ dd_copy (void)
|
|
||||||
(conversions_mask & (C_BLOCK | C_UNBLOCK)) ? ' ' : '\0',
|
|
||||||
input_blocksize);
|
|
||||||
|
|
||||||
- nread = iread (STDIN_FILENO, ibuf, input_blocksize);
|
|
||||||
+ nread = iread_fnc (STDIN_FILENO, ibuf, input_blocksize);
|
|
||||||
|
|
||||||
if (nread == 0)
|
|
||||||
break; /* EOF. */
|
|
||||||
diff --git a/tests/dd/misc b/tests/dd/misc
|
|
||||||
index d54fbfa..24e5eba 100755
|
|
||||||
--- a/tests/dd/misc
|
|
||||||
+++ b/tests/dd/misc
|
|
||||||
@@ -88,6 +88,15 @@ fi
|
|
||||||
outbytes=`echo x | dd bs=3 ibs=10 obs=10 conv=sync 2>/dev/null | wc -c`
|
|
||||||
test "$outbytes" -eq 3 || fail=1
|
|
||||||
|
|
||||||
+(echo a; sleep .1; echo b) \
|
|
||||||
+ | LC_ALL=C dd bs=4 status=noxfer iflag=fullblock >out 2>err || fail=1
|
|
||||||
+echo "a
|
|
||||||
+b" > out_ok
|
|
||||||
+echo "1+0 records in
|
|
||||||
+1+0 records out" > err_ok
|
|
||||||
+compare out out_ok || fail=1
|
|
||||||
+compare err err_ok || fail=1
|
|
||||||
+
|
|
||||||
test $fail -eq 0 && fail=$warn
|
|
||||||
|
|
||||||
(exit $fail); exit $fail
|
|
||||||
diff -ruN coreutils-6.12.old/doc/coreutils.info coreutils-6.12/doc/coreutils.info
|
|
||||||
--- coreutils-6.12.old/doc/coreutils.info 2008-07-24 12:49:57.000000000 +0200
|
|
||||||
+++ coreutils-6.12/doc/coreutils.info 2008-07-24 12:52:17.000000000 +0200
|
|
||||||
@@ -6112,6 +6112,12 @@
|
|
||||||
Use text I/O. Like `binary', this option has no effect on
|
|
||||||
standard platforms.
|
|
||||||
|
|
||||||
+ 'fullblock'
|
|
||||||
+ Read full blocks from input if possible. read() may return
|
|
||||||
+ early if a full block is not available, so retry until data
|
|
||||||
+ is available or end of file is reached. This flag can be used
|
|
||||||
+ only for the iflag option.
|
|
||||||
+
|
|
||||||
|
|
||||||
These flags are not supported on all systems, and `dd' rejects
|
|
||||||
attempts to use them when they are not supported. When reading
|
|
@ -1,38 +0,0 @@
|
|||||||
From: Kamil Dudka <kdudka@redhat.com>
|
|
||||||
Date: Wed, 30 Jul 2008 12:31:50 +0000 (+0200)
|
|
||||||
Subject: ls -U1 now uses constant memory
|
|
||||||
X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff_plain;h=8d974b00fbbc2025de63e1e6d54827648fefa1c4
|
|
||||||
|
|
||||||
ls -U1 now uses constant memory
|
|
||||||
|
|
||||||
When printing one name per line and not sorting, ls now uses
|
|
||||||
constant memory per directory, no matter how many files are in
|
|
||||||
the directory.
|
|
||||||
* ls.c (print_dir): Print each file name immediately, when possible.
|
|
||||||
---
|
|
||||||
|
|
||||||
diff --git a/src/ls.c b/src/ls.c
|
|
||||||
index 4b69f7d..a661c06 100644
|
|
||||||
--- a/src/ls.c
|
|
||||||
+++ b/src/ls.c
|
|
||||||
@@ -2402,6 +2402,20 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
|
|
||||||
#endif
|
|
||||||
total_blocks += gobble_file (next->d_name, type, D_INO (next),
|
|
||||||
false, name);
|
|
||||||
+
|
|
||||||
+ /* In this narrow case, print out each name right away, so
|
|
||||||
+ ls uses constant memory while processing the entries of
|
|
||||||
+ this directory. Useful when there are many (millions)
|
|
||||||
+ of entries in a directory. */
|
|
||||||
+ if (format == one_per_line && sort_type == sort_none)
|
|
||||||
+ {
|
|
||||||
+ /* We must call sort_files in spite of
|
|
||||||
+ "sort_type == sort_none" for its initialization
|
|
||||||
+ of the sorted_file vector. */
|
|
||||||
+ sort_files ();
|
|
||||||
+ print_current_files ();
|
|
||||||
+ clear_files ();
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (errno != 0)
|
|
@ -1,257 +0,0 @@
|
|||||||
From 7634188624dc7f48c047b29fab3715dc7a468059 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kamil Dudka <kdudka@redhat.com>
|
|
||||||
Date: Wed, 23 Jul 2008 09:52:05 +0200
|
|
||||||
Subject: [PATCH] ls: --color now highlights files with capabilities, too
|
|
||||||
* configure.ac: New option: --disable-libcap. Check for libcap usability.
|
|
||||||
* src/Makefile.am (dir_LDADD, ls_LDADD, ...): Append $(LIB_CAP).
|
|
||||||
* src/ls.c: [HAVE_CAP] Include <sys/capability.h>.
|
|
||||||
(has_capability): New function for capability detection.
|
|
||||||
(print_color_indicator): Colorize file with capability.
|
|
||||||
* src/dircolors.c: Update color lists.
|
|
||||||
* src/dircolors.hin: Mention new CAPABILITY color attribute.
|
|
||||||
* tests/ls/capability: Test for ls - colorize file with capability.
|
|
||||||
* tests/Makefile.am (TESTS): Add ls/capability.
|
|
||||||
* NEWS: Mention the change.
|
|
||||||
|
|
||||||
---
|
|
||||||
NEWS | 2 ++
|
|
||||||
configure.ac | 13 +++++++++++++
|
|
||||||
src/Makefile.am | 6 +++---
|
|
||||||
src/dircolors.c | 4 ++--
|
|
||||||
src/dircolors.hin | 1 +
|
|
||||||
src/ls.c | 43 +++++++++++++++++++++++++++++++++++++++++--
|
|
||||||
tests/Makefile.am | 1 +
|
|
||||||
tests/ls/capability | 43 +++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
8 files changed, 106 insertions(+), 7 deletions(-)
|
|
||||||
create mode 100755 tests/ls/capability
|
|
||||||
|
|
||||||
diff -ruN coreutils-6.12.old/configure.ac coreutils-6.12/configure.ac
|
|
||||||
--- coreutils-6.12.old/configure.ac 2008-07-24 14:16:32.000000000 +0200
|
|
||||||
+++ coreutils-6.12/configure.ac 2008-07-24 14:18:51.000000000 +0200
|
|
||||||
@@ -58,6 +58,19 @@
|
|
||||||
LIB_SELINUX="-lselinux"
|
|
||||||
AC_SUBST(LIB_SELINUX)])
|
|
||||||
|
|
||||||
+dnl Check whether libcap is usable
|
|
||||||
+AC_ARG_ENABLE([libcap],
|
|
||||||
+ AC_HELP_STRING([--disable-libcap], [disable libcap support]),
|
|
||||||
+ AC_MSG_WARN([libcap support disabled by user]),
|
|
||||||
+ [AC_CHECK_LIB([cap], [cap_get_file],
|
|
||||||
+ [AC_CHECK_HEADER([sys/capability.h],
|
|
||||||
+ [LIB_CAP="-lcap" AC_DEFINE(HAVE_CAP, 1, [libcap usability])],
|
|
||||||
+ [AC_MSG_WARN([header sys/capability.h was not found, support for libcap will not be built])]
|
|
||||||
+ )],
|
|
||||||
+ [AC_MSG_WARN([libcap library was not found or not usable, support for libcap will not be built])])
|
|
||||||
+ ])
|
|
||||||
+AC_SUBST([LIB_CAP])
|
|
||||||
+
|
|
||||||
AC_FUNC_FORK
|
|
||||||
|
|
||||||
optional_bin_progs=
|
|
||||||
diff -ruN coreutils-6.12.orig/src/Makefile.am coreutils-6.12/src/Makefile.am
|
|
||||||
--- coreutils-6.12.orig/src/Makefile.am 2008-07-10 12:30:03.000000000 +0200
|
|
||||||
+++ coreutils-6.12/src/Makefile.am 2008-07-24 13:18:43.000000000 +0200
|
|
||||||
@@ -98,15 +98,15 @@
|
|
||||||
|
|
||||||
# for clock_gettime and fdatasync
|
|
||||||
dd_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC)
|
|
||||||
-dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX)
|
|
||||||
+dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP)
|
|
||||||
id_LDADD = $(LDADD) $(LIB_SELINUX)
|
|
||||||
-ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX)
|
|
||||||
+ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP)
|
|
||||||
mktemp_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
|
||||||
pr_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
|
||||||
shred_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC)
|
|
||||||
shuf_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
|
||||||
tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
|
||||||
-vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX)
|
|
||||||
+vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP)
|
|
||||||
tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
|
||||||
|
|
||||||
## If necessary, add -lm to resolve use of pow in lib/strtod.c.
|
|
||||||
diff --git a/src/dircolors.c b/src/dircolors.c
|
|
||||||
index 56194f7..79109b9 100644
|
|
||||||
--- a/src/dircolors.c
|
|
||||||
+++ b/src/dircolors.c
|
|
||||||
@@ -63,14 +63,14 @@ static const char *const slack_codes[] =
|
|
||||||
"SYMLINK", "ORPHAN", "MISSING", "FIFO", "PIPE", "SOCK", "BLK", "BLOCK",
|
|
||||||
"CHR", "CHAR", "DOOR", "EXEC", "LEFT", "LEFTCODE", "RIGHT", "RIGHTCODE",
|
|
||||||
"END", "ENDCODE", "SUID", "SETUID", "SGID", "SETGID", "STICKY",
|
|
||||||
- "OTHER_WRITABLE", "OWR", "STICKY_OTHER_WRITABLE", "OWT", NULL
|
|
||||||
+ "OTHER_WRITABLE", "OWR", "STICKY_OTHER_WRITABLE", "OWT", "CAPABILITY", NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *const ls_codes[] =
|
|
||||||
{
|
|
||||||
"no", "no", "fi", "rs", "di", "ln", "ln", "ln", "or", "mi", "pi", "pi",
|
|
||||||
"so", "bd", "bd", "cd", "cd", "do", "ex", "lc", "lc", "rc", "rc", "ec", "ec",
|
|
||||||
- "su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", NULL
|
|
||||||
+ "su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", "ca", NULL
|
|
||||||
};
|
|
||||||
#define array_len(Array) (sizeof (Array) / sizeof *(Array))
|
|
||||||
verify (array_len (slack_codes) == array_len (ls_codes));
|
|
||||||
diff --git a/src/dircolors.hin b/src/dircolors.hin
|
|
||||||
index 38914c8..5137cc6 100644
|
|
||||||
--- a/src/dircolors.hin
|
|
||||||
+++ b/src/dircolors.hin
|
|
||||||
@@ -77,6 +77,7 @@ CHR 40;33;01 # character device driver
|
|
||||||
ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
|
|
||||||
SETUID 37;41 # file that is setuid (u+s)
|
|
||||||
SETGID 30;43 # file that is setgid (g+s)
|
|
||||||
+CAPABILITY 30;41 # file with capability
|
|
||||||
STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
|
|
||||||
OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
|
|
||||||
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
|
|
||||||
diff --git a/src/ls.c b/src/ls.c
|
|
||||||
index 4b69f7d..9bc66a1 100644
|
|
||||||
--- a/src/ls.c
|
|
||||||
+++ b/src/ls.c
|
|
||||||
@@ -38,6 +38,10 @@
|
|
||||||
#include <config.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
+#ifdef HAVE_CAP
|
|
||||||
+# include <sys/capability.h>
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#if HAVE_TERMIOS_H
|
|
||||||
# include <termios.h>
|
|
||||||
#endif
|
|
||||||
@@ -513,14 +517,14 @@ enum indicator_no
|
|
||||||
C_LEFT, C_RIGHT, C_END, C_RESET, C_NORM, C_FILE, C_DIR, C_LINK,
|
|
||||||
C_FIFO, C_SOCK,
|
|
||||||
C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC, C_DOOR, C_SETUID, C_SETGID,
|
|
||||||
- C_STICKY, C_OTHER_WRITABLE, C_STICKY_OTHER_WRITABLE
|
|
||||||
+ C_STICKY, C_OTHER_WRITABLE, C_STICKY_OTHER_WRITABLE, C_CAP
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *const indicator_name[]=
|
|
||||||
{
|
|
||||||
"lc", "rc", "ec", "rs", "no", "fi", "di", "ln", "pi", "so",
|
|
||||||
"bd", "cd", "mi", "or", "ex", "do", "su", "sg", "st",
|
|
||||||
- "ow", "tw", NULL
|
|
||||||
+ "ow", "tw", "ca", NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
struct color_ext_type
|
|
||||||
@@ -553,6 +557,7 @@ static struct bin_str color_indicator[] =
|
|
||||||
{ LEN_STR_PAIR ("37;44") }, /* st: sticky: black on blue */
|
|
||||||
{ LEN_STR_PAIR ("34;42") }, /* ow: other-writable: blue on green */
|
|
||||||
{ LEN_STR_PAIR ("30;42") }, /* tw: ow w/ sticky: black on green */
|
|
||||||
+ { LEN_STR_PAIR ("30;41") }, /* ca: black on red */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* FIXME: comment */
|
|
||||||
@@ -3896,6 +3901,38 @@ print_type_indicator (bool stat_ok, mode_t mode, enum filetype type)
|
|
||||||
DIRED_PUTCHAR (c);
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef HAVE_CAP
|
|
||||||
+static bool
|
|
||||||
+/* Return true if NAME has a capability (see linux/capability.h) */
|
|
||||||
+has_capability (const char *name)
|
|
||||||
+{
|
|
||||||
+ cap_t cap_d;
|
|
||||||
+ char *result;
|
|
||||||
+ bool has_cap;
|
|
||||||
+
|
|
||||||
+ cap_d = cap_get_file (name);
|
|
||||||
+ if (cap_d == NULL)
|
|
||||||
+ return false;
|
|
||||||
+
|
|
||||||
+ result = cap_to_text (cap_d, NULL);
|
|
||||||
+ cap_free (cap_d);
|
|
||||||
+ if (!result)
|
|
||||||
+ return false;
|
|
||||||
+
|
|
||||||
+ /* check if human-readable capability string is empty */
|
|
||||||
+ has_cap = !!*result;
|
|
||||||
+
|
|
||||||
+ cap_free (result);
|
|
||||||
+ return has_cap;
|
|
||||||
+}
|
|
||||||
+#else
|
|
||||||
+static bool
|
|
||||||
+has_capability (const char *name)
|
|
||||||
+{
|
|
||||||
+ return false;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/* Returns whether any color sequence was printed. */
|
|
||||||
static bool
|
|
||||||
print_color_indicator (const char *name, mode_t mode, int linkok,
|
|
||||||
@@ -3923,6 +3960,8 @@ print_color_indicator (const char *name, mode_t mode, int linkok,
|
|
||||||
type = C_SETUID;
|
|
||||||
else if ((mode & S_ISGID) != 0)
|
|
||||||
type = C_SETGID;
|
|
||||||
+ else if (is_colored (C_CAP) && has_capability (name))
|
|
||||||
+ type = C_CAP;
|
|
||||||
else if ((mode & S_IXUGO) != 0)
|
|
||||||
type = C_EXEC;
|
|
||||||
}
|
|
||||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
|
||||||
index c2da630..309d174 100644
|
|
||||||
--- a/tests/Makefile.am
|
|
||||||
+++ b/tests/Makefile.am
|
|
||||||
@@ -313,6 +313,7 @@ TESTS = \
|
|
||||||
ln/misc \
|
|
||||||
ln/sf-1 \
|
|
||||||
ln/target-1 \
|
|
||||||
+ ls/capability \
|
|
||||||
ls/color-dtype-dir \
|
|
||||||
ls/dangle \
|
|
||||||
ls/dired \
|
|
||||||
diff --git a/tests/ls/capability b/tests/ls/capability
|
|
||||||
new file mode 100755
|
|
||||||
index 0000000..549e06b
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tests/ls/capability
|
|
||||||
@@ -0,0 +1,43 @@
|
|
||||||
+#!/bin/sh
|
|
||||||
+# Ensure "ls --color" properly colorizes file with capability.
|
|
||||||
+
|
|
||||||
+# Copyright (C) 2008 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
|
|
||||||
+# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+
|
|
||||||
+# This program is distributed in the hope that it will be useful,
|
|
||||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
+# GNU General Public License for more details.
|
|
||||||
+
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
+
|
|
||||||
+if test "$VERBOSE" = yes; then
|
|
||||||
+ set -x
|
|
||||||
+ ls --version
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+. $srcdir/test-lib.sh
|
|
||||||
+require_root_
|
|
||||||
+
|
|
||||||
+(setcap --help) 2>&1 |grep 'usage: setcap' > /dev/null \
|
|
||||||
+ || skip_test_ "setcap utility not found"
|
|
||||||
+fail=0
|
|
||||||
+
|
|
||||||
+# Don't let a different umask perturb the results.
|
|
||||||
+umask 22
|
|
||||||
+
|
|
||||||
+touch test
|
|
||||||
+setcap cap_net_bind_service=ep test \
|
|
||||||
+ || framework_failure
|
|
||||||
+code='30;41'
|
|
||||||
+LS_COLORS="ca=$code" \
|
|
||||||
+ ls --color=always test > out || fail=1
|
|
||||||
+printf "\033[0m\033[${code}mtest\033[0m\n\033[m" > out_ok || fail=1
|
|
||||||
+compare out out_ok || fail=1
|
|
||||||
+
|
|
||||||
+(exit $fail); exit $fail
|
|
||||||
--
|
|
||||||
1.5.4.1
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
diff -urNp coreutils-6.12-orig/src/seq.c coreutils-6.12/src/seq.c
|
|
||||||
--- coreutils-6.12-orig/src/seq.c 2008-05-26 08:40:32.000000000 +0200
|
|
||||||
+++ coreutils-6.12/src/seq.c 2008-09-29 22:09:21.000000000 +0200
|
|
||||||
@@ -304,7 +304,10 @@ print_numbers (char const *fmt, struct l
|
|
||||||
bool print_extra_number = false;
|
|
||||||
long double x_val;
|
|
||||||
char *x_str;
|
|
||||||
- int x_strlen = asprintf (&x_str, fmt, x);
|
|
||||||
+ int x_strlen;
|
|
||||||
+ setlocale (LC_NUMERIC, "C");
|
|
||||||
+ x_strlen = asprintf (&x_str, fmt, x);
|
|
||||||
+ setlocale (LC_NUMERIC, "");
|
|
||||||
if (x_strlen < 0)
|
|
||||||
xalloc_die ();
|
|
||||||
x_str[x_strlen - layout.suffix_len] = '\0';
|
|
@ -1,89 +0,0 @@
|
|||||||
diff -Naurp coreutils-6.12.orig/lib/utimens.c coreutils-6.12/lib/utimens.c
|
|
||||||
--- coreutils-6.12.orig/lib/utimens.c 2008-10-06 16:21:11.000000000 -0400
|
|
||||||
+++ coreutils-6.12/lib/utimens.c 2008-10-06 16:26:33.000000000 -0400
|
|
||||||
@@ -103,6 +103,18 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
|
||||||
if (fd < 0)
|
|
||||||
{
|
|
||||||
int result = utimensat (AT_FDCWD, file, timespec, 0);
|
|
||||||
+# ifdef __linux__
|
|
||||||
+ /* Work around xen kernel bug:
|
|
||||||
+ http://bugzilla.redhat.com/442352
|
|
||||||
+ http://bugzilla.redhat.com/449910
|
|
||||||
+ When running on a sufficiently old (pre-RHEL5.3) x86_64 xen
|
|
||||||
+ kernel, utimensat can mistakenly return its syscall number (280 on
|
|
||||||
+ x86_64) rather than the proper ENOSYS code, due to a xen bug.
|
|
||||||
+ FIXME: remove in 2010 or whenever the offending kernels
|
|
||||||
+ are no longer in common use. */
|
|
||||||
+ if (0 < result)
|
|
||||||
+ errno = ENOSYS;
|
|
||||||
+# endif
|
|
||||||
if (result == 0 || errno != ENOSYS)
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@@ -110,6 +122,18 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
|
||||||
#if HAVE_FUTIMENS
|
|
||||||
{
|
|
||||||
int result = futimens (fd, timespec);
|
|
||||||
+# ifdef __linux__
|
|
||||||
+ /* Work around xen kernel bug:
|
|
||||||
+ http://bugzilla.redhat.com/442352
|
|
||||||
+ http://bugzilla.redhat.com/449910
|
|
||||||
+ When running on a sufficiently old (pre-RHEL5.3) x86_64 xen
|
|
||||||
+ kernel, utimensat can mistakenly return its syscall number (280 on
|
|
||||||
+ x86_64) rather than the proper ENOSYS code, due to a xen bug.
|
|
||||||
+ FIXME: remove in 2010 or whenever the offending kernels
|
|
||||||
+ are no longer in common use. */
|
|
||||||
+ if (0 < result)
|
|
||||||
+ errno = ENOSYS;
|
|
||||||
+# endif
|
|
||||||
if (result == 0 || errno != ENOSYS)
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
diff -Naurp coreutils-6.12.orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
|
|
||||||
--- coreutils-6.12.orig/tests/Makefile.am 2008-10-06 16:21:11.000000000 -0400
|
|
||||||
+++ coreutils-6.12/tests/Makefile.am 2008-10-06 16:22:04.000000000 -0400
|
|
||||||
@@ -215,6 +215,7 @@ TESTS = \
|
|
||||||
misc/tty-eof \
|
|
||||||
misc/unexpand \
|
|
||||||
misc/uniq \
|
|
||||||
+ misc/utimensat-touchcp \
|
|
||||||
chmod/c-option \
|
|
||||||
chmod/equal-x \
|
|
||||||
chmod/equals \
|
|
||||||
diff -Naurp coreutils-6.12.orig/tests/misc/utimensat-touchcp coreutils-6.12/tests/misc/utimensat-touchcp
|
|
||||||
--- coreutils-6.12.orig/tests/misc/utimensat-touchcp 1969-12-31 19:00:00.000000000 -0500
|
|
||||||
+++ coreutils-6.12/tests/misc/utimensat-touchcp 2008-10-06 16:22:04.000000000 -0400
|
|
||||||
@@ -0,0 +1,33 @@
|
|
||||||
+#!/bin/sh
|
|
||||||
+# Make sure touch -r and cp -pr works without hanging.
|
|
||||||
+
|
|
||||||
+if test "$VERBOSE" = yes; then
|
|
||||||
+ set -x
|
|
||||||
+ touch --version
|
|
||||||
+ cp --version
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+. $srcdir/test-lib.sh
|
|
||||||
+
|
|
||||||
+touch a.old || framework_failure
|
|
||||||
+sleep 1
|
|
||||||
+
|
|
||||||
+fail=0
|
|
||||||
+
|
|
||||||
+#check for touch
|
|
||||||
+touch -r a.old a || fail=1
|
|
||||||
+ls -l --full-time a >time1
|
|
||||||
+ls -l --full-time a.old >time2
|
|
||||||
+sed -i 's/a.old/a/' time2
|
|
||||||
+cmp time1 time2 > /dev/null 2>&1 || fail=1
|
|
||||||
+test $fail = 1 && diff time1 time2 2> /dev/null
|
|
||||||
+
|
|
||||||
+#check for cp
|
|
||||||
+cp -pr a.old b || fail=1
|
|
||||||
+ls -l --full-time a >time1
|
|
||||||
+ls -l --full-time a.old >time2
|
|
||||||
+sed -i 's/a.old/a/' time2
|
|
||||||
+cmp time1 time2 > /dev/null 2>&1 || fail=1
|
|
||||||
+test $fail = 1 && diff time1 time2 2> /dev/null
|
|
||||||
+
|
|
||||||
+(exit $fail); exit $fail
|
|
112
coreutils-7.0-dftotal.patch
Normal file
112
coreutils-7.0-dftotal.patch
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
diff -urNp coreutils-7.0-orig/tests/df/total coreutils-7.0/tests/df/total
|
||||||
|
--- coreutils-7.0-orig/tests/df/total 2008-09-27 19:28:54.000000000 +0200
|
||||||
|
+++ coreutils-7.0/tests/df/total 2008-11-11 16:56:17.000000000 +0100
|
||||||
|
@@ -30,11 +30,8 @@ umask 22
|
||||||
|
|
||||||
|
RE_TOTAL='^total( +(-?[0-9]+|-)){3} +-?[0-9]+%$'
|
||||||
|
|
||||||
|
-df > tmp || fail=1
|
||||||
|
-$EGREP "$RE_TOTAL" tmp && fail=1
|
||||||
|
-
|
||||||
|
-df -i > tmp || fail=1
|
||||||
|
-$EGREP "$RE_TOTAL" tmp && fail=1
|
||||||
|
+df | $EGREP "$RE_TOTAL" tmp && fail=1
|
||||||
|
+df -i | $EGREP "$RE_TOTAL" tmp && fail=1
|
||||||
|
|
||||||
|
df --total | $EGREP "$RE_TOTAL" || fail=1
|
||||||
|
df -i --total | $EGREP "$RE_TOTAL" || fail=1
|
||||||
|
diff -urNp coreutils-7.0-orig/tests/df/total-awk coreutils-7.0/tests/df/total-awk
|
||||||
|
--- coreutils-7.0-orig/tests/df/total-awk 2008-09-27 19:28:54.000000000 +0200
|
||||||
|
+++ coreutils-7.0/tests/df/total-awk 2008-11-11 16:54:49.000000000 +0100
|
||||||
|
@@ -23,58 +23,42 @@ fi
|
||||||
|
|
||||||
|
. $srcdir/test-lib.sh
|
||||||
|
|
||||||
|
-fail=0
|
||||||
|
-
|
||||||
|
-# Don't let a different umask perturb the results.
|
||||||
|
-umask 22
|
||||||
|
-
|
||||||
|
-echo '
|
||||||
|
-BEGIN {
|
||||||
|
- total = 0
|
||||||
|
- used = 0
|
||||||
|
- available = 0
|
||||||
|
-}
|
||||||
|
-{
|
||||||
|
- if (NR==1 || $0==$1 || $0~/^total +(-?[0-9]+|-) +(-?[0-9]+|-) +(-?[0-9]+|-) +-?[0-9]+%$/)
|
||||||
|
- next
|
||||||
|
- if ($1~/^[0-9]/)
|
||||||
|
- {
|
||||||
|
- total += $1
|
||||||
|
- used += $2
|
||||||
|
- available += $3
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- total += $2
|
||||||
|
- used += $3
|
||||||
|
- available += $4
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-END {
|
||||||
|
- print total
|
||||||
|
- print used
|
||||||
|
- print available
|
||||||
|
-}
|
||||||
|
-' > compute_sum.awk || fail=1
|
||||||
|
-
|
||||||
|
-echo '
|
||||||
|
-/^total +(-?[0-9]+|-) +(-?[0-9]+|-) +(-?[0-9]+|-) +-?[0-9]+%$/ {
|
||||||
|
- print $2;
|
||||||
|
- print $3;
|
||||||
|
- print $4
|
||||||
|
-}
|
||||||
|
-' > parse_total.awk || fail=1
|
||||||
|
+cat <<\EOF > check-df || framework_failure
|
||||||
|
+my ($total, $used, $avail) = (0, 0, 0);
|
||||||
|
+while (<>)
|
||||||
|
+ {
|
||||||
|
+ $. == 1
|
||||||
|
+ and next; # skip first (header) line
|
||||||
|
+ # Recognize df output lines like these:
|
||||||
|
+ # /dev/sdc1 0 0 0 - /c
|
||||||
|
+ # tmpfs 1536000 12965 1523035 1% /tmp
|
||||||
|
+ # total 5285932 787409 4498523 15%
|
||||||
|
+ /^(.*?) +(-?\d+|-) +(-?\d+|-) +(-?\d+|-) +(?:- |[0-9]+%)(.*)$/
|
||||||
|
+ or die "$0: invalid input line\n: $_";
|
||||||
|
+ if ($1 eq 'total' && $5 eq '')
|
||||||
|
+ {
|
||||||
|
+ $total == $2 or die "$total != $2";
|
||||||
|
+ $used == $3 or die "$used != $3";
|
||||||
|
+ $avail == $4 or die "$avail != $4";
|
||||||
|
+ my $line = <>;
|
||||||
|
+ defined $line
|
||||||
|
+ and die "$0: extra line(s) after totals\n";
|
||||||
|
+ exit 0;
|
||||||
|
+ }
|
||||||
|
+ $total += $2 unless $2 eq '-';
|
||||||
|
+ $used += $3 unless $3 eq '-';
|
||||||
|
+ $avail += $4 unless $4 eq '-';
|
||||||
|
+ }
|
||||||
|
+die "$0: missing line of totals\n";
|
||||||
|
+EOF
|
||||||
|
|
||||||
|
# Use --block-size=512 to keep df from printing rounded-to-kilobyte
|
||||||
|
# numbers which wouldn't necessarily add up to the displayed total.
|
||||||
|
-df --block-size=512 --total |tee tmp || fail=1
|
||||||
|
-$AWK -f compute_sum.awk tmp > out1 || fail=1
|
||||||
|
-$AWK -f parse_total.awk tmp > out2 || fail=1
|
||||||
|
-compare out1 out2 || fail=1
|
||||||
|
+df --total -P --block-size=512 |tee space || framework_failure
|
||||||
|
+df --total -i -P |tee inode || framework_failure
|
||||||
|
|
||||||
|
-df -i --block-size=512 --total |tee tmp || fail=1
|
||||||
|
-$AWK -f compute_sum.awk tmp > out1 || fail=1
|
||||||
|
-$AWK -f parse_total.awk tmp > out2 || fail=1
|
||||||
|
-compare out1 out2 || fail=1
|
||||||
|
+fail=0
|
||||||
|
+$PERL -f check-df space || fail=1
|
||||||
|
+$PERL -f check-df inode || fail=1
|
||||||
|
|
||||||
|
Exit $fail
|
@ -1,61 +0,0 @@
|
|||||||
Signed-off-by: Ondřej Vašík <ovasik@redhat.com>
|
|
||||||
Signed-off-by: Jim Meyering <meyering@redhat.com>
|
|
||||||
|
|
||||||
* src/echo.c (AUTHORS) : Use bash builtin echo authors instead of FIXME unknown
|
|
||||||
* src/basename.c (AUTHORS): List David as the author.
|
|
||||||
* AUTHORS: Update here, too.
|
|
||||||
---
|
|
||||||
AUTHORS | 4 ++--
|
|
||||||
src/basename.c | 2 +-
|
|
||||||
src/echo.c | 4 +++-
|
|
||||||
3 files changed, 6 insertions(+), 4 deletions(-)
|
|
||||||
diff --git a/src/basename.c b/src/basename.c
|
|
||||||
index 38e8879..69b708f 100644
|
|
||||||
--- a/src/basename.c
|
|
||||||
+++ b/src/basename.c
|
|
||||||
@@ -37,7 +37,7 @@
|
|
||||||
/* The official name of this program (e.g., no `g' prefix). */
|
|
||||||
#define PROGRAM_NAME "basename"
|
|
||||||
|
|
||||||
-#define AUTHORS proper_name ("FIXME unknown")
|
|
||||||
+#define AUTHORS proper_name ("David MacKenzie")
|
|
||||||
|
|
||||||
/* The name this program was run with. */
|
|
||||||
char *program_name;
|
|
||||||
diff --git a/AUTHORS b/AUTHORS
|
|
||||||
index 404cf70..666edc1 100644
|
|
||||||
--- a/AUTHORS
|
|
||||||
+++ b/AUTHORS
|
|
||||||
@@ -3,7 +3,7 @@ each followed by the name(s) of its author(s).
|
|
||||||
|
|
||||||
arch: David MacKenzie, Karel Zak
|
|
||||||
base64: Simon Josefsson
|
|
||||||
-basename: FIXME unknown
|
|
||||||
+basename: David MacKenzie
|
|
||||||
cat: Torbjörn Granlund, Richard M. Stallman
|
|
||||||
chcon: Russell Coker, Jim Meyering
|
|
||||||
chgrp: David MacKenzie, Jim Meyering
|
|
||||||
@@ -22,7 +22,7 @@ dir: Richard M. Stallman, David MacKenzie
|
|
||||||
dircolors: H. Peter Anvin
|
|
||||||
dirname: David MacKenzie, Jim Meyering
|
|
||||||
du: Torbjörn Granlund, David MacKenzie, Paul Eggert, Jim Meyering
|
|
||||||
-echo: FIXME unknown
|
|
||||||
+echo: Brian Fox, Chet Ramey
|
|
||||||
env: Richard Mlynarik, David MacKenzie
|
|
||||||
expand: David MacKenzie
|
|
||||||
expr: Mike Parker
|
|
||||||
diff --git a/src/echo.c b/src/echo.c
|
|
||||||
index ebbf5b8..11e648e 100644
|
|
||||||
--- a/src/echo.c
|
|
||||||
+++ b/src/echo.c
|
|
||||||
@@ -24,7 +24,9 @@
|
|
||||||
/* The official name of this program (e.g., no `g' prefix). */
|
|
||||||
#define PROGRAM_NAME "echo"
|
|
||||||
|
|
||||||
-#define AUTHORS proper_name ("FIXME unknown")
|
|
||||||
+#define AUTHORS \
|
|
||||||
+ proper_name ("Brian Fox"), \
|
|
||||||
+ proper_name ("Chet Ramey")
|
|
||||||
|
|
||||||
/* echo [-neE] [arg ...]
|
|
||||||
Output the ARGs. If -n is specified, the trailing newline is
|
|
@ -1,119 +0,0 @@
|
|||||||
From b566edc2489a889d97416d2390be7796aa8cdbeb Mon Sep 17 00:00:00 2001
|
|
||||||
From: Eric Blake <ebb9@byu.net>
|
|
||||||
Date: Mon, 2 Jun 2008 15:08:14 -0600
|
|
||||||
Subject: [PATCH] Provide futimens/utimensat fallbacks for older kernels.
|
|
||||||
|
|
||||||
* lib/utimens.c (gl_futimens) [HAVE_UTIMENSAT, HAVE_FUTIMENS]:
|
|
||||||
Provide runtime fallback if kernel lacks support.
|
|
||||||
Reported by Mike Frysinger.
|
|
||||||
|
|
||||||
Signed-off-by: Eric Blake <ebb9@byu.net>
|
|
||||||
---
|
|
||||||
lib/utimens.c | 43 ++++++++++++++++++++++++++-----------------
|
|
||||||
1 file changed, 26 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/utimens.c b/lib/utimens.c
|
|
||||||
index 25bc965..134310b 100644
|
|
||||||
--- a/lib/utimens.c
|
|
||||||
+++ b/lib/utimens.c
|
|
||||||
@@ -96,20 +96,30 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* POSIX 200x added two interfaces to set file timestamps with
|
|
||||||
- nanosecond resolution. */
|
|
||||||
+ nanosecond resolution. We provide a fallback for ENOSYS (for
|
|
||||||
+ example, compiling against Linux 2.6.25 kernel headers and glibc
|
|
||||||
+ 2.7, but running on Linux 2.6.18 kernel). */
|
|
||||||
#if HAVE_UTIMENSAT
|
|
||||||
if (fd < 0)
|
|
||||||
- return utimensat (AT_FDCWD, file, timespec, 0);
|
|
||||||
+ {
|
|
||||||
+ int result = utimensat (AT_FDCWD, file, timespec, 0);
|
|
||||||
+ if (result == 0 || errno != ENOSYS)
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
#endif
|
|
||||||
#if HAVE_FUTIMENS
|
|
||||||
- return futimens (fd, timespec);
|
|
||||||
-#else
|
|
||||||
+ {
|
|
||||||
+ int result = futimens (fd, timespec);
|
|
||||||
+ if (result == 0 || errno != ENOSYS)
|
|
||||||
+ return result;
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* The platform lacks an interface to set file timestamps with
|
|
||||||
nanosecond resolution, so do the best we can, discarding any
|
|
||||||
fractional part of the timestamp. */
|
|
||||||
{
|
|
||||||
-# if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
|
|
||||||
+#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
|
|
||||||
struct timeval timeval[2];
|
|
||||||
struct timeval const *t;
|
|
||||||
if (timespec)
|
|
||||||
@@ -125,9 +135,9 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
|
||||||
|
|
||||||
if (fd < 0)
|
|
||||||
{
|
|
||||||
-# if HAVE_FUTIMESAT
|
|
||||||
+# if HAVE_FUTIMESAT
|
|
||||||
return futimesat (AT_FDCWD, file, t);
|
|
||||||
-# endif
|
|
||||||
+# endif
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@@ -141,21 +151,21 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
|
||||||
worth optimizing, and who knows what other messed-up systems
|
|
||||||
are out there? So play it safe and fall back on the code
|
|
||||||
below. */
|
|
||||||
-# if HAVE_FUTIMESAT
|
|
||||||
+# if HAVE_FUTIMESAT
|
|
||||||
if (futimesat (fd, NULL, t) == 0)
|
|
||||||
return 0;
|
|
||||||
-# elif HAVE_FUTIMES
|
|
||||||
+# elif HAVE_FUTIMES
|
|
||||||
if (futimes (fd, t) == 0)
|
|
||||||
return 0;
|
|
||||||
-# endif
|
|
||||||
+# endif
|
|
||||||
}
|
|
||||||
-# endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
|
|
||||||
+#endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
|
|
||||||
|
|
||||||
if (!file)
|
|
||||||
{
|
|
||||||
-# if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
|
|
||||||
+#if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
|
|
||||||
errno = ENOSYS;
|
|
||||||
-# endif
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* Prefer EBADF to ENOSYS if both error numbers apply. */
|
|
||||||
if (errno == ENOSYS)
|
|
||||||
@@ -170,9 +180,9 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
-# if HAVE_WORKING_UTIMES
|
|
||||||
+#if HAVE_WORKING_UTIMES
|
|
||||||
return utimes (file, t);
|
|
||||||
-# else
|
|
||||||
+#else
|
|
||||||
{
|
|
||||||
struct utimbuf utimbuf;
|
|
||||||
struct utimbuf const *ut;
|
|
||||||
@@ -187,9 +197,8 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
|
||||||
|
|
||||||
return utime (file, ut);
|
|
||||||
}
|
|
||||||
-# endif /* !HAVE_WORKING_UTIMES */
|
|
||||||
+#endif /* !HAVE_WORKING_UTIMES */
|
|
||||||
}
|
|
||||||
-#endif /* !HAVE_FUTIMENS */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the access and modification time stamps of FILE to be
|
|
||||||
--
|
|
||||||
1.5.5.1
|
|
@ -20,4 +20,4 @@
|
|||||||
+acl2=`cd b && getfacl file`
|
+acl2=`cd b && getfacl file`
|
||||||
test "$acl1" = "$acl2" || fail=1
|
test "$acl1" = "$acl2" || fail=1
|
||||||
|
|
||||||
(exit $fail); exit $fail
|
Exit $fail
|
||||||
|
@ -90,14 +90,14 @@
|
|||||||
diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
|
diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
|
||||||
--- coreutils-6.12-orig/tests/Makefile.am 2008-05-27 13:47:53.000000000 +0200
|
--- coreutils-6.12-orig/tests/Makefile.am 2008-05-27 13:47:53.000000000 +0200
|
||||||
+++ coreutils-6.12/tests/Makefile.am 2008-06-02 10:06:03.000000000 +0200
|
+++ coreutils-6.12/tests/Makefile.am 2008-06-02 10:06:03.000000000 +0200
|
||||||
@@ -191,6 +191,7 @@
|
@@ -192,6 +192,7 @@
|
||||||
misc/shuf \
|
|
||||||
misc/sort \
|
misc/sort \
|
||||||
misc/sort-compress \
|
misc/sort-compress \
|
||||||
|
misc/sort-files0-from \
|
||||||
+ misc/sort-mb-tests \
|
+ misc/sort-mb-tests \
|
||||||
misc/sort-merge \
|
misc/sort-merge \
|
||||||
misc/sort-rand \
|
misc/sort-rand \
|
||||||
misc/split-a \
|
misc/sort-version \
|
||||||
@@ -391,6 +392,10 @@
|
@@ -391,6 +392,10 @@
|
||||||
$(root_tests)
|
$(root_tests)
|
||||||
|
|
||||||
@ -541,8 +541,8 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
|
|||||||
+}
|
+}
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
static struct line *
|
static void
|
||||||
dup_line (const struct line *old)
|
freeline (struct line *line)
|
||||||
{
|
{
|
||||||
@@ -377,11 +601,18 @@
|
@@ -377,11 +601,18 @@
|
||||||
|
|
||||||
@ -865,13 +865,13 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
|
|||||||
return a pointer to the beginning of the line's field to be compared. */
|
return a pointer to the beginning of the line's field to be compared. */
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
-find_field (const struct linebuffer *line)
|
-find_field (struct linebuffer const *line)
|
||||||
+find_field_uni (struct linebuffer *line)
|
+find_field_uni (struct linebuffer *line)
|
||||||
{
|
{
|
||||||
size_t count;
|
size_t count;
|
||||||
char *lp = line->buffer;
|
char const *lp = line->buffer;
|
||||||
@@ -219,6 +245,83 @@
|
@@ -219,6 +245,83 @@
|
||||||
return lp + i;
|
return line->buffer + i;
|
||||||
}
|
}
|
||||||
|
|
||||||
+#if HAVE_MBRTOWC
|
+#if HAVE_MBRTOWC
|
||||||
@ -1214,7 +1214,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
|
|||||||
#define TAB_WIDTH 8
|
#define TAB_WIDTH 8
|
||||||
|
|
||||||
/* The official name of this program (e.g., no `g' prefix). */
|
/* The official name of this program (e.g., no `g' prefix). */
|
||||||
@@ -35,23 +57,44 @@
|
@@ -35,20 +57,41 @@
|
||||||
|
|
||||||
#define AUTHORS proper_name ("David MacKenzie")
|
#define AUTHORS proper_name ("David MacKenzie")
|
||||||
|
|
||||||
@ -1238,9 +1238,6 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
|
|||||||
+ character_mode,
|
+ character_mode,
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
/* The name this program was run with. */
|
|
||||||
char *program_name;
|
|
||||||
|
|
||||||
+/* The argument shows current mode. (Default: column_mode) */
|
+/* The argument shows current mode. (Default: column_mode) */
|
||||||
+static enum operating_mode operating_mode;
|
+static enum operating_mode operating_mode;
|
||||||
+
|
+
|
||||||
@ -1735,7 +1732,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
|
|||||||
if (hard_LC_TIME)
|
if (hard_LC_TIME)
|
||||||
{
|
{
|
||||||
@@ -1031,6 +1100,64 @@
|
@@ -1031,6 +1100,64 @@
|
||||||
#endif
|
xstrtol_fatal (e, oi, c, long_options, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
+#if HAVE_MBRTOWC
|
+#if HAVE_MBRTOWC
|
||||||
@ -3900,7 +3897,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
|
|||||||
+ size_t delimlen = 0;
|
+ size_t delimlen = 0;
|
||||||
|
|
||||||
initialize_main (&argc, &argv);
|
initialize_main (&argc, &argv);
|
||||||
program_name = argv[0];
|
set_program_name (argv[0]);
|
||||||
@@ -770,7 +1090,6 @@
|
@@ -770,7 +1090,6 @@
|
||||||
switch (optc)
|
switch (optc)
|
||||||
{
|
{
|
||||||
@ -4025,10 +4022,10 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
|
|||||||
diff -urNp coreutils-6.12/src/join.c coreutils-6.12-orig/src/join.c
|
diff -urNp coreutils-6.12/src/join.c coreutils-6.12-orig/src/join.c
|
||||||
--- coreutils-6.12/src/join.c 2008-07-16 14:08:01.000000000 +0200
|
--- coreutils-6.12/src/join.c 2008-07-16 14:08:01.000000000 +0200
|
||||||
+++ coreutils-6.12-orig/src/join.c 2008-07-16 14:07:02.000000000 +0200
|
+++ coreutils-6.12-orig/src/join.c 2008-07-16 14:07:02.000000000 +0200
|
||||||
@@ -489,6 +489,11 @@ get_line (FILE *fp, struct line *line, i
|
@@ -634,6 +634,11 @@ get_line (FILE *fp, struct line *line, i
|
||||||
line->nfields_allocated = 0;
|
return false;
|
||||||
line->nfields = 0;
|
}
|
||||||
line->fields = NULL;
|
|
||||||
+#if HAVE_MBRTOWC
|
+#if HAVE_MBRTOWC
|
||||||
+ if (MB_CUR_MAX > 1)
|
+ if (MB_CUR_MAX > 1)
|
||||||
+ xfields_multibyte (line);
|
+ xfields_multibyte (line);
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
ATTRIBUTE_NORETURN;
|
ATTRIBUTE_NORETURN;
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
/* The name this program was run with. */
|
/* If true, pass the `-f' option to the subshell. */
|
||||||
char *program_name;
|
static bool fast_startup;
|
||||||
@@ -225,7 +251,26 @@
|
@@ -225,7 +251,26 @@
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -401,8 +401,8 @@
|
|||||||
-might find this idea strange at first.
|
-might find this idea strange at first.
|
||||||
-
|
-
|
||||||
-
|
-
|
||||||
@node Process control
|
@node timeout invocation
|
||||||
@chapter Process control
|
@section @command{timeout}: Run a command with a time limit
|
||||||
|
|
||||||
--- coreutils-6.7/configure.ac.pam 2006-12-07 21:30:24.000000000 +0000
|
--- coreutils-6.7/configure.ac.pam 2006-12-07 21:30:24.000000000 +0000
|
||||||
+++ coreutils-6.7/configure.ac 2007-01-09 17:18:04.000000000 +0000
|
+++ coreutils-6.7/configure.ac 2007-01-09 17:18:04.000000000 +0000
|
||||||
|
@ -37,20 +37,6 @@ diff -urNp coreutils-6.12-orig/man/runcon.x coreutils-6.12/man/runcon.x
|
|||||||
diff -urNp coreutils-6.12-orig/src/chcon.c coreutils-6.12/src/chcon.c
|
diff -urNp coreutils-6.12-orig/src/chcon.c coreutils-6.12/src/chcon.c
|
||||||
--- coreutils-6.12-orig/src/chcon.c 2008-05-26 08:40:32.000000000 +0200
|
--- coreutils-6.12-orig/src/chcon.c 2008-05-26 08:40:32.000000000 +0200
|
||||||
+++ coreutils-6.12/src/chcon.c 2008-06-16 14:43:24.000000000 +0200
|
+++ coreutils-6.12/src/chcon.c 2008-06-16 14:43:24.000000000 +0200
|
||||||
@@ -302,9 +302,11 @@ process_file (FTS *fts, FTSENT *ent)
|
|
||||||
|
|
||||||
if (ok)
|
|
||||||
{
|
|
||||||
- if (verbose)
|
|
||||||
- printf (_("changing security context of %s"),
|
|
||||||
+ if (verbose) {
|
|
||||||
+ printf (_("changing security context of %s"),
|
|
||||||
quote (file_full_name));
|
|
||||||
+ putchar ('\n');
|
|
||||||
+ }
|
|
||||||
|
|
||||||
if (change_file_context (fts->fts_cwd_fd, file) != 0)
|
|
||||||
ok = false;
|
|
||||||
@@ -352,7 +352,7 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\
|
@@ -352,7 +352,7 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\
|
||||||
"),
|
"),
|
||||||
program_name, program_name, program_name);
|
program_name, program_name, program_name);
|
||||||
@ -209,8 +195,8 @@ diff -urp coreutils-6.10-orig/src/cp.c coreutils-6.10/src/cp.c
|
|||||||
sparse_type_string, sparse_type);
|
sparse_type_string, sparse_type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
- case 'a': /* Like -dpPR. */
|
- case 'a': /* Like -dpR. */
|
||||||
+ case 'a': /* Like -dpPRc. */
|
+ case 'a': /* Like -dpRc. */
|
||||||
x.dereference = DEREF_NEVER;
|
x.dereference = DEREF_NEVER;
|
||||||
x.preserve_links = true;
|
x.preserve_links = true;
|
||||||
x.preserve_ownership = true;
|
x.preserve_ownership = true;
|
||||||
@ -296,8 +282,8 @@ diff -urp coreutils-6.10-orig/src/install.c coreutils-6.10/src/install.c
|
|||||||
- {"preserve_context", no_argument, NULL, PRESERVE_CONTEXT_OPTION},
|
- {"preserve_context", no_argument, NULL, PRESERVE_CONTEXT_OPTION},
|
||||||
+ {"preserve_context", no_argument, NULL, 'P'},
|
+ {"preserve_context", no_argument, NULL, 'P'},
|
||||||
{"strip", no_argument, NULL, 's'},
|
{"strip", no_argument, NULL, 's'},
|
||||||
|
{"strip-program", required_argument, NULL, STRIP_PROGRAM_OPTION},
|
||||||
{"suffix", required_argument, NULL, 'S'},
|
{"suffix", required_argument, NULL, 'S'},
|
||||||
{"target-directory", required_argument, NULL, 't'},
|
|
||||||
@@ -178,6 +178,7 @@ cp_option_init (struct cp_options *x)
|
@@ -178,6 +178,7 @@ cp_option_init (struct cp_options *x)
|
||||||
x->preserve_timestamps = false;
|
x->preserve_timestamps = false;
|
||||||
x->require_preserve = false;
|
x->require_preserve = false;
|
||||||
@ -324,7 +310,7 @@ diff -urp coreutils-6.10-orig/src/install.c coreutils-6.10/src/install.c
|
|||||||
if ( ! selinux_enabled)
|
if ( ! selinux_enabled)
|
||||||
{
|
{
|
||||||
@@ -415,6 +417,10 @@ main (int argc, char **argv)
|
@@ -415,6 +417,10 @@ main (int argc, char **argv)
|
||||||
"this kernel is not SELinux-enabled."));
|
"this kernel is not SELinux-enabled"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
+ if ( x.set_security_context ) {
|
+ if ( x.set_security_context ) {
|
||||||
@ -384,8 +370,8 @@ diff -urp coreutils-6.10-orig/src/ls.c coreutils-6.10/src/ls.c
|
|||||||
void usage (int status);
|
void usage (int status);
|
||||||
+static void print_scontext_format (const struct fileinfo *f);
|
+static void print_scontext_format (const struct fileinfo *f);
|
||||||
|
|
||||||
/* The name this program was run with. */
|
/* Initial size of hash table.
|
||||||
char *program_name;
|
Most hierarchies are likely to be shallower than this. */
|
||||||
@@ -314,7 +316,7 @@ static struct pending *pending_dirs;
|
@@ -314,7 +316,7 @@ static struct pending *pending_dirs;
|
||||||
|
|
||||||
static struct timespec current_time;
|
static struct timespec current_time;
|
||||||
@ -871,14 +857,18 @@ diff -urp coreutils-6.10-orig/src/stat.c coreutils-6.10/src/stat.c
|
|||||||
char *format = NULL;
|
char *format = NULL;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
@@ -1040,9 +1071,13 @@ main (int argc, char *argv[])
|
@@ -1040,13 +1071,13 @@ main (int argc, char *argv[])
|
||||||
terse = true;
|
terse = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
- case 'Z': /* FIXME: remove in 2010, warn in mid 2008 */
|
- case 'Z': /* FIXME: remove in 2010 */
|
||||||
- /* Ignored, for compatibility with distributions
|
- /* Ignore, for compatibility with distributions
|
||||||
- that implemented this before upstream. */
|
- that implemented this before upstream.
|
||||||
+ case 'Z':
|
- But warn of impending removal. */
|
||||||
|
- error (0, 0,
|
||||||
|
- _("the --context (-Z) option is obsolete and will be removed\n"
|
||||||
|
- "in a future release"));
|
||||||
|
+ case 'Z':
|
||||||
+ if((is_selinux_enabled()>0))
|
+ if((is_selinux_enabled()>0))
|
||||||
+ secure = 1;
|
+ secure = 1;
|
||||||
+ else {
|
+ else {
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
From 63467fa18794f02497c7a46e3b7783ba1180f8fc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jim Meyering <meyering@redhat.com>
|
|
||||||
Date: Fri, 4 Jul 2008 16:34:39 +0200
|
|
||||||
Subject: [PATCH] who -r: don't print "last=" when the corresponding byte is unprintable
|
|
||||||
|
|
||||||
* src/who.c (print_runlevel): Print last=%c only when the "preceding
|
|
||||||
run-level" byte is printable. Reported by Gian Piero De Lolliis in
|
|
||||||
<http://bugzilla.redhat.com/453249>.
|
|
||||||
---
|
|
||||||
src/who.c | 3 ++-
|
|
||||||
1 files changed, 2 insertions(+), 1 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/who.c b/src/who.c
|
|
||||||
index 5529618..0bba912 100644
|
|
||||||
--- a/src/who.c
|
|
||||||
+++ b/src/who.c
|
|
||||||
@@ -30,6 +30,7 @@
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include "system.h"
|
|
||||||
|
|
||||||
+#include "c-ctype.h"
|
|
||||||
#include "canon-host.h"
|
|
||||||
#include "readutmp.h"
|
|
||||||
#include "error.h"
|
|
||||||
@@ -511,7 +512,7 @@ print_runlevel (const STRUCT_UTMP *utmp_ent)
|
|
||||||
sprintf (comment, "%s%c", _("last="), (last == 'N') ? 'S' : last);
|
|
||||||
|
|
||||||
print_line (-1, "", ' ', -1, runlevline, time_string (utmp_ent),
|
|
||||||
- "", "", comment, "");
|
|
||||||
+ "", "", c_isprint (last) ? comment : "", "");
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
1.5.6.1.206.g8dcaf96
|
|
||||||
|
|
||||||
From 10db2e5e05c67eea205b3ec76a2408f46356a7fd Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?utf-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <ovasik@redhat.com>
|
|
||||||
Date: Wed, 2 Jul 2008 14:11:05 +0200
|
|
||||||
Subject: [PATCH] doci: describe who's -p -r and -t options
|
|
||||||
|
|
||||||
* doc/coreutils.texi (who invocation):
|
|
||||||
---
|
|
||||||
doc/coreutils.texi | 18 ++++++++++++++++++
|
|
||||||
1 files changed, 18 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
|
|
||||||
index 155ba8d..c0ea237 100644
|
|
||||||
--- a/doc/coreutils.texi
|
|
||||||
+++ b/doc/coreutils.texi
|
|
||||||
@@ -12710,6 +12710,24 @@ automatic dial-up internet access.
|
|
||||||
@opindex --heading
|
|
||||||
Print a line of column headings.
|
|
||||||
|
|
||||||
+@item -p
|
|
||||||
+@itemx --process
|
|
||||||
+@opindex -p
|
|
||||||
+@opindex --process
|
|
||||||
+List active processes spawned by init.
|
|
||||||
+
|
|
||||||
+@item -r
|
|
||||||
+@itemx --runlevel
|
|
||||||
+@opindex -r
|
|
||||||
+@opindex --runlevel
|
|
||||||
+Print the current (and maybe previous) run-level of the init process.
|
|
||||||
+
|
|
||||||
+@item -t
|
|
||||||
+@itemx --time
|
|
||||||
+@opindex -t
|
|
||||||
+@opindex --time
|
|
||||||
+Print last system clock change.
|
|
||||||
+
|
|
||||||
@item -w
|
|
||||||
@itemx -T
|
|
||||||
@itemx --mesg
|
|
||||||
--
|
|
||||||
1.5.2.2
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
|
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
|
||||||
Name: coreutils
|
Name: coreutils
|
||||||
Version: 6.12
|
Version: 7.0
|
||||||
Release: 17%{?dist}
|
Release: 1%{?dist}
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Url: http://www.gnu.org/software/coreutils/
|
Url: http://www.gnu.org/software/coreutils/
|
||||||
@ -18,21 +18,14 @@ Source202: coreutils-su-l.pamd
|
|||||||
Source203: coreutils-runuser-l.pamd
|
Source203: coreutils-runuser-l.pamd
|
||||||
|
|
||||||
# From upstream
|
# From upstream
|
||||||
Patch1: coreutils-futimensatkoji.patch
|
Patch1: coreutils-446294-lsexitstatuses.patch
|
||||||
Patch2: coreutils-authors.patch
|
Patch2: coreutils-7.0-dftotal.patch
|
||||||
Patch3: coreutils-who_texinfo.patch
|
|
||||||
Patch4: coreutils-6.12-date_timerelsnumber.patch
|
|
||||||
Patch5: coreutils-6.12-seqdecimalutf8.patch
|
|
||||||
Patch6: coreutils-6.12-catch-known-testsuite-failures.patch
|
|
||||||
Patch7: coreutils-446294-lsexitstatuses.patch
|
|
||||||
|
|
||||||
# Our patches
|
# Our patches
|
||||||
Patch100: coreutils-6.10-configuration.patch
|
Patch100: coreutils-6.10-configuration.patch
|
||||||
Patch101: coreutils-6.10-manpages.patch
|
Patch101: coreutils-6.10-manpages.patch
|
||||||
#Patch102: coreutils-6.10-longoptions.patch
|
#Patch102: coreutils-6.10-longoptions.patch
|
||||||
Patch103: coreutils-6.11-sparc-shafix.patch
|
Patch103: coreutils-6.11-sparc-shafix.patch
|
||||||
Patch104: coreutils-6.12-utimenstouchcp.patch
|
|
||||||
Patch105: coreutils-6.12-dd-fullblock.patch
|
|
||||||
|
|
||||||
# sh-utils
|
# sh-utils
|
||||||
Patch703: sh-utils-2.0.11-dateman.patch
|
Patch703: sh-utils-2.0.11-dateman.patch
|
||||||
@ -60,10 +53,6 @@ Patch950: coreutils-selinux.patch
|
|||||||
Patch951: coreutils-selinuxmanpages.patch
|
Patch951: coreutils-selinuxmanpages.patch
|
||||||
Patch952: coreutils-463883-chcon-changes.patch
|
Patch952: coreutils-463883-chcon-changes.patch
|
||||||
|
|
||||||
# ls enhancements (must be applied after SELINUX patches)
|
|
||||||
Patch954: coreutils-6.12-ls-libcap.patch
|
|
||||||
Patch955: coreutils-6.12-ls-constant_mem.patch
|
|
||||||
|
|
||||||
BuildRequires: libselinux-devel >= 1.25.6-1
|
BuildRequires: libselinux-devel >= 1.25.6-1
|
||||||
BuildRequires: libacl-devel
|
BuildRequires: libacl-devel
|
||||||
BuildRequires: gettext bison
|
BuildRequires: gettext bison
|
||||||
@ -107,24 +96,21 @@ These are the GNU core utilities. This package is the combination of
|
|||||||
the old GNU fileutils, sh-utils, and textutils packages.
|
the old GNU fileutils, sh-utils, and textutils packages.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
#%setup -q
|
||||||
|
%setup -q -c -T
|
||||||
|
cd ..
|
||||||
|
lzma -dc %SOURCE0 | tar xf -
|
||||||
|
cd %name-%version
|
||||||
|
|
||||||
# From upstream
|
# From upstream
|
||||||
%patch1 -p1 -b .kojifutimensat
|
%patch1 -p1 -b .lsexit
|
||||||
%patch2 -p1 -b .authors
|
%patch2 -p1 -b .dftotal
|
||||||
%patch3 -p1 -b .whotexinfo
|
|
||||||
%patch4 -p1 -b .getdate
|
|
||||||
%patch5 -p1 -b .sequtf8
|
|
||||||
%patch6 -p1 -b .tests
|
|
||||||
%patch7 -p1 -b .lsexit
|
|
||||||
|
|
||||||
# Our patches
|
# Our patches
|
||||||
%patch100 -p1 -b .configure
|
%patch100 -p1 -b .configure
|
||||||
%patch101 -p1 -b .manpages
|
%patch101 -p1 -b .manpages
|
||||||
#%patch102 -p1 -b .longopt
|
#%patch102 -p1 -b .longopt
|
||||||
%patch103 -p1 -b .sparc
|
%patch103 -p1 -b .sparc
|
||||||
%patch104 -p1 -b .utimensat
|
|
||||||
%patch105 -p1 -b .dd-fullblock
|
|
||||||
|
|
||||||
# sh-utils
|
# sh-utils
|
||||||
%patch703 -p1 -b .dateman
|
%patch703 -p1 -b .dateman
|
||||||
@ -141,22 +127,21 @@ the old GNU fileutils, sh-utils, and textutils packages.
|
|||||||
%patch908 -p1 -b .getgrouplist
|
%patch908 -p1 -b .getgrouplist
|
||||||
%patch912 -p1 -b .overflow
|
%patch912 -p1 -b .overflow
|
||||||
%patch915 -p1 -b .splitl
|
%patch915 -p1 -b .splitl
|
||||||
%patch916 -p1 -b .getfacl-exit-code
|
#%patch916 -p1 -b .getfacl-exit-code
|
||||||
|
|
||||||
#SELinux
|
#SELinux
|
||||||
%patch950 -p1 -b .selinux
|
%patch950 -p1 -b .selinux
|
||||||
%patch951 -p1 -b .selinuxman
|
%patch951 -p1 -b .selinuxman
|
||||||
%patch952 -p1 -b .changeonly
|
%patch952 -p1 -b .changeonly
|
||||||
|
|
||||||
# ls enhancements (must be applied after SELINUX patches)
|
|
||||||
%patch954 -p1 -b .ls-libcap
|
|
||||||
%patch955 -p1 -b .ls-constant_mem
|
|
||||||
|
|
||||||
|
|
||||||
chmod a+x tests/misc/sort-mb-tests
|
chmod a+x tests/misc/sort-mb-tests
|
||||||
chmod a+x tests/misc/id-context
|
chmod a+x tests/misc/id-context
|
||||||
chmod a+x tests/misc/utimensat-touchcp
|
|
||||||
chmod a+x tests/ls/capability
|
#Do require automake 1.10.1 instead of 1.10a
|
||||||
|
for conffile in aclocal.m4 configure.ac configure $(find ./*/Makefile.in)
|
||||||
|
do
|
||||||
|
sed -i 's/1.10a/1.10.1/' "$conffile"
|
||||||
|
done
|
||||||
|
|
||||||
#fix typos/mistakes in localized documentation(#439410, #440056)
|
#fix typos/mistakes in localized documentation(#439410, #440056)
|
||||||
for pofile in $(find ./po/*.p*)
|
for pofile in $(find ./po/*.p*)
|
||||||
@ -169,9 +154,9 @@ done
|
|||||||
%build
|
%build
|
||||||
%ifarch s390 s390x
|
%ifarch s390 s390x
|
||||||
# Build at -O1 for the moment (bug #196369).
|
# Build at -O1 for the moment (bug #196369).
|
||||||
export CFLAGS="$RPM_OPT_FLAGS -fPIC -O1"
|
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fPIC -O1"
|
||||||
%else
|
%else
|
||||||
export CFLAGS="$RPM_OPT_FLAGS -fpic"
|
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fpic"
|
||||||
%endif
|
%endif
|
||||||
%{expand:%%global optflags %{optflags} -D_GNU_SOURCE=1}
|
%{expand:%%global optflags %{optflags} -D_GNU_SOURCE=1}
|
||||||
touch aclocal.m4 configure config.hin Makefile.in */Makefile.in
|
touch aclocal.m4 configure config.hin Makefile.in */Makefile.in
|
||||||
@ -339,6 +324,11 @@ fi
|
|||||||
/sbin/runuser
|
/sbin/runuser
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 11 2008 Ondrej Vasik <ovasik@redhat.com> - 7.0-1
|
||||||
|
- new upstream release
|
||||||
|
- modification/removal of related patches
|
||||||
|
- use automake 1.10.1 instead of 1.10a
|
||||||
|
|
||||||
* Mon Nov 03 2008 Ondrej Vasik <ovasik@redhat.com> - 6.12-17
|
* Mon Nov 03 2008 Ondrej Vasik <ovasik@redhat.com> - 6.12-17
|
||||||
- Requires: ncurses (#469277)
|
- Requires: ncurses (#469277)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user