Bump to Coreutils 6.9 37/54537/1 accepted/tizen/base/20151229.114144 submit/tizen/20151223.035611 submit/tizen/20151231.040340 submit/tizen_base/20151229.003349
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 16 Dec 2015 04:46:35 +0000 (13:46 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 16 Dec 2015 04:46:35 +0000 (13:46 +0900)
Sync with tizen 2.4
Run unit test

Change-Id: I37949360a56432aefc96bf27c16196bdba752956
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
128 files changed:
.gitignore [deleted file]
.hgignore [deleted file]
.kludge-stamp [deleted file]
.prev-version [deleted file]
.vg-suppressions [deleted file]
.x-po-check [deleted file]
.x-sc_file_system [deleted file]
.x-sc_obsolete_symbols [deleted file]
.x-sc_prohibit_atoi_atof [deleted file]
.x-sc_require_config_h [deleted file]
.x-sc_space_tab [deleted file]
.x-sc_sun_os_names [deleted file]
.x-sc_trailing_blank [deleted file]
.x-sc_unmarked_diagnostics [deleted file]
.x-sc_useless_cpp_parens [deleted file]
lib/utimens.c
lib/utimens.h
packaging/baselibs.conf [new file with mode: 0644]
packaging/coreutils.manifest [new file with mode: 0644]
packaging/coreutils.spec [new file with mode: 0644]
packaging/mktemp-1.5.tar.gz [new file with mode: 0644]
run_test.sh [new file with mode: 0755]
src/copy.c
src/copy.h
src/cp.c
src/id.c
src/install.c
src/ls.c
src/mkdir.c
src/mkfifo.c
src/mknod.c
src/mv.c
src/smack.h [new file with mode: 0644]
src/stat.c
src/touch.c
tests/Makefile.in
tests/chgrp/Makefile.in
tests/chmod/Makefile.in
tests/chmod/no-x
tests/chown/Makefile.in
tests/chown/deref
tests/chown/preserve-root
tests/cp/Makefile.in
tests/cp/backup-is-src
tests/cp/fail-perm
tests/cp/into-self
tests/cut/Makefile.in
tests/dd/Makefile.in
tests/dircolors/Makefile.in
tests/dircolors/simple
tests/du/Makefile.in
tests/du/files0-from
tests/du/inacc-dest
tests/du/long-sloop
tests/du/no-x
tests/expr/Makefile.in
tests/expr/basic
tests/factor/Makefile.in
tests/factor/basic
tests/fmt/Makefile.in
tests/fmt/basic
tests/head/Makefile.in
tests/install/Makefile.in
tests/install/basic-1
tests/join/Makefile.in
tests/ln/Makefile.in
tests/ln/hard-backup
tests/ls-2/Makefile.in
tests/ls-2/tests
tests/ls/Makefile.in
tests/md5sum/Makefile.in
tests/md5sum/basic-1
tests/misc/Makefile.in
tests/misc/basename
tests/misc/csplit
tests/misc/dirname
tests/misc/split-fail
tests/misc/stat-printf
tests/misc/wc-files0-from
tests/mkdir/Makefile.in
tests/mkdir/p-v
tests/mv/Makefile.in
tests/mv/dir2dir
tests/mv/dup-source
tests/mv/i-1
tests/mv/i-link-no
tests/mv/perm-1
tests/mv/reply-no
tests/od/Makefile.in
tests/pr/Makefile.in
tests/readlink/Makefile.in
tests/rm/Makefile.in
tests/rm/cycle
tests/rm/dir-no-w
tests/rm/dir-nonrecur
tests/rm/fail-eacces
tests/rm/inaccessible
tests/rm/interactive-always
tests/rm/interactive-once
tests/rm/isatty
tests/rm/rm1
tests/rm/rm2
tests/rm/rm3
tests/rm/rm5
tests/rm/unread2
tests/rmdir/Makefile.in
tests/seq/Makefile.in
tests/sha1sum/Makefile.in
tests/sha1sum/basic-1
tests/shred/Makefile.in
tests/sort/Makefile.in
tests/stty/Makefile.in
tests/sum/Makefile.in
tests/tac/Makefile.in
tests/tail-2/Makefile.in
tests/tail/Makefile.in
tests/tee/Makefile.in
tests/test/Makefile.in
tests/touch/Makefile.in
tests/touch/fail-diag
tests/touch/not-owner
tests/tr/Makefile.in
tests/tsort/Makefile.in
tests/tsort/basic-1
tests/unexpand/Makefile.in
tests/unexpand/basic-1
tests/uniq/Makefile.in
tests/wc/Makefile.in

diff --git a/.gitignore b/.gitignore
deleted file mode 100644 (file)
index 4567b1b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-*.1
-*.I[12]
-*.[EIOX]
-*.gmo
-*.o
-*/.deps
-*~
-.kludge-stamp
-ABOUT-NLS
-INSTALL
-Makefile
-Makefile.in
-THANKS-to-translators
-aclocal.m4
-autom4te.cache
-config.cache
-config.h
-config.hin
-config.log
-config.status
-configure
-coreutils-*.tar.bz2
-coreutils-*.tar.bz2.sig
-coreutils-*.tar.gz
-coreutils-*.tar.gz.sig
-coreutils-*.xdelta
-coreutils-*.xdelta.sig
-stamp-h1
-tests/cut/cut-tests
-tests/head/head-tests
-tests/join/join-tests
-tests/pr/pr-tests
-tests/sort/sort-tests
-tests/tac/tac-tests
-tests/tail/tail-tests
-tests/test/test-tests
-tests/tr/tr-tests
-tests/uniq/uniq-tests
-tests/wc/wc-tests
diff --git a/.hgignore b/.hgignore
deleted file mode 100644 (file)
index efbf44f..0000000
--- a/.hgignore
+++ /dev/null
@@ -1,147 +0,0 @@
-.*/Makefile$
-.*/Makefile\.in$
-.*/\.deps/
-.*\.1$
-.*\.o$
-.*~$
-^Makefile$
-^Makefile\.in$
-^THANKS-to-translators$
-^aclocal\.m4$
-^autom4te\.cache/
-^config\.h$
-^config\.hin$
-^config\.log$
-^config\.status$
-^configure$
-^doc/constants\.texi$
-^doc/coreutils\.info$
-^doc/stamp-vti$
-^doc/version\.texi$
-^lib/alloca\.h$
-^lib/charset\.alias$
-^lib/getdate\.c$
-^lib/libcoreutils\.a$
-^lib/ref-add\.sed$
-^lib/ref-del\.sed$
-^lib/t-fpending$
-^po/.*\.gmo$
-^po/.*\.po$
-^po/POTFILES$
-^po/stamp-po$
-^po/remove-potcdate.sed$
-^src/\[$
-^src/base64$
-^src/basename$
-^src/cat$
-^src/chgrp$
-^src/chmod$
-^src/chown$
-^src/chroot$
-^src/cksum$
-^src/comm$
-^src/cp$
-^src/csplit$
-^src/cut$
-^src/date$
-^src/dd$
-^src/df$
-^src/dir$
-^src/dircolors$
-^src/dircolors\.h$
-^src/dirname$
-^src/du$
-^src/echo$
-^src/env$
-^src/expand$
-^src/expr$
-^src/factor$
-^src/false$
-^src/fmt$
-^src/fold$
-^src/fs\.h$
-^src/ginstall$
-^src/groups$
-^src/head$
-^src/hostid$
-^src/hostname$
-^src/id$
-^src/join$
-^src/kill$
-^src/link$
-^src/ln$
-^src/localedir\.h$
-^src/logname$
-^src/ls$
-^src/md5sum$
-^src/mkdir$
-^src/mkfifo$
-^src/mknod$
-^src/mv$
-^src/nice$
-^src/nl$
-^src/nohup$
-^src/od$
-^src/paste$
-^src/pathchk$
-^src/pinky$
-^src/pr$
-^src/printenv$
-^src/printf$
-^src/ptx$
-^src/pwd$
-^src/readlink$
-^src/rm$
-^src/rmdir$
-^src/seq$
-^src/setuidgid$
-^src/sha1sum$
-^src/sha224sum$
-^src/sha256sum$
-^src/sha384sum$
-^src/sha512sum$
-^src/shred$
-^src/sleep$
-^src/sort$
-^src/split$
-^src/stat$
-^src/stty$
-^src/su$
-^src/sum$
-^src/sync$
-^src/tac$
-^src/tail$
-^src/tee$
-^src/test$
-^src/touch$
-^src/tr$
-^src/true$
-^src/tsort$
-^src/tty$
-^src/uname$
-^src/unexpand$
-^src/uniq$
-^src/unlink$
-^src/uptime$
-^src/users$
-^src/vdir$
-^src/wc$
-^src/wheel-size\.h$
-^src/wheel\.h$
-^src/who$
-^src/whoami$
-^src/yes$
-^stamp-h1$
-^tests/.*\.I[12]$
-^tests/.*\.[EIOX]$
-^tests/cut/cut-tests$
-^tests/head/head-tests$
-^tests/join/join-tests$
-^tests/pr/pr-tests$
-^tests/sort/sort-tests$
-^tests/tac/tac-tests$
-^tests/tail/tail-tests$
-^tests/test/test-tests$
-^tests/tr/tr-tests$
-^tests/uniq/uniq-tests$
-^tests/wc/wc-tests$
diff --git a/.kludge-stamp b/.kludge-stamp
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.prev-version b/.prev-version
deleted file mode 100644 (file)
index 341291e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-6.7
diff --git a/.vg-suppressions b/.vg-suppressions
deleted file mode 100644 (file)
index a6cb2fe..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-# Suppress valgrind diagnostics we don't care about.
-
-# Copyright (C) 2003, 2004, 2006 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 2 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, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-
-{
-   libc_dl_open
-   Memcheck:Cond
-   fun:_dl_relocate_object
-   obj:/lib/libc-2.3.2.so
-   fun:_dl_catch_error
-   fun:_dl_open
-}
-
-{
-   libc_dl_catch_error__map_object
-   Memcheck:Addr1
-   obj:/lib/ld-2.3.2.so
-   fun:_dl_map_object
-   obj:/lib/libc-2.3.2.so
-   fun:_dl_catch_error
-}
-{
-   libc_dl_catch_error__map_versions
-   Memcheck:Addr1
-   obj:/lib/ld-2.3.2.so
-   fun:_dl_check_map_versions
-   obj:/lib/libc-2.3.2.so
-   fun:_dl_catch_error
-}
-
-{
-   jm_libc_sigaction
-   Memcheck:Param
-   sigaction(act)
-   fun:__libc_sigaction
-}
-
-{
-   libc_expand_dynamic_string_token
-   Memcheck:Cond
-   fun:strlen
-   fun:expand_dynamic_string_token
-   obj:*
-   obj:*
-   obj:*
-   obj:*
-   obj:*
-}
-{
-   libc__dl_new_object
-   Memcheck:Cond
-   fun:strlen
-   fun:_dl_new_object
-   obj:*
-   obj:*
-   obj:*
-   obj:*
-}
-{
-   libc_fillin_rpath
-   Memcheck:Cond
-   fun:strlen
-   fun:fillin_rpath
-}
diff --git a/.x-po-check b/.x-po-check
deleted file mode 100644 (file)
index 202ec8e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-ChangeLog(-[0-9]+)?$
-^old/
-^src/c99-to-c98\.diff$
-^gl/.*
diff --git a/.x-sc_file_system b/.x-sc_file_system
deleted file mode 100644 (file)
index a2e3887..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-ChangeLog
-Makefile.maint
-NEWS
-config-log
-po/
-src/df.c
-src/stat.c
-tests/misc/df-P
diff --git a/.x-sc_obsolete_symbols b/.x-sc_obsolete_symbols
deleted file mode 100644 (file)
index a2fe831..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-ChangeLog*
-Makefile.maint
-config.hin
-configure
-m4/jm-macros.m4
-src/system.h
diff --git a/.x-sc_prohibit_atoi_atof b/.x-sc_prohibit_atoi_atof
deleted file mode 100644 (file)
index d995223..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-^configure$
-ChangeLog
-^TODO$
-^lib/mktime\.c$
-^lib/getloadavg\.c$
-^lib/euidaccess\.c$
-^lib/euidaccess-stat\.c$
-^lib/group-member\.c$
-^Makefile\.maint$
-^doc/coreutils.texi$
-^src/stty.c$
diff --git a/.x-sc_require_config_h b/.x-sc_require_config_h
deleted file mode 100644 (file)
index 415a113..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-^lib/at-func\.c$
-^lib/bcopy\.c$
-^lib/buffer-lcm\.c$
-^lib/c-strtold\.c$
-^lib/fnmatch_loop\.c$
-^lib/full-read\.c$
-^lib/imaxtostr\.c$
-^lib/mempcpy\.c$
-^lib/memset\.c$
-^lib/offtostr\.c$
-^lib/regcomp\.c$
-^lib/regex_internal\.c$
-^lib/regexec\.c$
-^lib/safe-write\.c$
-^lib/strtoll\.c$
-^lib/strtoul\.c$
-^lib/strtoull\.c$
-^lib/strtoumax\.c$
-^lib/umaxtostr\.c$
-^lib/xstrtold\.c$
-^lib/xstrtoul\.c$
-^src/false\.c$
-^src/lbracket\.c$
-^src/ls-dir\.c$
-^src/ls-ls\.c$
-^src/ls-vdir\.c$
-^src/rand-isaac\.c$
-^src/tac-pipe\.c$
diff --git a/.x-sc_space_tab b/.x-sc_space_tab
deleted file mode 100644 (file)
index f52ebd0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-config(ure|\.(guess|sub))
-tests/pr
-lib/regex.c
-config-log
-tests/misc/nl
-po/de.po
-m4/lib-ld.m4
-m4/lib-prefix.m4
-m4/po.m4
-aclocal.m4
-src/c99-to-c89.diff
diff --git a/.x-sc_sun_os_names b/.x-sc_sun_os_names
deleted file mode 100644 (file)
index 3ffc52c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-config-log
-build-aux/config.guess
diff --git a/.x-sc_trailing_blank b/.x-sc_trailing_blank
deleted file mode 100644 (file)
index 92571d6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^tests/pr/
diff --git a/.x-sc_unmarked_diagnostics b/.x-sc_unmarked_diagnostics
deleted file mode 100644 (file)
index aac8984..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-^lib/xstrtol\.h$
-^build-aux/cvsu$
diff --git a/.x-sc_useless_cpp_parens b/.x-sc_useless_cpp_parens
deleted file mode 100644 (file)
index 01eb4b4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-^build-aux/config.guess
-^configure
-^lib/alloca.c
-^lib/fts.c
-^lib/getdate.c
-^lib/getloadavg.c
-^lib/gettext.h
-^lib/getusershell.c
-^lib/mbswidth.c
-^lib/strtod.c
-^lib/xstrtol.c
-^m4/
-^tests/misc/pwd-unreadable-parent
index 71bc510d86bb57db59203877a55fdd25d45ab694..49a2eae93a610e55299e22145295f5fde83f6ffe 100644 (file)
@@ -75,7 +75,7 @@ struct utimbuf
    Return 0 on success, -1 (setting errno) on failure.  */
 
 int
-futimens (int fd ATTRIBUTE_UNUSED,
+gl_futimens (int fd ATTRIBUTE_UNUSED,
          char const *file, struct timespec const timespec[2])
 {
   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
 int
 utimens (char const *file, struct timespec const timespec[2])
 {
-  return futimens (-1, file, timespec);
+  return gl_futimens (-1, file, timespec);
 }
index 0097aaaf7524d00906674963c7c1a7905e457a08..169521da73ac357719dc00032aed6e38d2883450 100644 (file)
@@ -1,3 +1,3 @@
 #include <time.h>
-int futimens (int, char const *, struct timespec const [2]);
+int gl_futimens (int, char const *, struct timespec const [2]);
 int utimens (char const *, struct timespec const [2]);
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644 (file)
index 0000000..34d4a2b
--- /dev/null
@@ -0,0 +1,3 @@
+targettype x86 package coreutils
+  +^/bin/uname$
+  prereq -glibc-x86
diff --git a/packaging/coreutils.manifest b/packaging/coreutils.manifest
new file mode 100644 (file)
index 0000000..67da90f
--- /dev/null
@@ -0,0 +1,10 @@
+<manifest>
+        <request>
+                <domain name="_"/>
+        </request>
+        <assign>
+                <filesystem path="/bin/*" exec_label="none" />
+                <filesystem path="/usr/bin/*" exec_label="none" />
+                <filesystem path="/usr/sbin/*" exec_label="none" />
+        </assign>
+</manifest>
diff --git a/packaging/coreutils.spec b/packaging/coreutils.spec
new file mode 100644 (file)
index 0000000..1fa1379
--- /dev/null
@@ -0,0 +1,151 @@
+%define _unpackaged_files_terminate_build 0
+
+%define run_tests 0
+%if %{run_tests}
+    # check is defined off at .rpmmacros file.
+    %undefine check
+%endif
+
+Summary:       The GNU core utilities: a set of tools commonly used in shell scripts
+
+Name:          coreutils
+Version:       6.9
+Release:       14
+License:       GPL-2.0+
+Group:         System Environment/Base
+Url:           http://www.gnu.org/software/coreutils/
+Source0:       coreutils-%{version}.tar.bz2
+Source1:       mktemp-1.5.tar.gz
+Source1001:    %{name}.manifest
+
+BuildRequires: autoconf >= 2.58
+BuildRequires: automake >= 1.10
+BuildRequires: gettext findutils
+
+Provides:      fileutils sh-utils stat textutils mktemp
+Provides:      coreutils
+Obsoletes:     coreutils
+
+%description
+These are the GNU core utilities.  This package is the combination of
+the old GNU fileutils, sh-utils, and textutils packages.
+
+%prep
+%setup -q -b 1 -n coreutils-%{version}
+
+%build
+cp %{SOURCE1001} .
+
+export CFLAGS=" -fpie"
+export LDFLAGS=" -pie"
+
+pushd ../mktemp-1.5
+%configure
+make
+popd
+
+%configure
+make
+
+%check
+%if %{run_tests}
+    %__make check || exit 0
+    chmod 755 ./run_test.sh
+    ./run_test.sh %{name} %{version}
+%endif
+
+%install
+
+pushd ../mktemp-1.5
+make bindir=%{buildroot}/bin mandir=%{buildroot}%{_mandir} install
+popd
+
+%make_install
+
+# man pages are not installed with make install
+make mandir=%{buildroot}%{_mandir} install-man
+
+# let be compatible with old fileutils, sh-utils and textutils packages :
+mkdir -p %{buildroot}{/bin,%{_bindir},%{_sbindir},/sbin}
+for f in cat chgrp chmod chown cp date dd df echo link ln ls mkdir mknod mv pwd rm rmdir sleep sync touch true uname unlink
+do
+    mv %{buildroot}{%{_bindir},/bin}/$f
+done
+
+# chroot was in /usr/sbin :
+mv %{buildroot}{%{_bindir},%{_sbindir}}/chroot
+
+# These come from util-linux and/or procps.
+for i in hostname uptime kill ; do
+    rm %{buildroot}{%{_bindir}/$i,%{_mandir}/man1/$i.1}
+done
+
+# Use hard links instead of symbolic links for LC_TIME files (bug #246729).
+find %{buildroot}%{_datadir}/locale -type l | \
+(while read link
+ do
+   target=$(readlink "$link")
+   rm -f "$link"
+   ln "$(dirname "$link")/$target" "$link"
+ done)
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%docs_package
+
+%files
+%manifest %{name}.manifest
+%license COPYING
+/bin/cat
+/bin/chgrp
+/bin/chmod
+/bin/chown
+/bin/cp
+/bin/date
+/bin/dd
+/bin/df
+/bin/echo
+/bin/ln
+/bin/ls
+/bin/mkdir
+/bin/mknod
+/bin/mktemp
+/bin/mv
+/bin/pwd
+/bin/rm
+/bin/rmdir
+/bin/sleep
+/bin/sync
+/bin/touch
+/bin/true
+/bin/uname
+%{_bindir}/basename
+%{_bindir}/cksum
+%{_bindir}/cut
+%{_bindir}/dirname
+%{_bindir}/du
+%{_bindir}/env
+%{_bindir}/expr
+%{_bindir}/head
+%{_bindir}/id
+%{_bindir}/install
+%{_bindir}/md5sum
+%{_bindir}/nice
+%{_bindir}/od
+%{_bindir}/printenv
+%{_bindir}/printf
+%{_bindir}/readlink
+%{_bindir}/seq
+%{_bindir}/sort
+%{_bindir}/stat
+%{_bindir}/tac
+%{_bindir}/tail
+%{_bindir}/tee
+%{_bindir}/test
+%{_bindir}/tr
+%{_bindir}/uniq
+%{_bindir}/wc
+%{_bindir}/who
+%{_bindir}/whoami
+%{_sbindir}/chroot
diff --git a/packaging/mktemp-1.5.tar.gz b/packaging/mktemp-1.5.tar.gz
new file mode 100644 (file)
index 0000000..0e1249f
Binary files /dev/null and b/packaging/mktemp-1.5.tar.gz differ
diff --git a/run_test.sh b/run_test.sh
new file mode 100755 (executable)
index 0000000..c781b04
--- /dev/null
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+PACKAGE_NAME=$1
+PACKAGE_VERSION=$2
+
+TEST_LOG="/tmp/${PACKAGE_NAME}_test"
+export TEST_LOG
+
+# Color
+Color_Off='\e[0m'       # Text Reset
+
+# Regular Colors
+Red='\e[0;31m'          # Red
+Green='\e[0;32m'        # Green
+Cyan='\e[0;36m'         # Cyank
+
+# Bold
+BWhite='\e[1;37m'       # White
+
+result_check() {
+    test_case=$1
+    if [ $? -eq 0 ] 
+    then
+        echo -e "${Green}PASS${Color_Off}: $test_case"
+        echo "TEST: PASS: $test_case" >> ${TEST_LOG}
+    else
+        echo -e "${Red}FAIL${Color_Off}: $test_case"
+        echo -e "TEST: FAIL: $test_case" >> ${TEST_LOG}
+    fi
+}
+
+skip_test() {
+    test_case=$1
+    echo -e "${Cyan}SKIP${Color_Off}: $test_case"
+    echo "TEST: SKIP: $test_case" >> ${TEST_LOG}
+}
+
+TOTAL_CNT=`grep "TEST:" ${TEST_LOG} | wc -l`
+PASS_CNT=`grep "PASS:" ${TEST_LOG} | wc -l`
+FAIL_CNT=`grep "FAIL:" ${TEST_LOG} | wc -l`
+SKIP_CNT=`grep "SKIP:" ${TEST_LOG} | wc -l`
+
+
+br='==================='; br=$br$br$br$br;
+
+echo -e "${Green}$br ${Color_Off}"
+echo -e "${Green}Test sheet summary for ${PACKAGE_NAME} ${PACKAGE_VERSION}${Color_Off}"
+echo -e "${Green}$br ${Color_Off}"
+echo -e "#${BWhite} TOTAL: $TOTAL_CNT ${Color_Off}"
+echo -e "#${Green} PASS${Color_Off} : $PASS_CNT"
+echo -e "#${Red} FAIL${Color_Off} : $FAIL_CNT"
+echo -e "#${Cyan} SKIP${Color_Off} : $SKIP_CNT"
+echo -e "${Green}$br ${Color_Off}"
+
+rm -f ${TEST_LOG}
+exit 0
+
index 4bdb75cbb9707b2b2667a520f08ac2e13e7aa034..b42924b43560e93acabf032d2c3e21ea2845ba3c 100644 (file)
@@ -53,6 +53,7 @@
 #include "utimens.h"
 #include "xreadlink.h"
 #include "yesno.h"
+#include "smack.h"
 
 #ifndef HAVE_FCHOWN
 # define HAVE_FCHOWN false
@@ -518,7 +519,7 @@ copy_reg (char const *src_name, char const *dst_name,
       timespec[0] = get_stat_atime (src_sb);
       timespec[1] = get_stat_mtime (src_sb);
 
-      if (futimens (dest_desc, dst_name, timespec) != 0)
+      if (gl_futimens (dest_desc, dst_name, timespec) != 0)
        {
          error (0, errno, _("preserving times for %s"), quote (dst_name));
          if (x->require_preserve)
@@ -570,6 +571,30 @@ copy_reg (char const *src_name, char const *dst_name,
        }
     }
 
+  if (x->preserve_context)
+    {
+      struct smack_attrs src_context;
+      struct smack_attrs dst_context;
+      memset (&src_context, 0, sizeof(src_context));
+      memset (&dst_context, 0, sizeof(dst_context));
+
+      if (smack_of_fd (source_desc, &src_context) < 0)
+        {
+          if (x->require_preserve)
+            ; //fail silently now // return_val = false;
+        }
+      else if (smack_of_fd (dest_desc, &dst_context) < 0)
+        {
+          if (x->require_preserve)
+            ; //fail silently now // return_val = false;
+        }
+      else if (smack_differs (&src_context, &dst_context))
+        {
+          if (smack_to_fd (dest_desc, &src_context) < 0 && x->require_preserve)
+            ; //fail silently now // return_val = false;
+        }
+    }
+
 close_src_and_dst_desc:
   if (close (dest_desc) < 0)
     {
@@ -1891,6 +1916,30 @@ copy_internal (char const *src_name, char const *dst_name,
        }
     }
 
+  if (x->preserve_context)
+    {
+      struct smack_attrs src_context;
+      struct smack_attrs dst_context;
+      memset (&src_context, 0, sizeof(src_context));
+      memset (&dst_context, 0, sizeof(dst_context));
+
+      if (smack_of_file (src_name, &src_context) < 0)
+        {
+          if (x->require_preserve)
+            ; //fail silently now // return false;
+        }
+      else if (smack_of_file (dst_name, &dst_context) < 0)
+        {
+          if (x->require_preserve)
+            ; //fail silently now // return false;
+        }
+      else if (smack_differs (&src_context, &dst_context))
+        {
+          if (smack_to_file (dst_name, &src_context) < 0 && x->require_preserve)
+            ; //fail silently now // return false;
+        }
+    }
+
   return delayed_ok;
 
 un_backup:
index c815baf64f8c0f0bb11ee2000f293c6e450e8e97..0d0e69e4700a4acdac56ddf93d2fa6e4c481fceb 100644 (file)
@@ -128,6 +128,10 @@ struct cp_options
   bool preserve_mode;
   bool preserve_timestamps;
 
+  /* If true, attempt to give the copies the original files'
+     security context. */
+  bool preserve_context;
+
   /* Enabled for mv, and for cp by the --preserve=links option.
      If true, attempt to preserve in the destination files any
      logical hard links between the source files.  If used with cp's
index 5759e0d07f2fd9278ce25d6b3a19662581b73b95..3f5d30f7d807ce8723618bf6311be6f0c3626a85 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -35,6 +35,7 @@
 #include "stat-time.h"
 #include "utimens.h"
 #include "acl.h"
+#include "smack.h"
 
 #define ASSIGN_BASENAME_STRDUPA(Dest, File_name)       \
   do                                                   \
@@ -191,7 +192,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
   -p                           same as --preserve=mode,ownership,timestamps\n\
       --preserve[=ATTR_LIST]   preserve the specified attributes (default:\n\
                                  mode,ownership,timestamps), if possible\n\
-                                 additional attributes: links, all\n\
+                                 additional attributes: links, context, all\n\
 "), stdout);
       fputs (_("\
       --no-preserve=ATTR_LIST  don't preserve the specified attributes\n\
@@ -317,6 +318,29 @@ re_protect (char const *const_dst_name, size_t src_offset,
            }
        }
 
+      if (x->preserve_context)
+        {
+          struct smack_attrs src_context;
+          struct smack_attrs dst_context;
+          memset (&src_context, 0, sizeof(src_context));
+          memset (&dst_context, 0, sizeof(dst_context));
+
+          if (smack_of_file (src_name, &src_context) < 0 ||
+              smack_of_file (dst_name, &dst_context) < 0)
+            {
+             ; //error (0, errno, _("failed to preserve context for %s"),
+               //     quote (dst_name));
+             //return false;
+            }
+          if (smack_differs (&src_context, &dst_context) &&
+              smack_to_file (dst_name, &src_context) < 0)
+            {
+             ; //error (0, errno, _("failed to preserve context for %s"),
+               //     quote (dst_name));
+             //return false;
+            }
+        }
+
       if (x->preserve_ownership)
        {
          if (chown (dst_name, src_sb.st_uid, src_sb.st_gid) != 0
@@ -749,6 +773,7 @@ cp_option_init (struct cp_options *x)
   x->preserve_links = false;
   x->preserve_mode = false;
   x->preserve_timestamps = false;
+  x->preserve_context = false;
 
   x->require_preserve = false;
   x->recursive = false;
@@ -777,18 +802,19 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off)
       PRESERVE_TIMESTAMPS,
       PRESERVE_OWNERSHIP,
       PRESERVE_LINK,
+      PRESERVE_CONTEXT,
       PRESERVE_ALL
     };
   static enum File_attribute const preserve_vals[] =
     {
       PRESERVE_MODE, PRESERVE_TIMESTAMPS,
-      PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_ALL
+      PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_CONTEXT, PRESERVE_ALL
     };
   /* Valid arguments to the `--preserve' option. */
   static char const* const preserve_args[] =
     {
       "mode", "timestamps",
-      "ownership", "links", "all", NULL
+      "ownership", "links", "context", "all", NULL
     };
   ARGMATCH_VERIFY (preserve_args, preserve_vals);
 
@@ -824,11 +850,16 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off)
          x->preserve_links = on_off;
          break;
 
+       case PRESERVE_CONTEXT:
+         x->preserve_context = on_off;
+         break;
+
        case PRESERVE_ALL:
          x->preserve_mode = on_off;
          x->preserve_timestamps = on_off;
          x->preserve_ownership = on_off;
          x->preserve_links = on_off;
+         x->preserve_context = on_off;
          break;
 
        default:
@@ -885,6 +916,8 @@ main (int argc, char **argv)
          x.preserve_ownership = true;
          x.preserve_mode = true;
          x.preserve_timestamps = true;
+          /* Context preservation may be draconian */
+         x.preserve_context = true;
          x.require_preserve = true;
          x.recursive = true;
          break;
index 7abb3e50ca7b295c645d16e5811fbd1005aa7a9a..f775341b7d9934f80902060359f8a264d1706a16 100644 (file)
--- a/src/id.c
+++ b/src/id.c
@@ -29,6 +29,7 @@
 #include "system.h"
 #include "error.h"
 #include "quote.h"
+#include "smack.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "id"
@@ -40,6 +41,7 @@ int getugroups ();
 static void print_user (uid_t uid);
 static void print_group (gid_t gid);
 static void print_group_list (const char *username);
+static void print_context (void);
 static void print_full_info (const char *username);
 
 /* The name this program was run with. */
@@ -52,11 +54,15 @@ static bool use_name = false;
 static uid_t ruid, euid;
 static gid_t rgid, egid;
 
+/* The security "context" to print. */
+static char context[SMACK_LABELLEN];
+
 /* True unless errors have been encountered.  */
 static bool ok = true;
 
 static struct option const longopts[] =
 {
+  {"context", no_argument, NULL, 'Z'},
   {"group", no_argument, NULL, 'g'},
   {"groups", no_argument, NULL, 'G'},
   {"name", no_argument, NULL, 'n'},
@@ -80,6 +86,7 @@ usage (int status)
 Print information for USERNAME, or the current user.\n\
 \n\
   -a              ignore, for compatibility with other versions\n\
+  -Z, --context   print only the security context\n\
   -g, --group     print only the effective group ID\n\
   -G, --groups    print all group IDs\n\
   -n, --name      print a name instead of a number, for -ugG\n\
@@ -102,6 +109,8 @@ main (int argc, char **argv)
 {
   int optc;
 
+  /* If true, output only the security context. -Z */
+  bool just_context = false;
   /* If true, output the list of all group IDs. -G */
   bool just_group_list = false;
   /* If true, output only the group ID(s). -g */
@@ -119,13 +128,16 @@ main (int argc, char **argv)
 
   atexit (close_stdout);
 
-  while ((optc = getopt_long (argc, argv, "agnruG", longopts, NULL)) != -1)
+  while ((optc = getopt_long (argc, argv, "agnruGZ", longopts, NULL)) != -1)
     {
       switch (optc)
        {
        case 'a':
          /* Ignore -a, for compatibility with SVR4.  */
          break;
+       case 'Z':
+         just_context = true;
+         break;
        case 'g':
          just_group = true;
          break;
@@ -148,8 +160,8 @@ main (int argc, char **argv)
        }
     }
 
-  if (just_user + just_group + just_group_list > 1)
-    error (EXIT_FAILURE, 0, _("cannot print only user and only group"));
+  if (just_user + just_group + just_group_list + just_context > 1)
+    error (EXIT_FAILURE, 0, _("cannot print multiple exclusive fields"));
 
   if (just_user + just_group + just_group_list == 0 && (use_real | use_name))
     error (EXIT_FAILURE, 0,
@@ -183,6 +195,8 @@ main (int argc, char **argv)
     print_group (use_real ? rgid : egid);
   else if (just_group_list)
     print_group_list (argv[optind]);
+  else if (just_context)
+    print_context ();
   else
     print_full_info (argv[optind]);
   putchar ('\n');
@@ -324,6 +338,18 @@ print_group_list (const char *username)
 #endif /* HAVE_GETGROUPS */
 }
 
+/* Print the security context. */
+
+static void
+print_context (void)
+{
+
+  if (smack_of_proc(-1, context, sizeof (context)) < 1 || strlen(context) < 1)
+    printf ("<secuirty context is unavailable>");
+  else
+    printf ("%s", context);
+}
+
 /* Print all of the info about the user's user and group IDs. */
 
 static void
@@ -385,4 +411,7 @@ print_full_info (const char *username)
     free (groups);
   }
 #endif /* HAVE_GETGROUPS */
+
+  if (smack_of_proc(-1, context, sizeof (context)) > 0 && strlen(context) > 0)
+    printf (" context=\"%s\"", context);
 }
index 04577518ceb133b305ad0214e85e7471b008222f..40165d8df439d3afa5f2eab2ff10a55e40b41aa2 100644 (file)
@@ -39,6 +39,7 @@
 #include "stat-time.h"
 #include "utimens.h"
 #include "xstrtol.h"
+#include "smack.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "install"
@@ -115,6 +116,9 @@ static mode_t dir_mode = DEFAULT_MODE;
    or S_ISGID bits.  */
 static mode_t dir_mode_bits = CHMOD_MODE_BITS;
 
+/* The security context to give all files. */
+static struct smack_attrs context;
+
 /* If true, strip executable files after copying them. */
 static bool strip_files;
 
@@ -124,6 +128,7 @@ static bool dir_arg;
 static struct option const long_options[] =
 {
   {"backup", optional_argument, NULL, 'b'},
+  {"context", required_argument, NULL, 'Z'},
   {"directory", no_argument, NULL, 'd'},
   {"group", required_argument, NULL, 'g'},
   {"mode", required_argument, NULL, 'm'},
@@ -155,6 +160,7 @@ cp_option_init (struct cp_options *x)
   x->preserve_links = false;
   x->preserve_mode = false;
   x->preserve_timestamps = false;
+  x->preserve_context = false;
   x->require_preserve = false;
   x->recursive = false;
   x->sparse_mode = SPARSE_AUTO;
@@ -243,7 +249,7 @@ main (int argc, char **argv)
      we'll actually use backup_suffix_string.  */
   backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
 
-  while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pt:TvS:", long_options,
+  while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pt:TvS:Z:", long_options,
                              NULL)) != -1)
     {
       switch (optc)
@@ -305,6 +311,10 @@ main (int argc, char **argv)
        case 'T':
          no_target_directory = true;
          break;
+       case 'Z':
+         if (optarg)
+           strncpy(context.attr, optarg, SMACK_LABELLEN);
+         break;
        case_GETOPT_HELP_CHAR;
        case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
        default:
@@ -520,6 +530,8 @@ change_attributes (char const *name)
     error (0, errno, _("cannot change ownership of %s"), quote (name));
   else if (chmod (name, mode) != 0)
     error (0, errno, _("cannot change permissions of %s"), quote (name));
+  else if (context.attr[0] && smack_to_file (name, &context) < 0)
+   ; // error (0, errno, _("cannot change security context of %s"), quote (name));
   else
     return true;
 
@@ -686,6 +698,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
   -t, --target-directory=DIRECTORY  copy all SOURCE arguments into DIRECTORY\n\
   -T, --no-target-directory  treat DEST as a normal file\n\
   -v, --verbose       print the name of each directory as it is created\n\
+  -Z, --context=CONTEXT  set the security context on all destination files\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
index 3d489008038c54ae0c451da7e12a4ef7761a6549..8517b4116f476a4081c4f88c6462bbe0a99d09c4 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
 #include "wcwidth.h"
 #include "xstrtol.h"
 #include "xreadlink.h"
+#include "smack.h"
 
 #define PROGRAM_NAME (ls_mode == LS_LS ? "ls" \
                      : (ls_mode == LS_MULTI_COL \
@@ -177,6 +178,9 @@ struct fileinfo
     /* For long listings, true if the file has an access control list.  */
     bool have_acl;
 #endif
+
+    /* Security context */
+    struct smack_attrs context;
   };
 
 #if USE_ACL
@@ -339,6 +343,7 @@ static int nlink_width;
 static int owner_width;
 static int group_width;
 static int author_width;
+static int context_width;
 static int major_device_number_width;
 static int minor_device_number_width;
 static int file_size_width;
@@ -434,6 +439,10 @@ static bool print_owner = true;
 
 static bool print_author;
 
+/* True means to display the security context.  */
+
+static bool print_context;
+
 /* True means to display group information.  -G and -o turn this off.  */
 
 static bool print_group = true;
@@ -1514,7 +1523,7 @@ decode_switches (int argc, char **argv)
   }
 
   while ((c = getopt_long (argc, argv,
-                          "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UX1",
+                          "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UXZ1",
                           long_options, NULL)) != -1)
     {
       switch (c)
@@ -1717,6 +1726,10 @@ decode_switches (int argc, char **argv)
          sort_type_specified = true;
          break;
 
+       case 'Z':
+          print_context = true;
+         break;
+
        case '1':
          /* -1 has no effect after -l.  */
          if (format != long_format)
@@ -2574,6 +2587,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
       /* Command line dereferences are already taken care of by the above
         assertion that the inode number is not yet known.  */
       || (print_inode && inode == NOT_AN_INODE_NUMBER)
+      || print_context
       || (format_needs_type
          && (type == unknown || command_line_arg
              /* --indicator-style=classify (aka -F)
@@ -2605,6 +2619,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
       switch (dereference)
        {
        case DEREF_ALWAYS:
+          err = smack_of_file_follow(absolute_name, &f->context);
          err = stat (absolute_name, &f->stat);
          break;
 
@@ -2613,6 +2628,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
          if (command_line_arg)
            {
              bool need_lstat;
+              err = smack_of_file_follow(absolute_name, &f->context);
              err = stat (absolute_name, &f->stat);
 
              if (dereference == DEREF_COMMAND_LINE_ARGUMENTS)
@@ -2631,6 +2647,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
            }
 
        default: /* DEREF_NEVER */
+          err = smack_of_file(absolute_name, &f->context);
          err = lstat (absolute_name, &f->stat);
          break;
        }
@@ -2738,6 +2755,13 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
            author_width = len;
        }
 
+      if (print_context)
+       {
+         int len = strlen (f->context.attr);
+         if (context_width < len)
+           context_width = len;
+       }
+
       {
        char buf[INT_BUFSIZE_BOUND (uintmax_t)];
        int len = strlen (umaxtostr (f->stat.st_nlink, buf));
@@ -3463,7 +3487,7 @@ print_long_format (const struct fileinfo *f)
 
   DIRED_INDENT ();
 
-  if (print_owner | print_group | print_author)
+  if (print_owner | print_group | print_author | print_context)
     {
       DIRED_FPUTS (buf, stdout, p - buf);
 
@@ -3476,6 +3500,9 @@ print_long_format (const struct fileinfo *f)
       if (print_author)
        format_user (f->stat.st_author, author_width, f->stat_ok);
 
+      if (print_context)
+        format_user_or_group(f->context.attr, 0, context_width);
+
       p = buf;
     }
 
@@ -3812,6 +3839,9 @@ print_file_name_and_frills (const struct fileinfo *f)
            human_readable (ST_NBLOCKS (f->stat), buf, human_output_opts,
                            ST_NBLOCKSIZE, output_block_size));
 
+  if (print_context)
+    printf ("%*s ", format == with_commas ? 0 : context_width, f->context);
+
   print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f), f->linkok,
                           f->stat_ok, f->filetype, NULL);
 
@@ -3975,6 +4005,9 @@ length_of_file_name_and_frills (const struct fileinfo *f)
                                          output_block_size))
                : block_size_width);
 
+  if (print_context)
+    len += 1 + (format == with_commas ? strlen (f->context.attr) : context_width);
+
   quote_name (NULL, f->name, filename_quoting_options, &name_width);
   len += name_width;
 
@@ -4403,6 +4436,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
   -w, --width=COLS           assume screen width instead of current value\n\
   -x                         list entries by lines instead of by columns\n\
   -X                         sort alphabetically by entry extension\n\
+  -Z                         print the security context\n\
   -1                         list one file per line\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
index 6fa0ac21d1cdb1fda4c4ccca8f529aacb07f683a..61ba5dc8295384581013d09435e594a67151350f 100644 (file)
@@ -29,6 +29,7 @@
 #include "modechange.h"
 #include "quote.h"
 #include "savewd.h"
+#include "smack.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "mkdir"
@@ -40,6 +41,7 @@ char *program_name;
 
 static struct option const longopts[] =
 {
+  {"context", required_argument, NULL, 'Z'},
   {"mode", required_argument, NULL, 'm'},
   {"parents", no_argument, NULL, 'p'},
   {"verbose", no_argument, NULL, 'v'},
@@ -65,9 +67,10 @@ Create the DIRECTORY(ies), if they do not already exist.\n\
 Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
       fputs (_("\
-  -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask\n\
-  -p, --parents     no error if existing, make parent directories as needed\n\
-  -v, --verbose     print a message for each created directory\n\
+  -Z, --context=CONTEXT  set security context\n\
+  -m, --mode=MODE      set file mode (as in chmod), not a=rwx - umask\n\
+  -p, --parents        no error if existing, make parent directories as needed\n\
+  -v, --verbose        print a message for each created directory\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
@@ -92,6 +95,9 @@ struct mkdir_options
   /* File mode bits affected by MODE.  */
   mode_t mode_bits;
 
+  /* Security context.  */
+  struct smack_attrs context;
+
   /* If not null, format to use when reporting newly made directories.  */
   char const *created_directory_format;
 };
@@ -101,6 +107,17 @@ static void
 announce_mkdir (char const *dir, void *options)
 {
   struct mkdir_options const *o = options;
+
+  if (o->context.attr[0]) {
+  char *sep = strrchr(dir, '/');
+  int res = 0;
+  if ((sep != NULL) && (strlen(sep) != strlen(dir)))
+    res = smack_to_file (sep + 1, &o->context);
+  else
+    res = smack_to_file (dir, &o->context);
+  if (res < 0)
+    ; // error (0, errno, _("setting directory context failed"));
+  }
   if (o->created_directory_format)
     error (0, 0, o->created_directory_format, quote (dir));
 }
@@ -144,6 +161,7 @@ main (int argc, char **argv)
   options.make_ancestor_function = NULL;
   options.mode = S_IRWXUGO;
   options.mode_bits = 0;
+  memset(&options.context, 0, sizeof(options.context));
   options.created_directory_format = NULL;
 
   initialize_main (&argc, &argv);
@@ -154,10 +172,14 @@ main (int argc, char **argv)
 
   atexit (close_stdout);
 
-  while ((optc = getopt_long (argc, argv, "pm:v", longopts, NULL)) != -1)
+  while ((optc = getopt_long (argc, argv, "Z:pm:v", longopts, NULL)) != -1)
     {
       switch (optc)
        {
+       case 'Z':
+         if (optarg)
+           strncpy(options.context.attr, optarg, SMACK_LABELLEN);
+         break;
        case 'p':
          options.make_ancestor_function = make_ancestor;
          break;
index d329b79b8bad61137b23d99d2eaf8d1d5d0e088c..e1d9283c7f13a50c75b10fdf4920ba18bffabf2a 100644 (file)
@@ -26,6 +26,7 @@
 #include "error.h"
 #include "modechange.h"
 #include "quote.h"
+#include "smack.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "mkfifo"
@@ -37,6 +38,7 @@ char *program_name;
 
 static struct option const longopts[] =
 {
+  {"context", required_argument, NULL, 'Z'},
   {"mode", required_argument, NULL, 'm'},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
@@ -60,7 +62,10 @@ Create named pipes (FIFOs) with the given NAMEs.\n\
 Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
       fputs (_("\
-  -m, --mode=MODE   set file permission bits to MODE, not a=rw - umask\n\
+  -Z, --context=CONTEXT   set security context to CONTEXT\n\
+"), stdout);
+      fputs (_("\
+  -m, --mode=MODE         set file permission bits to MODE, not a=rw - umask\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
@@ -73,6 +78,8 @@ int
 main (int argc, char **argv)
 {
   mode_t newmode;
+  struct smack_attrs specified_context;
+  memset(&specified_context, 0, sizeof(specified_context));
   char const *specified_mode = NULL;
   int exit_status = EXIT_SUCCESS;
   int optc;
@@ -85,10 +92,14 @@ main (int argc, char **argv)
 
   atexit (close_stdout);
 
-  while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1)
+  while ((optc = getopt_long (argc, argv, "Z:m:", longopts, NULL)) != -1)
     {
       switch (optc)
        {
+       case 'Z':
+         if (optarg)
+           strncpy(specified_context.attr, optarg, SMACK_LABELLEN);
+         break;
        case 'm':
          specified_mode = optarg;
          break;
@@ -119,11 +130,17 @@ main (int argc, char **argv)
     }
 
   for (; optind < argc; ++optind)
-    if (mkfifo (argv[optind], newmode) != 0)
-      {
-       error (0, errno, _("cannot create fifo %s"), quote (argv[optind]));
-       exit_status = EXIT_FAILURE;
-      }
+    {
+      if (mkfifo (argv[optind], newmode) != 0)
+        {
+         error (0, errno, _("cannot create fifo %s"), quote (argv[optind]));
+         exit_status = EXIT_FAILURE;
+        }
+      if (specified_context.attr[0] &&
+          smack_to_file(argv[optind], &specified_context) < 0)
+       ;// error (0, errno, _("context assignment of %s to %s failed"),
+       //        argv[optind], quote (specified_context));
+    }
 
   exit (exit_status);
 }
index 43a1b9dcc79290ba6291acd2b96e73355f94794c..ff9b0affc27534d388c533a04971b67764455895 100644 (file)
@@ -27,6 +27,7 @@
 #include "modechange.h"
 #include "quote.h"
 #include "xstrtol.h"
+#include "smack.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "mknod"
@@ -38,6 +39,7 @@ char *program_name;
 
 static struct option const longopts[] =
 {
+  {"context", required_argument, NULL, 'Z'},
   {"mode", required_argument, NULL, 'm'},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
@@ -62,7 +64,10 @@ Create the special file NAME of the given TYPE.\n\
 Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
       fputs (_("\
-  -m, --mode=MODE   set file permission bits to MODE, not a=rw - umask\n\
+  -Z, --context=CONTEXT set file security context to CONTEXT\n\
+"), stdout);
+      fputs (_("\
+  -m, --mode=MODE       set file permission bits to MODE, not a=rw - umask\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
@@ -88,6 +93,8 @@ int
 main (int argc, char **argv)
 {
   mode_t newmode;
+  struct smack_attrs specified_context;
+  memset(&specified_context, 0, sizeof(specified_context));
   char const *specified_mode = NULL;
   int optc;
   int expected_operands;
@@ -101,10 +108,14 @@ main (int argc, char **argv)
 
   atexit (close_stdout);
 
-  while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1)
+  while ((optc = getopt_long (argc, argv, "Z:m:", longopts, NULL)) != -1)
     {
       switch (optc)
        {
+       case 'Z':
+         if (optarg)
+           strncpy(specified_context.attr, optarg, SMACK_LABELLEN);
+         break;
        case 'm':
          specified_mode = optarg;
          break;
@@ -217,5 +228,9 @@ main (int argc, char **argv)
       usage (EXIT_FAILURE);
     }
 
+  if (specified_context.attr[0] && smack_to_file (argv[optind], &specified_context) < 0)
+    ; //error (0, errno, _("context assignment to %s failed"),
+    //       quote (specified_context));
+
   exit (EXIT_SUCCESS);
 }
index 1d1dddab89c6c8ec2d206ca95c7b888ba29814e0..aca3ebd39d63dc3ea28fe926b122b8ed573897ea 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -32,6 +32,7 @@
 #include "filenamecat.h"
 #include "quote.h"
 #include "remove.h"
+#include "smack.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "mv"
@@ -126,6 +127,7 @@ cp_option_init (struct cp_options *x)
   x->preserve_links = true;
   x->preserve_mode = true;
   x->preserve_timestamps = true;
+  x->preserve_context = true;
   x->require_preserve = false;  /* FIXME: maybe make this an option */
   x->recursive = true;
   x->sparse_mode = SPARSE_AUTO;  /* FIXME: maybe make this an option */
diff --git a/src/smack.h b/src/smack.h
new file mode 100644 (file)
index 0000000..731ce70
--- /dev/null
@@ -0,0 +1,276 @@
+/* smack.h - Simplified Mandatory Access Control Kernel
+
+   Copyright (C) 2010 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 2, 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+   Written by Casey Schaufler.  */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/xattr.h>
+#include <unistd.h>
+
+#define SMACK_PATHTEXTSIZE 80
+#define SMACK_LABELLEN 256
+#define SMACK_PROC_FMT "/proc/%s/attr/current"
+#define SMACK_CHECK_PATH "/smack/load"
+#define SMACK_ATTRNAME "security.SMACK64"
+#define SMACK_EXECNAME "security.SMACK64EXEC"
+#define SMACK_MMAPNAME "security.SMACK64MMAP"
+#define SMACK_TRANSMUTENAME "security.SMACK64TRANSMUTE"
+#define SMACK_TRANSMUTETRUE "TRUE"
+
+struct smack_attrs
+{
+  char attr[SMACK_LABELLEN];
+  char exec[SMACK_LABELLEN];
+  char mmap[SMACK_LABELLEN];
+  int transmute;
+};
+
+static inline int
+smack_enabled(void)
+{
+  int i;
+  struct stat buf;
+
+  i = stat(SMACK_CHECK_PATH, &buf);
+
+  if (i < 0)
+    return 0;
+
+  return 1;
+}
+
+static inline bool
+smack_differs(const struct smack_attrs *smack1,
+              const struct smack_attrs *smack2)
+{
+  if (strcmp(smack1->attr, smack2->attr))
+    return 1;
+
+  if (strcmp(smack1->exec, smack2->exec))
+    return 1;
+
+  if (strcmp(smack1->mmap, smack2->mmap))
+    return 1;
+
+  if (smack1->transmute != smack2->transmute)
+    return 1;
+
+  return 0;
+}
+
+static inline int
+smack_of_file(const char *path, struct smack_attrs *result)
+{
+  int ret, i;
+  int rlen = SMACK_LABELLEN;
+  char buffer[rlen];
+
+  i = lgetxattr(path, SMACK_ATTRNAME, result->attr, rlen);
+  if (i < 0)
+    return i;
+
+  if (i < rlen)
+    result->attr[i] = '\0';
+
+  ret = i;
+
+  i = lgetxattr(path, SMACK_EXECNAME, result->exec, rlen);
+  if (i >= 0 && i < rlen)
+    result->exec[i] = '\0';
+
+  i = lgetxattr(path, SMACK_MMAPNAME, result->mmap, rlen);
+  if (i >= 0 && i < rlen)
+    result->mmap[i] = '\0';
+
+  i = getxattr(path, SMACK_TRANSMUTENAME, buffer, rlen);
+  if (i >= 0 && i < rlen && strncmp(buffer, SMACK_TRANSMUTETRUE, i) == 0)
+    result->transmute = 1;
+
+  return ret;
+}
+
+static inline int
+smack_of_file_follow(const char *path, struct smack_attrs *result)
+{
+  int ret, i;
+  int rlen = SMACK_LABELLEN;
+  char buffer[rlen];
+
+  i = getxattr(path, SMACK_ATTRNAME, result->attr, rlen);
+  if (i < 0)
+    return i;
+
+  if (i < rlen)
+    result->attr[i] = '\0';
+
+  ret = i;
+
+  i = getxattr(path, SMACK_EXECNAME, result->exec, rlen);
+  if (i >= 0 && i < rlen)
+    result->exec[i] = '\0';
+
+  i = getxattr(path, SMACK_MMAPNAME, result->mmap, rlen);
+  if (i >= 0 && i < rlen)
+    result->mmap[i] = '\0';
+
+  i = getxattr(path, SMACK_TRANSMUTENAME, buffer, rlen);
+  if (i >= 0 && i < rlen && strncmp(buffer, SMACK_TRANSMUTETRUE, i) == 0)
+    result->transmute = 1;
+
+  return ret;
+}
+
+static inline int
+smack_of_fd(int fd, struct smack_attrs *result)
+{
+  int ret, i;
+  int rlen = SMACK_LABELLEN;
+  char buffer[rlen];
+
+  i = fgetxattr(fd, SMACK_ATTRNAME, result->attr, rlen);
+  if (i < 0)
+    return i;
+
+  if (i < rlen)
+    result->attr[i] = '\0';
+
+  ret = i;
+
+  i = fgetxattr(fd, SMACK_EXECNAME, result->exec, rlen);
+  if (i >= 0 && i < rlen)
+    result->exec[i] = '\0';
+
+  i = fgetxattr(fd, SMACK_MMAPNAME, result->mmap, rlen);
+  if (i >= 0 && i < rlen)
+    result->mmap[i] = '\0';
+
+  i = fgetxattr(fd, SMACK_TRANSMUTENAME, buffer, rlen);
+  if (i >= 0 && i < rlen && strncmp(buffer, SMACK_TRANSMUTETRUE, i) == 0)
+    result->transmute = 1;
+
+  return ret;
+}
+
+static inline int
+smack_to_fd(int fd, const struct smack_attrs *smack)
+{
+  int ret;
+
+  if (smack->attr[0])
+    {
+      ret = fsetxattr(fd, SMACK_ATTRNAME, smack->attr, strlen(smack->attr), 0);
+      if (ret < 0)
+        return ret;
+    }
+
+  if (smack->exec[0])
+    {
+      ret = fsetxattr(fd, SMACK_EXECNAME, smack->exec, strlen(smack->exec), 0);
+      if (ret < 0)
+        return ret;
+    }
+
+  if (smack->mmap[0])
+    {
+      ret = fsetxattr(fd, SMACK_MMAPNAME, smack->mmap, strlen(smack->mmap), 0);
+      if (ret < 0)
+        return ret;
+    }
+
+  if (smack->transmute)
+    {
+      ret = fsetxattr(fd, SMACK_TRANSMUTENAME, SMACK_TRANSMUTETRUE,
+                      strlen(SMACK_TRANSMUTETRUE), 0);
+      if (ret < 0)
+        return ret;
+    }
+
+  return 0;
+}
+
+static inline int
+smack_to_file(const char *path, const struct smack_attrs *smack)
+{
+  int ret;
+
+  if (smack->attr[0])
+    {
+      ret = lsetxattr(path, SMACK_ATTRNAME, smack->attr, strlen(smack->attr), 0);
+      if (ret < 0)
+        return ret;
+    }
+
+  if (smack->exec[0])
+    {
+      ret = lsetxattr(path, SMACK_EXECNAME, smack->exec, strlen(smack->exec), 0);
+      if (ret < 0)
+        return ret;
+    }
+
+  if (smack->mmap[0])
+    {
+      ret = lsetxattr(path, SMACK_MMAPNAME, smack->mmap, strlen(smack->mmap), 0);
+      if (ret < 0)
+        return ret;
+    }
+
+  if (smack->transmute)
+    {
+      ret = lsetxattr(path, SMACK_TRANSMUTENAME, SMACK_TRANSMUTETRUE,
+                      strlen(SMACK_TRANSMUTETRUE), 0);
+      if (ret < 0)
+        return ret;
+    }
+
+  return 0;
+}
+
+static inline int
+smack_of_proc(pid_t pid, char *result, int rlen)
+{
+  int fd;
+  int red;
+  char *cp = "self";
+  char pidtext[SMACK_PATHTEXTSIZE];
+  char path[SMACK_PATHTEXTSIZE];
+
+  if (pid > 0)
+    {
+      sprintf(pidtext, "%d", pid);
+      cp = pidtext;
+    }
+
+  if (strlen(cp) + strlen(SMACK_PROC_FMT) >= SMACK_PATHTEXTSIZE)
+    return -1;
+
+  sprintf(path, SMACK_PROC_FMT, cp);
+  fd = open(path, O_RDONLY);
+  if (fd < 0)
+    return fd;
+
+  red = read(fd, result, rlen);
+  close(fd);
+
+  if (red >= 0 && red < rlen)
+    result[red] = '\0';
+  if ((cp = index (result, '\n')) != NULL)
+    *cp = '\0';
+
+  return strlen (result);
+}
index ca84236775855f94b872d8dc9996df6494e28152..c7769b42da5649007ab3673e93cf4fdc566385bd 100644 (file)
@@ -68,6 +68,7 @@
 #include "stat-time.h"
 #include "strftime.h"
 #include "xreadlink.h"
+#include "smack.h"
 
 #define alignof(type) offsetof (struct { char c; type x; }, x)
 
@@ -270,6 +271,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "squashfs";
     case S_MAGIC_SYSFS: /* 0x62656572 */
       return "sysfs";
+    case S_MAGIC_SMACK: /* 0x43415D53 */
+      return "smack";
 # elif __GNU__
     case FSTYPE_UFS:
       return "ufs";
@@ -595,6 +598,15 @@ print_stat (char *pformat, size_t prefix_len, char m,
       else
        out_uint (pformat, prefix_len, statbuf->st_ctime);
       break;
+    case 'C':
+      {
+       struct smack_attrs context;
+       memset(&context, 0, sizeof(context));
+
+        if (smack_of_file(filename, &context) > 0)
+          out_string(pformat, prefix_len, context.attr);
+      }
+      break;
     default:
       fputc ('?', stdout);
       break;
@@ -855,6 +867,7 @@ The valid format sequences for files (without --file-system):\n\
   %B   The size in bytes of each block reported by %b\n\
 "), stdout);
       fputs (_("\
+  %C   Security context\n\
   %d   Device number in decimal\n\
   %D   Device number in hex\n\
   %f   Raw mode in hex\n\
index a79c26d97ec71c2e5cee35139ac7dad39fe9ae4c..91e754b66831e59a44d32c895e84da37d05f9eab 100644 (file)
@@ -182,7 +182,7 @@ touch (const char *file)
       t = timespec;
     }
 
-  ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
+  ok = (gl_futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
 
   if (fd == STDIN_FILENO)
     {
index 9628757deec8603c82185ef6a21f7d0c9393b041..026701ed6bd4a67569bb0191cc9a1a2ee53e63f3 100644 (file)
@@ -550,6 +550,7 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 $(RECURSIVE_TARGETS):
+       @TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; rm -f $$TEST_LOG;
        @failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
@@ -567,14 +568,15 @@ $(RECURSIVE_TARGETS):
          else \
            local_target="$$target"; \
          fi; \
-         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target); \
        done; \
        if test "$$dot_seen" = "no"; then \
-         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-       fi; test -z "$$fail"
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am"; \
+       fi; \
+       test -z "$$fail"
 
 $(RECURSIVE_CLEAN_TARGETS):
+       @TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; rm -f $$TEST_LOG;
        @failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
@@ -601,9 +603,9 @@ $(RECURSIVE_CLEAN_TARGETS):
          else \
            local_target="$$target"; \
          fi; \
-         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done && test -z "$$fail"
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target); \
+       done; \
+    test -z "$$fail"
 tags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
@@ -676,6 +678,7 @@ distclean-tags:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -693,6 +696,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -705,11 +709,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+               echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 7afc0a009e72d0dfeea70424c825501deb371daf..26e4f165eea8354f77dc4130989cb9bf5d21a562 100644 (file)
@@ -526,6 +526,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -543,6 +544,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -555,11 +557,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index a3bea9db0a03b4281d570c8bfb0abe26be323ab5..0fda1970ee985fc8562a22ebd3ab4c1042a27117 100644 (file)
@@ -528,6 +528,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -545,6 +546,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -557,11 +559,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 34b3952011d67b606b3b59ce467493c314d2f692..9ed58549138b598625377abdb3003732571394b2 100755 (executable)
@@ -46,7 +46,8 @@ fi
 fail=0
 
 # This must exit nonzero.
-chmod -R o=r d >/dev/null 2>out && fail=1
+chmod -R o=r d >/dev/null 2>out1 && fail=1
+sed -r 's/^(\/.*\/)*(chmod:.*)/\2/' out1 > out
 
 cat <<\EOF > exp
 chmod: `d/no-x': Permission denied
index fb774f7dee11b4be6a24db12c3e7c2016c3e4016..1275d16eb8b111a2109ae7731eece881871d9989 100644 (file)
@@ -523,6 +523,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -540,6 +541,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -552,11 +554,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index e3da3ebe60d392cf6db1296f48235c1727e27a08..9dab74e60be80e1da5c15cae46412453eb9cc11c 100755 (executable)
@@ -48,7 +48,8 @@ set _ `ls -ldo dangle`; shift; user=$3
 
 # With 5.2.1 and earlier, this command would mistakenly succeed.
 chown --dereference $user dangle 2> out1 && fail=1
-sed 's/: [^:]*$//' out1 > out
+sed 's/: [^:]*$//' out1 > out2
+sed -r 's/^(\/.*\/)*(.*)/\2/' out2 > out
 
 cat <<\EOF > exp || fail=1
 chown: cannot dereference `dangle'
index 4f8fe4f7f4e3b700218b9548b900815b281a9704..6a7a72b689acf4746683dca05bc4ae2906743db2 100755 (executable)
@@ -67,6 +67,10 @@ echo '==== test -RLh' >> out
 chown -RLh --preserve-root `id -u` d >> out 2>&1 && fail=1
 chgrp -RLh --preserve-root `id -g` d >> out 2>&1 && fail=1
 
+sed -r 's/^(\/.*\/)*(chown:.*)/\2/' out > out1
+sed -r 's/^(\/.*\/)*(chgrp:.*)/\2/' out1 > out2
+sed -r 's/^(\/.*\/)*(chmod:.*)/\2/' out2 > out
+
 cat <<\EOF > exp || fail=1
 chown: it is dangerous to operate recursively on `/'
 chown: use --no-preserve-root to override this failsafe
index f87e056ad95ff8a1e0ac003306e0b15615a310f6..5f5673862f44e307f89733f04b6b59be23bc6abe 100644 (file)
@@ -553,6 +553,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -570,6 +571,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -582,11 +584,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index b4f90c881f18ba2b87d41f1f4b0db12f72af130e..92f1cf870982713e85a7b70692b0fdcbc8c58b36 100755 (executable)
@@ -45,14 +45,15 @@ if test $framework_failure = 1; then
 fi
 
 # This cp command should exit nonzero.
-cp --b=simple a~ a > out 2>&1 && fail=1
+cp --b=simple a~ a > out1 2>&1 && fail=1
 
-sed "s,cp:,XXX:," out > out2
+sed -r 's/^(\/.*\/)*(.*)/\2/' out1 > out2
+sed "s,cp:,XXX:," out2 > out
 
 cat > exp <<\EOF
 XXX: backing up `a' would destroy source;  `a~' not copied
 EOF
 
-cmp out2 exp || fail=1
+cmp out exp || fail=1
 
 (exit $fail); exit $fail
index 5fff090cdbff6013f94f714f5aa68f546da86bf4..21f6a35b3ba199c45c079de3d5cba5c4843ba9ed 100755 (executable)
@@ -69,10 +69,14 @@ cp F symlink 2> out && fail=1
 #   ...: The file access permissions do not allow the specified action.
 # to the expected one:
 sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out
+sed -r 's/^(\/.*\/)*(cp:.*)/\2/' out > out1;mv out1 out
+
 cmp out exp || { (diff -c out exp) 2> /dev/null; fail=1; }
 
 cp --target-directory=symlink F 2> out && fail=1
 sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out
+sed -r 's/^(\/.*\/)*(cp:.*)/\2/' out > out1;mv out1 out
+
 cmp out exp || { (diff -c out exp) 2> /dev/null; fail=1; }
 
 chmod 700 D
index 79c727a8dadd7af00152edad8f497e6923eba3a0..d47645cbfff18759f391598e984f152a9d92fd57 100755 (executable)
@@ -50,7 +50,8 @@ fi
 fail=0
 
 # This command should exit nonzero.
-cp -R dir dir 2> out && fail=1
+cp -R dir dir 2> out1 && fail=1
+sed -r 's/^(\/.*\/)*(cp: .*)/\2/' out1 > out
 
 cat > exp <<\EOF
 cp: cannot copy a directory, `dir', into itself, `dir/dir'
index 33f6404c73306430e97c242b10521e3d6e5b9e4d..988d0f5227308173e04685806ea6fb2cb66c16b3 100644 (file)
@@ -575,6 +575,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -592,6 +593,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -604,11 +606,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index f76aae6e926a058afe740a1a29c6804f84f95e42..ad529b204e52285d67e49e4db16ed05099fb821b 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 9908cbf6a9c277276a2f7a35d2328069420bf4cc..71182e7236bdc31b0cb108a92f81f48dafa0f0ce 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 2e5f1101b51f38d7771009b057bd917924d4e901..53d9b19248b16dfd757d726e75d491040eef4330 100755 (executable)
@@ -39,7 +39,7 @@ use strict;
 my @Tests =
     (
      ['a', '-b', {IN => {k => "exec\n"}},
-      {ERR => "dircolors: k:1: invalid line;  missing second token\n"},
+      {ERR => "$ENV{PWD}/../../src/dircolors: k:1: invalid line;  missing second token\n"},
       {EXIT => 1}],
      ['quote', '-b', {IN => "exec 'echo Hello;:'\n"},
       {OUT => "LS_COLORS='ex='\\''echo Hello;\\:'\\'':';\n"
index b68e6b479cc051c63657e013e10924e4297cb064..95c094b6fe83e8e055b970a15bdffc746a538746 100644 (file)
@@ -551,6 +551,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -568,6 +569,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+        echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -580,11 +582,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+        echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+          echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index fdcb5957515c516e56c5494e7142f1ea72b93653..4558071826f9d8cd3bb74b65bdf2f93c47e467b5 100755 (executable)
@@ -46,14 +46,14 @@ my @Tests =
   (
    # invalid extra command line argument
    ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>1},
-    {ERR => "du: extra operand `no-such'\n"
+    {ERR => "$ENV{PWD}/../../src/du: extra operand `no-such'\n"
        . "File operands cannot be combined with --files0-from.\n"
-       . "Try `du --help' for more information.\n"}
+       . "Try `$ENV{PWD}/../../src/du --help' for more information.\n"}
     ],
 
    # missing input file
    ['missing', '--files0-from=missing', {EXIT=>1},
-    {ERR => "du: cannot open `missing' for reading: "
+    {ERR => "$ENV{PWD}/../../src/du: cannot open `missing' for reading: "
      . "No such file or directory\n"}],
 
    # empty input
@@ -64,12 +64,12 @@ my @Tests =
 
    # one NUL
    ['nul-1', '--files0-from=-', '<', {IN=>"\0"}, {EXIT=>1},
-    {ERR => "du: -:1: invalid zero-length file name\n"}],
+    {ERR => "$ENV{PWD}/../../src/du: -:1: invalid zero-length file name\n"}],
 
    # two NULs
    ['nul-2', '--files0-from=-', '<', {IN=>"\0\0"}, {EXIT=>1},
-    {ERR => "du: -:1: invalid zero-length file name\n"
-          . "du: -:2: invalid zero-length file name\n"}],
+    {ERR => "$ENV{PWD}/../../src/du: -:1: invalid zero-length file name\n"
+          . "$ENV{PWD}/../../src/du: -:2: invalid zero-length file name\n"}],
 
    # one file name, no NUL
    ['1', '--files0-from=-', '<',
@@ -95,7 +95,7 @@ my @Tests =
    ['zero-len', '--files0-from=-', '<',
     {IN=>{f=>"\0g\0"}}, {AUX=>{g=>''}},
     {OUT=>"0\tg\n"}, {OUT_SUBST=>'s/^\d+/0/'},
-    {ERR => "du: -:1: invalid zero-length file name\n"}, {EXIT=>1} ],
+    {ERR => "$ENV{PWD}/../../src/du: -:1: invalid zero-length file name\n"}, {EXIT=>1} ],
   );
 
 my $save_temps = $ENV{DEBUG};
index 0ff6b96ec3bd66e21a4c6c0292c122e04e91dc47..8efcf70d44bf778ef39fed9de1322627f3233213 100755 (executable)
@@ -56,6 +56,8 @@ du > ../t 2>&1 && fail=1
 # /proc support, nor native openat support.
 
 sed 's/^[0-9][0-9]*    //' ../t | sort -u > out
+sed -r 's/^(\/.*\/)*(du:.*)/\2/' out > out1;mv out1 out
+
 cat <<\EOF > exp || fail=1
 .
 ./a
index f5f9423f06eb4d34e1b2a3fbfec6c9873eb62921..262961cd0250fd0cddcb3a07682370c153f4624a 100755 (executable)
@@ -90,6 +90,7 @@ fail=0
 # du: cannot access `1/s/s/s/.../s': Too many levels of symbolic links
 du -L 1 > /dev/null 2> out1 && fail=1
 sed "s, .1/s/s/s/[/s]*',," out1 > out || fail=1
+sed -r 's/^(\/.*\/)*(du:.*)/\2/' out > out1;mv out1 out
 
 echo "du: cannot access: $too_many" > exp || fail=1
 
index fa93e97fd5abceb48ef5ad4111cff5d8b937fb3b..c938b4f80842876cf8ac3f33dce629d3336bbd2f 100755 (executable)
@@ -47,6 +47,7 @@ fail=0
 
 # This must exit nonzero.
 du d >/dev/null 2>out && fail=1
+sed -r 's/^(\/.*\/)*(du:.*)/\2/' out > out1;mv out1 out
 
 cat <<\EOF > exp
 du: `d/no-x': Permission denied
index e853c76b78d1af6c95366c0c4119f656be028fa4..bc40e46d845e5a59dd726464d22e6deb1aadf394 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index ee264d94ceb024e9bb1acec436e61872bf284a46..ea3f473e6a2d25ffbcad8e62ea66d512df4b0347 100755 (executable)
@@ -41,6 +41,8 @@ use strict;
 
 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
     (
      ['a', '5 + 6', {OUT => '11'}],
@@ -75,7 +77,7 @@ my @Tests =
      ['minus2', '-- 2 + 2', {OUT => '4'}],
 
      # This erroneously succeeded and output `3' before 2.0.12.
-     ['fail-a', '3 + -', {ERR => "$prog: non-numeric argument\n"},
+     ['fail-a', '3 + -', {ERR => "$src_path/$prog: non-numeric argument\n"},
       {EXIT => 2}],
 
      # This erroneously succeeded before 5.3.1.
@@ -89,15 +91,15 @@ my @Tests =
      ['bre1', '"abc" : "a\\(b\\)c"', {OUT => 'b'}],
      ['bre2', '"a(" : "a("', {OUT => '2'}],
      ['bre3', '_ : "a\\("',
-      {ERR => "$prog: Unmatched ( or \\(\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Unmatched ( or \\(\n"}, {EXIT => 2}],
      ['bre4', '_ : "a\\(b"',
-      {ERR => "$prog: Unmatched ( or \\(\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Unmatched ( or \\(\n"}, {EXIT => 2}],
      ['bre5', '"a(b" : "a(b"', {OUT => '3'}],
      ['bre6', '"a)" : "a)"', {OUT => '2'}],
      ['bre7', '_ : "a\\)"',
-      {ERR => "$prog: Unmatched ) or \\)\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Unmatched ) or \\)\n"}, {EXIT => 2}],
      ['bre8', '_ : "\\)"',
-      {ERR => "$prog: Unmatched ) or \\)\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Unmatched ) or \\)\n"}, {EXIT => 2}],
      ['bre9', '"ab" : "a\\(\\)b"', {OUT => ''}, {EXIT => 1}],
      ['bre10', '"a^b" : "a^b"', {OUT => '3'}],
      ['bre11', '"a\$b" : "a\$b"', {OUT => '3'}],
@@ -133,21 +135,21 @@ my @Tests =
      ['bre40', '"ab" : "a\\{1,\\}b"', {OUT => '2'}],
      ['bre41', '"aab" : "a\\{1,2\\}b"', {OUT => '3'}],
      ['bre42', '_ : "a\\{1"',
-      {ERR => "$prog: Unmatched \\{\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Unmatched \\{\n"}, {EXIT => 2}],
      ['bre43', '_ : "a\\{1a"',
-      {ERR => "$prog: Unmatched \\{\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Unmatched \\{\n"}, {EXIT => 2}],
      ['bre44', '_ : "a\\{1a\\}"',
-      {ERR => "$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
      ['bre45', '"a" : "a\\{,2\\}"', {OUT => '1'}],
      ['bre46', '"a" : "a\\{,\\}"', {OUT => '1'}],
      ['bre47', '_ : "a\\{1,x\\}"',
-      {ERR => "$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
      ['bre48', '_ : "a\\{1,x"',
-      {ERR => "$prog: Unmatched \\{\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Unmatched \\{\n"}, {EXIT => 2}],
      ['bre49', '_ : "a\\{32768\\}"',
-      {ERR => "$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
      ['bre50', '_ : "a\\{1,0\\}"',
-      {ERR => "$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
+      {ERR => "$src_path/$prog: Invalid content of \\{\\}\n"}, {EXIT => 2}],
      ['bre51', '"acabc" : ".*ab\\{0,0\\}c"', {OUT => '2'}],
      ['bre52', '"abcac" : "ab\\{0,1\\}c"', {OUT => '3'}],
      ['bre53', '"abbcac" : "ab\\{0,3\\}c"', {OUT => '4'}],
@@ -161,10 +163,10 @@ my @Tests =
      ['bre61', '"acd" : "a\\(b\\)?c\\1d"', {OUT => ''}, {EXIT => 1}],
      ['bre62', '-- "-5" : "-\\{0,1\\}[0-9]*\$"', {OUT => '2'}],
 
-     ['fail-b', '9 9', {ERR => "$prog: syntax error\n"},
+     ['fail-b', '9 9', {ERR => "$src_path/$prog: syntax error\n"},
       {EXIT => 2}],
-     ['fail-c', {ERR => "$prog: missing operand\n"
-                . "Try `$prog --help' for more information.\n"},
+     ['fail-c', {ERR => "$src_path/$prog: missing operand\n"
+                . "Try `$src_path/$prog --help' for more information.\n"},
       {EXIT => 2}],
     );
 
index dead356a3da30ccc5b7045f3ed3b2c122927428b..f62af41061eaefa89d602e0e70cfb85acee24e53 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 8b91cce091d505f9f2d18d846315b426a1d31999..ca44c16f45bb5c1f5a2333d30a8f255a856b1282 100755 (executable)
@@ -41,6 +41,8 @@ use strict;
 
 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
     (
      ['1', '9',          {OUT => '3 3'}],
@@ -74,12 +76,12 @@ my @Tests =
      ['x', '4294966896', {OUT => '2 2 2 2 3 3 3 11 607 1489'}],
      ['y', '4294966998', {OUT => '2 3 7 3917 26107'}],
      ['z', '-1',
-      {ERR => "$prog: invalid option -- 1\n"
-       . "Try `$prog --help' for more information.\n"},
+      {ERR => "$src_path/$prog: invalid option -- '1'\n"
+       . "Try `$src_path/$prog --help' for more information.\n"},
       {EXIT => 1}],
      ['cont', 'a 4',
       {OUT => "4: 2 2\n"},
-      {ERR => "$prog: `a' is not a valid positive integer\n"},
+      {ERR => "$src_path/$prog: `a' is not a valid positive integer\n"},
       {EXIT => 1}],
     );
 
index cef5c9a1749f7acda940edeb8c475e9851343f38..0a41dfdcca8445b307f0144aeca20dee379d5930 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 66abe13057b29304774c07221b81fea81885a496..86b7c327ec4503957211be8e43a68fe48e2ca47a 100755 (executable)
@@ -41,24 +41,26 @@ use strict;
 
 (my $program_name = $0) =~ s|.*/||;
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
     (
      ['8-bit-pfx', qw (-p 'ç'),
       {IN=> "ça\nçb\n"},
       {OUT=>"ça b\n"}],
      ['wide-1', '-w 32768',
-      {ERR => "fmt: invalid width: `32768'\n"}, {EXIT => 1}],
+      {ERR => "$src_path/fmt: invalid width: `32768'\n"}, {EXIT => 1}],
      ['wide-2', '-w 2147483647',
-      {ERR => "fmt: invalid width: `2147483647'\n"}, {EXIT => 1}],
+      {ERR => "$src_path/fmt: invalid width: `2147483647'\n"}, {EXIT => 1}],
      ['bad-suffix', '-72x',    {IN=> ''},
-      {ERR => "fmt: invalid width: `72x'\n"}, {EXIT => 1}],
+      {ERR => "$src_path/fmt: invalid width: `72x'\n"}, {EXIT => 1}],
      ['no-file', 'no-such-file',
-      {ERR => "fmt: cannot open `no-such-file' for reading:"
+      {ERR => "$src_path/fmt: cannot open `no-such-file' for reading:"
        . " No such file or directory\n"}, {EXIT => 1}],
      ['obs-1', '-c -72',
-      {ERR => "fmt: invalid option -- 7; -WIDTH is recognized only when it"
+      {ERR => "$src_path/fmt: invalid option -- 7; -WIDTH is recognized only when it"
        . " is the first\noption; use -w N instead\n"
-       . "Try `fmt --help' for more information.\n" }, {EXIT => 1}],
+       . "Try `$src_path/fmt --help' for more information.\n" }, {EXIT => 1}],
 
      # With --prefix=P, do not remove leading space on lines without the prefix.
      ['pfx-1', qw (-p '>'),
index a5d6e56692d913017d5149bd54925349a80190b8..515cade8f33230c858e82432249421330dd7e86a 100644 (file)
@@ -562,6 +562,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -579,6 +580,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -591,11 +593,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 48283781b83c64592add3d781586f0c0f08a93a9..56a0059d3755383c9c0e6bfc8213a431b66386e8 100644 (file)
@@ -519,6 +519,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -536,6 +537,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -548,11 +550,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 3270604049fefadb270c05ea426c1c508bb4d9e4..9a0de8fd9c7f286dbbc2457980057d0347b12486 100755 (executable)
@@ -143,6 +143,8 @@ fi
 
 touch file || fail=1
 ginstall -Dv file sub3/a/b/c/file >out 2>&1 || fail=1
+sed -r 's/^(\/.*\/)*(ginstall:.*)/\2/' out > out1; mv out1 out
+
 diff - out <<\EOF || fail=1
 ginstall: creating directory `sub3'
 ginstall: creating directory `sub3/a'
index b114a9b6f14a09cdd5283fa5f9c6ba0e4f1e9db3..34d7336ba7d561a75812d606d1b04111e9c9ff59 100644 (file)
@@ -567,6 +567,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -584,6 +585,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -596,11 +598,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index d59ce9addfeba95cc3ac9a7816ffb17757986ec8..9ad7dafbaabc270c67c7bae91335634a9bb96281 100644 (file)
@@ -518,6 +518,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -535,6 +536,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -547,11 +549,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index e37938d382f668a2c5d4b43cfcc16ccb8e3247c7..9a110a62c9dccddaf0fa25811fc3ba05ea00afe6 100755 (executable)
@@ -44,6 +44,8 @@ fi
 fail=0
 
 ln --backup f f 2> out && fail=1
+sed -r 's/^(\/.*\/)*(ln:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp || fail=1
 ln: `f' and `f' are the same file
 EOF
index 98146a76bedfc207c5cad6ff9946ccc558ad2b36..c024f4241b8fefc8cd7845ea145e0900a665903b 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index d0257a6a3c04a3970649e548a427c1cf6b8bcf2e..1d766d2b0ad38ed77eb80809c1ac199de48e140d 100755 (executable)
@@ -79,6 +79,8 @@ my $exe_in_subdir = {PRE => sub { make_j_d (); $ENV{LS_COLORS}='ex=01;32' }};
 my $remove_j = {POST => sub {unlink 'j/d' or die "j/d: $!\n";
                              rmdir 'j' or die "j: $!\n" }};
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my $q_bell = {IN => {"q\a" => ''}};
 my @Tests =
     (
@@ -130,7 +132,7 @@ my @Tests =
      # From Stéphane Chazelas.
      ['no-a-isdir-b', 'no-dir d',
         {OUT => "d:\n"},
-        {ERR => "ls: cannot access no-dir: No such file or directory\n"},
+        {ERR => "$src_path/ls: cannot access no-dir: No such file or directory\n"},
         $mkdir, $rmdir, {EXIT => 2}],
 
      ['recursive-2', '-R d', {OUT => "d:\ne\n\nd/e:\n"}, $mkdir2, $rmdir2],
index a77a08ac7944fdeff13baa40fa45727d4f32abb2..70c814a8099354dbc65d8fdb2992782e21c5d887 100644 (file)
@@ -549,6 +549,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -566,6 +567,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -578,11 +580,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index bfb9447582c8df0a3ca1be509eec4387f8f7fe4f..a82983c8d4b4cdb71f3cfdf8f28aea41e054e076 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 5f02af257a408671450f19ea15bab2085df2cd97..52120a748b13a09b4b2c8a84af8b78611e7cd080 100755 (executable)
@@ -33,6 +33,8 @@ use strict;
 
 (my $program_name = $0) =~ s|.*/||;
 
+my $src_path = "$ENV{PWD}/../../src";
+
 # Turn off localisation of executable's ouput.
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
 
@@ -63,7 +65,7 @@ my @Tests =
      # sha1sum accept BSD format.
      ['check-bsd', '--check', {IN=> {'f.sha1' => "SHA1 (f) = $degenerate\n"}},
                                {AUX=> {f=> ''}},
-                               {ERR=>"md5sum: f.sha1: no properly formatted "
+                               {ERR=>"$src_path/md5sum: f.sha1: no properly formatted "
                                       . "MD5 checksum lines found\n"},
                                {EXIT=> 1}],
      ['check-bsd2', '--check', {IN=> {'f.md5' => "MD5 (f) = $degenerate\n"}},
index 357d69564081eb54e9c08bc80345d73f9fc46716..40974d7da7cdb619d019e4ff7dcbe86c705fa7da 100644 (file)
@@ -600,6 +600,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -617,6 +618,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -629,11 +631,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 89d96ff02ba87e439fa4716d8045f17dc67fe464..58ab954cd8acbb546f2e23b7f1590ab7c680e90f 100755 (executable)
@@ -45,12 +45,14 @@ my $double_slash = ($stat_single->dev == $stat_double->dev
 
 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
     (
-     ['fail-1', {ERR => "$prog: missing operand\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => '1'}],
-     ['fail-2', qw(a b c), {ERR => "$prog: extra operand `c'\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => '1'}],
+     ['fail-1', {ERR => "$src_path/$prog: missing operand\n"
+       . "Try `$src_path/$prog --help' for more information.\n"}, {EXIT => '1'}],
+     ['fail-2', qw(a b c), {ERR => "$src_path/$prog: extra operand `c'\n"
+       . "Try `$src_path/$prog --help' for more information.\n"}, {EXIT => '1'}],
 
      ['a', qw(d/f),        {OUT => 'f'}],
      ['b', qw(/d/f),       {OUT => 'f'}],
index 885d6928a7788c0a0847a67bf1ecf592615c6ce1..adc216a0c7790697d447afaacce8a18942983b74 100755 (executable)
@@ -76,6 +76,7 @@ rm -f in out exp
 # `echo |csplit - 1 1' used to abort.
 echo > in
 csplit in 1 1 > out 2> err || fail=1
+sed -r 's/^(\/.*\/)*(csplit:.*)/\2/' err > err1; mv err1 err
 cat <<EOF > exp
 0
 0
@@ -83,6 +84,7 @@ cat <<EOF > exp
 EOF
 cmp out exp || fail=1
 test $fail = 1 && diff out exp 2> /dev/null
+
 cat <<\EOF > experr
 csplit: warning: line number `1' is the same as preceding line number
 EOF
@@ -95,6 +97,10 @@ echo > in
 csplit in 0 > out 2> err && fail=1
 csplit in 2 1 > out 2>> err && fail=1
 csplit in 3 3 > out 2>> err && fail=1
+
+sed -r 's/^(\/.*\/)*(csplit:.*)/\2/' out > out1; mv out1 out
+sed -r 's/^(\/.*\/)*(csplit:.*)/\2/' err > err1; mv err1 err
+
 cat <<\EOF > experr
 csplit: 0: line number must be greater than zero
 csplit: line number `1' is smaller than preceding line number, 2
index c217d9ab42458292b8cff0a0e66484598daa3e89..24f586614d5fd704b16fd2d23ed2c20695faca58 100755 (executable)
@@ -46,12 +46,14 @@ my $double_slash = ($stat_single->dev == $stat_double->dev
 
 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
     (
-     ['fail-1', {ERR => "$prog: missing operand\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => '1'}],
-     ['fail-2', qw(a b), {ERR => "$prog: extra operand `b'\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => '1'}],
+     ['fail-1', {ERR => "$src_path/$prog: missing operand\n"
+       . "Try `$src_path/$prog --help' for more information.\n"}, {EXIT => '1'}],
+     ['fail-2', qw(a b), {ERR => "$src_path/$prog: extra operand `b'\n"
+       . "Try `$src_path/$prog --help' for more information.\n"}, {EXIT => '1'}],
 
      ['a', qw(d/f),        {OUT => 'd'}],
      ['b', qw(/d/f),       {OUT => '/d'}],
index 70435b4538f281067ba995825af87bbcfef22932..b76a1242e75a5ba5d4325e6e05f8b0da39b5cdb0 100755 (executable)
@@ -77,6 +77,7 @@ split -99999999999999999991 2> out && fail=1
 # so map them both to -99*.
 sed 's/99[19]*/99*/' out > out-t
 mv -f out-t out
+sed -r 's/^(\/.*\/)*(split:.*)/\2/' out > out1; mv out1 out
 
 cat <<\EOF > exp
 split: line count option -99*... is too large
index ecd4940938031591ead571fd71202dbb074278e4..a5d35c68a20b4b949566a4cc4fa9a75248fb684e 100755 (executable)
@@ -34,6 +34,8 @@ use strict;
 (my $ME = $0) =~ s|.*/||;
 my $prog = 'stat';
 
+my $src_path = "$ENV{PWD}/../../src";
+
 # Turn off localisation of executable's ouput.
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
 
@@ -53,7 +55,7 @@ my @Tests =
      ['hex-1',   q!--printf='\x34\xf' .!,      {OUT=>"\x34\xf"}],
      ['hex-2',   q!--printf='.\x18p\xfq' .!,   {OUT=>".\x18p\x0fq"}],
      ['hex-3',   q!--printf='\x' .!,           {OUT=>'x'},
-        {ERR=>"$prog: warning: unrecognized escape `\\x'\n"}],
+        {ERR=>"$src_path/$prog: warning: unrecognized escape `\\x'\n"}],
 
      # With --format, there *is* a trailing newline.
      ['f-nl', "--format=%n .",          {OUT=>".\n"}],
@@ -62,12 +64,12 @@ my @Tests =
      ['end-pct', "--printf=% .",       {OUT=>"%"}],
      ['pct-pct', "--printf=%% .",      {OUT=>"%"}],
      ['end-bs',  "--printf='\\' .",    {OUT=>'\\'},
-        {ERR=>"$prog: warning: backslash at end of format\n"}],
+        {ERR=>"$src_path/$prog: warning: backslash at end of format\n"}],
 
      ['err-1', "--printf=%9% .",       {EXIT => 1},
-        {ERR=>"$prog: %9%: invalid directive\n"}],
+        {ERR=>"$src_path/$prog: %9%: invalid directive\n"}],
      ['err-2', "--printf=%9 .",        {EXIT => 1},
-        {ERR=>"$prog: %9: invalid directive\n"}],
+        {ERR=>"$src_path/$prog: %9: invalid directive\n"}],
     );
 
 my $save_temps = $ENV{DEBUG};
index 72f1bdf89de319432f0c0ef69ef6693ff8b19a17..265191d38a4b681004446fe0957908cc1a80eb7c 100755 (executable)
@@ -41,6 +41,8 @@ use strict;
 $ENV{PROG} = 'wc';
 my $ME = $ENV{PROG};
 
+my $src_path = "$ENV{PWD}/../../src";
+
 # Turn off localization of executable's ouput.
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
 
@@ -48,14 +50,14 @@ my @Tests =
   (
    # invalid extra command line argument
    ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>1},
-    {ERR => "$ME: extra operand `no-such'\n"
+    {ERR => "$src_path/$ME: extra operand `no-such'\n"
        . "File operands cannot be combined with --files0-from.\n"
-       . "Try `$ME --help' for more information.\n"}
+       . "Try `$src_path/$ME --help' for more information.\n"}
     ],
 
    # missing input file
    ['missing', '--files0-from=missing', {EXIT=>1},
-    {ERR => "$ME: cannot open `missing' for reading: "
+    {ERR => "$src_path/$ME: cannot open `missing' for reading: "
      . "No such file or directory\n"}],
 
    # empty input
@@ -66,13 +68,13 @@ my @Tests =
 
    # one NUL
    ['nul-1', '--files0-from=-', '<', {IN=>"\0"}, {EXIT=>1},
-    {ERR => "$ME: : No such file or directory\n"}],
+    {ERR => "$src_path/$ME: : No such file or directory\n"}],
 
    # two NULs
    ['nul-2', '--files0-from=-', '<', {IN=>"\0\0"}, {EXIT=>1},
     {OUT=>"0 0 0 total\n"},
-    {ERR => "$ME: : No such file or directory\n"
-          . "$ME: : No such file or directory\n"}],
+    {ERR => "$src_path/$ME: : No such file or directory\n"
+          . "$src_path/$ME: : No such file or directory\n"}],
 
    # one file name, no NUL
    ['1', '--files0-from=-', '<',
@@ -96,7 +98,7 @@ my @Tests =
    ['zero-len', '--files0-from=-', '<',
     {IN=>{f=>"\0g\0"}}, {AUX=>{g=>''}},
     {OUT=>"0 0 0 g\n0 0 0 total\n"},
-    {ERR => "$ME: : No such file or directory\n"}, {EXIT=>1} ],
+    {ERR => "$src_path/$ME: : No such file or directory\n"}, {EXIT=>1} ],
   );
 
 my $save_temps = $ENV{DEBUG};
index 78efc69cd08a3ddae99c025450b30b9ca8214eaf..772e13feaa7a8b752e4e428e365a9abb61448b39 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 267542353b0cda0d73ce18d1a993938a56b2903a..052744bdcb0909d868b20e461a72ace38ace5341 100755 (executable)
@@ -46,6 +46,7 @@ if test $framework_failure = 1; then
 fi
 
 mkdir -pv foo/a/b/c/d 2>out || exit
+sed -r 's/^(\/.*\/)*(mkdir:.*)/\2/' out > out1; mv out1 out
 
 diff - out <<\EOF
 mkdir: created directory `foo'
index b86230a65dfbf8c0c5401a1649de3d5d1c857cd1..475b42b50966d2b3d21b41e16e3417c0675db8a0 100644 (file)
@@ -563,6 +563,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -580,6 +581,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -592,11 +594,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 11ae26ed1b23e68873b81be58d59e54fdf276c52..710390f22e6ab0c3c54ab5fd12dd6f6bd79c7cc1 100755 (executable)
@@ -56,6 +56,8 @@ mv b/t a 2> out && fail=1
 sed             's/: File exists/: Directory not empty/'<out>o1;mv o1 out
 sed 's/: Device or resource busy/: Directory not empty/'<out>o1;mv o1 out
 
+sed -r 's/^(\/.*\/)*(mv:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp || fail=1
 mv: cannot move `b/t' to `a/t': Directory not empty
 EOF
index 7965c91a59b91e068b69a2db99a6c38bc993eeb5..2582f998f67aa3f74ad805f59c29a826e231e946 100755 (executable)
@@ -63,6 +63,7 @@ for i in cp; do
   # But not with plain `--backup'
   rm -fr a d; touch a; mkdir d
   $i --backup a a d/ 2>> out && fail=1
+  sed -r 's/^(\/.*\/)*(cp:.*)/\2/' out > out1; mv out1 out
   cat <<EOF > exp
 $i: warning: source file \`a' specified more than once
 $i: warning: source file \`a' specified more than once
@@ -79,6 +80,7 @@ for i in mv; do
   $i a a d/ 2> out && fail=1
   rm -fr a d; touch a; mkdir d
   $i ./a a d/ 2>> out && fail=1
+  sed -r 's/^(\/.*\/)*(mv:.*)/\2/' out > out1; mv out1 out
   cat <<EOF > exp
 $i: cannot stat \`a': No such file or directory
 $i: cannot stat \`a': No such file or directory
index 3ab73c08d177be694dbb167d8f3fc39aa8b6e1ca..5e741e469502238e5a7ad02a65a790e4de0f9148 100755 (executable)
@@ -38,12 +38,14 @@ use strict;
 
 my $test_a = 'a';
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
     (
      # Make sure a `n' reply to `mv -i...' aborts the move operation.
      [$test_a, '-i',
       {IN => {src => "a\n"}}, {IN => {dst => "b\n"}}, '<', {IN => "n\n"},
-      {ERR => "mv: overwrite `dst'? "},
+      {ERR => "$src_path/mv: overwrite `dst'? "},
       {POST => sub { -r 'src' or die "test $test_a failed\n"}},
       {EXIT => 0},
      ],
index 2931af60e407b098aef77c45b8f2a2a15e6e6b4d..1612b3a065f9e32d9e1fd5d2dcd8ce924b727462 100755 (executable)
@@ -49,6 +49,8 @@ fi
 fail=0
 
 mv --reply=no a/bar a/foo b > out 2> err || fail=1
+sed -r 's/^(\/.*\/)*(mv:.*)/\2/' err > err1; mv err1 err
+
 cat <<EOF > exp
 EOF
 
index 1b9ab289ad6acfd35e65ba6e893f38693edc33cd..171eb6e2ade6da996341485e590129377e46d8be 100755 (executable)
@@ -47,6 +47,9 @@ fi
 fail=0
 
 mv no-write/dir . > out 2>&1 && fail=1
+
+sed -r 's/^(\/.*\/)*(mv:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp
 mv: cannot move `no-write/dir' to `./dir': Permission denied
 EOF
index ae0a3cd2eade21bc45773a8027d5be40fa1c8c7a..7aed9ef4fae2c7a2868fde821d296632df933b32 100755 (executable)
@@ -48,6 +48,8 @@ mv --interactive --reply=no a b > out 2>&1 || fail=1
 test -f a || fail=1
 test -f b || fail=1
 
+sed -r 's/^(\/.*\/)*(mv:.*)/\2/' out > out1; mv out1 out
+
 cat <<EOF > exp_err
 mv: the --reply option is deprecated; use -i or -f instead
 EOF
index 90f34eb1d0e7987a8117c5e7b174b503910f5688..395486b2a0af4ba4103262df9a63abf816a8e21f 100644 (file)
@@ -521,6 +521,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -538,6 +539,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -550,11 +552,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index da0078a8688684fb3e9b0f9fbddd26ff8a2560c0..b1de47b3b4f2aa032a5dee70981120161e9b6251 100644 (file)
@@ -651,6 +651,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -668,6 +669,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -680,11 +682,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index e2d72643d5a8f3669f656b391a0a455bb4c3c541..5a883fb8d984b62793567d3c62aab9e65410d1eb 100644 (file)
@@ -518,6 +518,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -535,6 +536,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -547,11 +549,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 391f4e126a3da70fb1912224468b9100c68a1119..aca610d581e3aaec61f18e10f8e155d55b01c745 100644 (file)
@@ -565,6 +565,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -582,6 +583,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -594,11 +596,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 22936ee00c7afcacc966df3ed6cbc671dfa3f0fc..17580a35ab2c70958338644bc70e7c0f3cb19353 100755 (executable)
@@ -46,6 +46,9 @@ fi
 fail=0
 
 rm -rf a a 2>&1 | sed 's/:[^:]*$//' > out || fail=1
+
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp
 rm: cannot remove `a/b/file'
 rm: cannot remove `a/b/file'
index 27aba6aa9e91116e70219be1cfde5b6f6a0bdff5..adb80d369cf24346387dec77d39d375261fc1671 100755 (executable)
@@ -46,6 +46,9 @@ fail=0
 
 # For rm from coreutils-5.0.1, this would prompt.
 rm ---presume-input-tty unwritable-dir < /dev/null > out-t 2>&1 && fail=1
+
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out-t > out1; mv out1 out-t
+
 cat <<\EOF > exp || fail=1
 rm: cannot remove `unwritable-dir': Is a directory
 EOF
index 5b09821c0eead4e5ccc144232874d78fa519176c..d7775f1e46c4c153220065c70d395d26fba2758b 100755 (executable)
@@ -44,6 +44,9 @@ fi
 fail=0
 
 rm d 2> out && fail=1
+
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp || fail=1
 rm: cannot remove `d': Is a directory
 EOF
index b322848647ab554c75d1d9b97213d1a908fc0461..82ecc47cd26483c80aa4a2f12d745b19e326951b 100755 (executable)
@@ -44,6 +44,8 @@ fi
 fail=0
 
 rm -rf d/f 2> out && fail=1
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp
 rm: cannot remove `d/f': Permission denied
 EOF
index 02128d70e66a5470f40a1022b933b508485163e6..0253973867d5366715210625d65bc8b30369b095 100755 (executable)
@@ -60,6 +60,8 @@ set +x
 test -d "$p/abs1" && fail=1
 test -d "$p/abs2" && fail=1
 
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp || fail=1
 rm: cannot remove `rel': Permission denied
 EOF
index 7b816648444ea671adbf4f1247a78bddd2143766..79ebb79696d3ff3d188b7c414fc0d89112a9674f 100755 (executable)
@@ -87,17 +87,20 @@ rm -R -f --interactive=once file4-* < $test.I >> out 2>> err || fail=1
 echo . >> err || fail=1
 test -f file4-1 || fail=1
 
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' err > err1; mv err1 err
+
 cat <<\EOF > expout || fail=1
 EOF
 cat <<\EOF > experr || fail=1
 no WHEN
-rm: remove regular empty file `file1-1'? rm: remove regular empty file `file1-2'? .
+rm: remove regular empty file `file1-2'? .
 WHEN=never
 .
 WHEN=once
 rm: remove all arguments recursively? .
 WHEN=always
-rm: remove regular empty file `file4-1'? rm: remove regular empty file `file4-2'? .
+rm: remove regular empty file `file4-2'? .
 -f overrides --interactive
 .
 --interactive overrides -f
index 9325e8e7008fcae0e133bf9b4aa524d75ed4abb7..ea2c95ff78433a99d68db406621dc913982abd0b 100755 (executable)
@@ -103,6 +103,9 @@ echo . >> err || fail=1
 test -d dir2-1 && fail=1
 test -d dir2-2 && fail=1
 
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' err > err1; mv err1 err
+
 cat <<\EOF > expout || fail=1
 EOF
 cat <<\EOF > experr || fail=1
index 202dc01956e1026e11e28c8860ef053e189cd397..389e34e3cdaee6b647b26365e7b9eae667759fa0 100755 (executable)
@@ -61,6 +61,8 @@ test -f f || fail=1
 
 kill $pid > /dev/null 2>&1
 
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 # Note the trailing `x' -- so I don't have to have a trailing
 # blank in this file :-)
 cat > exp <<\EOF
index 8987cd2d5668a1ab572b3ffe52c341519e912c84..9223e8db208b6452fa10aade99ce0305f76ba8af 100755 (executable)
@@ -47,6 +47,9 @@ fail=0
 
 # This should fail.
 rm -rf b > out 2>&1 && fail=1
+
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp
 rm: cannot remove directory `b/a/p': Permission denied
 EOF
index c64a9f352addcba966b392b9ecd5bd0730c3cbaa..44fcd0e9b3a42d2d1eb9aed225065576866ec3ed 100755 (executable)
@@ -52,6 +52,9 @@ fail=0
 # in the same sort of diagnostic.
 # Both of these should fail.
 rm -rf a b > out 2>&1 && fail=1
+
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp
 rm: cannot remove `a/1': Permission denied
 rm: cannot remove `b': Permission denied
index b3caf49eafcbe39f4a3d3d38468cdaa9c939d929..b7e7b6e4a0b59e97cd5e717e20478f266226ddb1 100755 (executable)
@@ -66,6 +66,7 @@ EOF
 
 # Both of these should fail.
 rm -ir z < in > out 2>&1 || fail=1
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
 
 # Given input like `rm: ...? rm: ...? ' (no trailing newline),
 # the `head...' part of the pipeline below removes the trailing space, so
@@ -75,6 +76,7 @@ rm -ir z < in > out 2>&1 || fail=1
 tr '?' '\n' < out | head --bytes=-1 | sed 's/^ //' |sort > o2
 mv o2 out
 
+
 sort <<EOF > exp || fail=1
 rm: descend into directory \`z'
 rm: remove regular empty file \`z/empty'
index 297d02afcbb6ed6919629259fa8ec8175f57410c..f66df9cd0aa542e96020f26325c4852a02467fe4 100755 (executable)
@@ -57,6 +57,8 @@ fail=0
 
 rm -ir d < in > out 2>&1 || fail=1
 
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 # Given input like `rm: ...? rm: ...? ' (no trailing newline),
 # the `head...' part of the pipeline below removes the trailing space, so
 # that sed doesn't have to deal with a line lacking a terminating newline.
index e67c9ae388309de8ff89bc60a6a8a54e8ec6ee24..e57bd336408ddc5543917c668460abeb8b7671ff 100755 (executable)
@@ -47,6 +47,9 @@ fail=0
 
 # This should fail.
 rm -rf a > out 2>&1 && fail=1
+
+sed -r 's/^(\/.*\/)*(rm:.*)/\2/' out > out1; mv out1 out
+
 cat <<\EOF > exp
 rm: cannot remove `a': Permission denied
 EOF
index 7104588f3c6fb40ad1218482e8c41c82d4fc362e..e21ee9576181ac78e25e78c59c8f3f51cb44a32e 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 056150eee268a7f171c27632b1be8256c97a3487..4c29ba85aee8a32a22dda01d85df815c105a5034 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index a0163559810a323d0c0509b3cac67c58d43be2cb..0574993b9c978816a841f0b31b296f4a658d074a 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 35562bd4ad03902186765e606cfcb8a85928cb4a..e6f802feffbb2c4a19750f35408bdfc8028f750f 100755 (executable)
@@ -38,6 +38,8 @@ use strict;
 
 my $sha_degenerate = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
     (
      ['s1', {IN=> {f=> ''}},
@@ -64,7 +66,7 @@ my @Tests =
      # md5sum accept BSD format.
      ['check-bsd', '--check', {IN=> {'f.md5' => "MD5 (f) = $sha_degenerate\n"}},
                        {AUX=> {f=> ''}},
-                       {ERR=>"sha1sum: f.md5: no properly formatted "
+                       {ERR=>"$src_path/sha1sum: f.md5: no properly formatted "
                          . "SHA1 checksum lines found\n"},
                        {EXIT=> 1}],
      ['check-bsd2', '--check',
index 66c79dd2cde688a32a461acdfbd3bd3e6457a431..17d5d169e5b3bcd9e644ec88d062eae05dee6f5d 100644 (file)
@@ -521,6 +521,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -538,6 +539,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -550,11 +552,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index cab283b5ba12d9c3dc3ae58a347ec4283887a0b0..7f4b1061eb88da02ed0c9e179e0fdfbec765df79 100644 (file)
@@ -592,6 +592,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -609,6 +610,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -621,11 +623,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index f6b75a9ed6c5f8b181b7cb1ad18cc0a55617dbda..eca4ba0fbc9634b38f60597cd0841e31d2b6c00e 100644 (file)
@@ -518,6 +518,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -535,6 +536,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -547,11 +549,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 45019821f1773ec9c34422928408da384a63e535..44ee0da72f3268b76d38697e07ef883b34ad613f 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 68b4045b2117a39a41fe59326839cf8d9afb61f1..c71f4f426780ac615c6a0784035146c394b8b3d9 100644 (file)
@@ -563,6 +563,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -580,6 +581,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -592,11 +594,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 4a3818a4a5f50abdfd6c2df6585fa30cafc8a79f..93934942ffaaeb56671ea0bfeb1381dad69df2d0 100644 (file)
@@ -546,6 +546,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -563,6 +564,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -575,11 +577,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 2ac0eae809ccbec5f5af4b4819f77d43a3954551..3d4174a024473c2fa425cfef966dc0233a3a6f60 100644 (file)
@@ -571,6 +571,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -588,6 +589,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -600,11 +602,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 050793d174c32a3fc5453e73aeff8fde4f6a163d..7b84bfbdd8b30190700568ffa7aff3c5b8c584f5 100644 (file)
@@ -518,6 +518,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -535,6 +536,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -547,11 +549,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 60472b01ce68ce672729e9fe3c9cdf3e919e6726..0b9bb011673be6c8d545c69e8d0f49fae1733a3d 100644 (file)
@@ -647,6 +647,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -664,6 +665,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -676,11 +678,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 442fa3f9675f9b130bad5d669f0c4e75224fcf36..00990df8449f60cad5940678d265ce257b20fe2e 100644 (file)
@@ -544,6 +544,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -561,6 +562,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -573,11 +575,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 082f754544d590981b7dfca6646bed184e347705..2487958b9e4a71cdf39ed6875b2175e96faec6b1 100755 (executable)
@@ -49,6 +49,9 @@ fi
 fail=0
 
 touch $dir > out 2>&1 && fail=1
+
+sed -r 's/^(\/.*\/)*(touch:.*)/\2/' out > out1; mv out1 out
+
 cat <<EOF > exp
 touch: cannot touch \`$dir': No such file or directory
 EOF
index 4d63ad7a346d21756ca017e5389025e2bc6be3eb..5681852eb67cf0f7155ddc0ce5037c68f48a175c 100755 (executable)
@@ -60,6 +60,8 @@ fail=0
 # touch: creating `/': Is a directory
 touch / > out 2>&1 && fail=1
 
+sed -r 's/^(\/.*\/)*(touch:.*)/\2/' out > out1; mv out1 out
+
 # On SunOS4, EPERM is `Not owner'.
 # On some *BSD systems it's `Operation not permitted'.
 for msg in 'Not owner' 'Operation not permitted' 'Permission denied'; do
index 6ae4ba34b96b4322350a45647aaa8b689e891670..42e01aecde613ce7c5de9de30e115aee0e4bf00d 100644 (file)
@@ -575,6 +575,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -592,6 +593,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -604,11 +606,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 3f3be5bc0e752cbba0ff66d70df7ecdf384824c6..ab4119824aea7a1c12dd7bf08c421b9082a9893e 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 4fe24f328e332e5f92dada92a7c885c4fba7dc2a..3455017bca84b0102f1ba7064560b012985187e2 100755 (executable)
@@ -39,14 +39,16 @@ use strict;
 # Turn off localisation of executable's ouput.
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
   (
    ['cycle-1', {IN => {f => "t b\nt s\ns t\n"}}, {OUT => "s\nt\nb\n"},
     {EXIT => 1},
-    {ERR => "tsort: f: input contains a loop:\ntsort: s\ntsort: t\n"} ],
+    {ERR => "$src_path/tsort: f: input contains a loop:\n$src_path/tsort: s\n$src_path/tsort: t\n"} ],
    ['cycle-2', {IN => {f => "t x\nt s\ns t\n"}}, {OUT => "s\nt\nx\n"},
     {EXIT => 1},
-    {ERR => "tsort: f: input contains a loop:\ntsort: s\ntsort: t\n"} ],
+    {ERR => "$src_path/tsort: f: input contains a loop:\n$src_path/tsort: s\n$src_path/tsort: t\n"} ],
 
    ['posix-1', {IN => "a b c c d e\ng g\nf g e f\nh h\n"},
     {OUT => "a\nc\nd\nh\nb\ne\nf\ng\n"}],
@@ -66,12 +68,12 @@ my @Tests =
    # copy of the final token were appended.
    ['odd', {IN => "a\n"},
     {EXIT => 1},
-    {ERR => "tsort: odd.1: input contains an odd number of tokens\n"}],
+    {ERR => "$src_path/tsort: odd.1: input contains an odd number of tokens\n"}],
 
    ['only-one', {IN => {f => ""}}, {IN => {g => ""}},
     {EXIT => 1},
-    {ERR => "tsort: extra operand `g'\n"
-     . "Try `tsort --help' for more information.\n"}],
+    {ERR => "$src_path/tsort: extra operand `g'\n"
+     . "Try `$src_path/tsort --help' for more information.\n"}],
   );
 
 my $save_temps = $ENV{DEBUG};
index 48393aa8fb6b096cba567f411d7c1a2710829f8b..2ae25f894c05eb79ab4f2120c1c8fa98b84e4e22 100644 (file)
@@ -522,6 +522,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -539,6 +540,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -551,11 +553,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 3824d7c8b14b6bfd0e7fc5eb355c41f374035d18..9d28f8fa272568409df9e6cd86c66673b5397b77 100755 (executable)
@@ -39,6 +39,8 @@ use strict;
 
 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
 
+my $src_path = "$ENV{PWD}/../../src";
+
 my @Tests =
     (
      ['a1', {IN=> ' 'x 1 ."y\n"}, {OUT=> ' 'x 1 ."y\n"}],
@@ -91,7 +93,7 @@ my @Tests =
      # It is debatable whether this test should require an environment
      # setting of e.g., _POSIX2_VERSION=1.
      ['obs-ovflo', '-18446744073709551617', {IN=>''}, {OUT=>''},
-      {EXIT => 1}, {ERR => "$prog: tab stop value is too large\n"}],
+      {EXIT => 1}, {ERR => "$src_path/$prog: tab stop value is too large\n"}],
     );
 
 my $save_temps = $ENV{DEBUG};
index bd99059c2520e840a1a90bdb9660644df0592bb7..321400a0ac8f72c83d82040456616f92d3044f61 100644 (file)
@@ -569,6 +569,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -586,6 +587,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -598,11 +600,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \
index 5a46cac0c48ede73811d368492791d9adf3ec0aa..d6e3b4cfa6013d6f55369739dfbd24551ade64b5 100644 (file)
@@ -555,6 +555,7 @@ CTAGS:
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       TEST_LOG="/tmp/coreutils_test"; export TEST_LOG; \
        srcdir=$(srcdir); export srcdir; \
        list=' $(TESTS) '; \
        if test -n "$$list"; then \
@@ -572,6 +573,7 @@ check-TESTS: $(TESTS)
              ;; \
              *) \
                echo "PASS: $$tst"; \
+               echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            elif test $$? -ne 77; then \
@@ -584,11 +586,13 @@ check-TESTS: $(TESTS)
              *) \
                failed=`expr $$failed + 1`; \
                echo "FAIL: $$tst"; \
+               echo "TEST: FAIL: $$tst" >> $$TEST_LOG; \
              ;; \
              esac; \
            else \
              skip=`expr $$skip + 1`; \
              echo "SKIP: $$tst"; \
+                 echo "TEST: SKIP: $$tst" >> $$TEST_LOG; \
            fi; \
          done; \
          if test "$$failed" -eq 0; then \