+++ /dev/null
-*.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
+++ /dev/null
-.*/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$
+++ /dev/null
-# 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
-}
+++ /dev/null
-ChangeLog(-[0-9]+)?$
-^old/
-^src/c99-to-c98\.diff$
-^gl/.*
+++ /dev/null
-ChangeLog
-Makefile.maint
-NEWS
-config-log
-po/
-src/df.c
-src/stat.c
-tests/misc/df-P
+++ /dev/null
-ChangeLog*
-Makefile.maint
-config.hin
-configure
-m4/jm-macros.m4
-src/system.h
+++ /dev/null
-^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$
+++ /dev/null
-^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$
+++ /dev/null
-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
+++ /dev/null
-config-log
-build-aux/config.guess
+++ /dev/null
-^tests/pr/
+++ /dev/null
-^lib/xstrtol\.h$
-^build-aux/cvsu$
+++ /dev/null
-^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
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
int
utimens (char const *file, struct timespec const timespec[2])
{
- return futimens (-1, file, timespec);
+ return gl_futimens (-1, file, timespec);
}
#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]);
--- /dev/null
+targettype x86 package coreutils
+ +^/bin/uname$
+ prereq -glibc-x86
--- /dev/null
+<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>
--- /dev/null
+%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
--- /dev/null
+#!/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
+
#include "utimens.h"
#include "xreadlink.h"
#include "yesno.h"
+#include "smack.h"
#ifndef HAVE_FCHOWN
# define HAVE_FCHOWN false
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)
}
}
+ 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)
{
}
}
+ 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:
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
#include "stat-time.h"
#include "utimens.h"
#include "acl.h"
+#include "smack.h"
#define ASSIGN_BASENAME_STRDUPA(Dest, File_name) \
do \
-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\
}
}
+ 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
x->preserve_links = false;
x->preserve_mode = false;
x->preserve_timestamps = false;
+ x->preserve_context = false;
x->require_preserve = false;
x->recursive = false;
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);
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:
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;
#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"
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. */
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'},
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\
{
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 */
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;
}
}
- 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,
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');
#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
free (groups);
}
#endif /* HAVE_GETGROUPS */
+
+ if (smack_of_proc(-1, context, sizeof (context)) > 0 && strlen(context) > 0)
+ printf (" context=\"%s\"", context);
}
#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"
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;
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'},
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;
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)
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:
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;
-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);
#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 \
/* 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
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;
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;
}
while ((c = getopt_long (argc, argv,
- "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UX1",
+ "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UXZ1",
long_options, NULL)) != -1)
{
switch (c)
sort_type_specified = true;
break;
+ case 'Z':
+ print_context = true;
+ break;
+
case '1':
/* -1 has no effect after -l. */
if (format != long_format)
/* 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)
switch (dereference)
{
case DEREF_ALWAYS:
+ err = smack_of_file_follow(absolute_name, &f->context);
err = stat (absolute_name, &f->stat);
break;
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)
}
default: /* DEREF_NEVER */
+ err = smack_of_file(absolute_name, &f->context);
err = lstat (absolute_name, &f->stat);
break;
}
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));
DIRED_INDENT ();
- if (print_owner | print_group | print_author)
+ if (print_owner | print_group | print_author | print_context)
{
DIRED_FPUTS (buf, stdout, p - buf);
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;
}
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);
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;
-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);
#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"
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'},
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);
/* 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;
};
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));
}
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);
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;
#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"
static struct option const longopts[] =
{
+ {"context", required_argument, NULL, 'Z'},
{"mode", required_argument, NULL, 'm'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
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);
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;
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;
}
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);
}
#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"
static struct option const longopts[] =
{
+ {"context", required_argument, NULL, 'Z'},
{"mode", required_argument, NULL, 'm'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
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);
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;
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;
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);
}
#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"
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 */
--- /dev/null
+/* 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);
+}
#include "stat-time.h"
#include "strftime.h"
#include "xreadlink.h"
+#include "smack.h"
#define alignof(type) offsetof (struct { char c; type x; }, x)
return "squashfs";
case S_MAGIC_SYSFS: /* 0x62656572 */
return "sysfs";
+ case S_MAGIC_SMACK: /* 0x43415D53 */
+ return "smack";
# elif __GNU__
case FSTYPE_UFS:
return "ufs";
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;
%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\
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)
{
# (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 \
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 \
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); \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
# 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'
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
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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
# ...: 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
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'
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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"
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
(
# 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
# 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=-', '<',
['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};
# /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
# 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
# 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
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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'}],
['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.
['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'}],
['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'}],
['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}],
);
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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'}],
['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}],
);
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
(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 '>'),
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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'
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 =
(
# 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],
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
(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;
# 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"}},
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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'}],
# `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
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
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
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'}],
# 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
(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;
['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"}],
['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};
$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;
(
# 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
# 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=-', '<',
['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};
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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'
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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
# 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
$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
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},
],
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
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
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
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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'
# 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
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
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
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
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
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
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
# 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
# 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
# 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
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'
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.
# 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
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
my $sha_degenerate = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
+my $src_path = "$ENV{PWD}/../../src";
+
my @Tests =
(
['s1', {IN=> {f=> ''}},
# 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',
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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
# 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
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
# 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"}],
# 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};
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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"}],
# 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};
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \
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 \
;; \
*) \
echo "PASS: $$tst"; \
+ echo "TEST: PASS: $$tst" >> $$TEST_LOG; \
;; \
esac; \
elif test $$? -ne 77; then \
*) \
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 \