mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
10 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99b35637c4 | ||
|
|
09b8756e33 | ||
|
|
9c5d11d5c5 | ||
|
|
bf6c2a07af | ||
|
|
c729fe037e | ||
|
|
02cde32c0a | ||
|
|
7741f87086 | ||
|
|
9e630b86cb | ||
|
|
2e19f14a91 | ||
|
|
65b1a6ec82 |
@@ -1,3 +1,21 @@
|
||||
1998-10-25 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* README: Man pages will now be supported to the extent that
|
||||
people send patches.
|
||||
|
||||
* Version 4.0-b6.
|
||||
|
||||
* tests/rm/unreadable: Two new tests.
|
||||
* tests/rm/Makefile.am (TESTS): Add new test `unreadable'. But comment
|
||||
it out since we're so close to release and since the test compares the
|
||||
text of diagnostics that are likely to vary between systems.
|
||||
(TEST_ENVIRONMENT): Add required framework.
|
||||
|
||||
* src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL
|
||||
pointer. (provoke with `mkdir -m 0100 x; rm -rf x')
|
||||
Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK.
|
||||
(remove_dir): Return `status', rather than always RM_OK.
|
||||
|
||||
1998-10-18 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 4.0-b5.
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
Changes in release 4.0:
|
||||
[4.0-b6]
|
||||
* rm simply fails as it should (rather than segfaulting) for
|
||||
`mkdir -m 0100 x; rm -rf x'
|
||||
[4.0-b5]
|
||||
* still *more* mktime.c portability tweaks
|
||||
[4.0-b4]
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
1998-10-04 Jim Meyering <meyering@ascend.com>
|
||||
1998-10-22 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 1.22g.
|
||||
|
||||
* src/fold.c (usage): Add mention of --version and --help.
|
||||
Reported by Matej Vela <mvela@public.srce.hr>.
|
||||
|
||||
1998-10-04 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lib/fnmatch.h: New file. (unused)
|
||||
* lib/fnmatch.c: New file. (unused)
|
||||
* lib/Makefile.am (noinst_HEADERS): Add fnmatch.h.
|
||||
|
||||
@@ -74,6 +74,8 @@ standard output.\n\
|
||||
-b, --bytes count bytes rather than columns\n\
|
||||
-s, --spaces break at spaces\n\
|
||||
-w, --width=WIDTH use WIDTH columns instead of 80\n\
|
||||
--help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
|
||||
}
|
||||
|
||||
13
src/remove.c
13
src/remove.c
@@ -575,12 +575,15 @@ remove_cwd_entries (const struct rm_options *x)
|
||||
}
|
||||
while (dirp == NULL);
|
||||
|
||||
if (CLOSEDIR (dirp))
|
||||
if (dirp)
|
||||
{
|
||||
error (0, errno, "%s", full_filename ("."));
|
||||
status = RM_OK;
|
||||
if (CLOSEDIR (dirp))
|
||||
{
|
||||
error (0, errno, "%s", full_filename ("."));
|
||||
status = RM_ERROR;
|
||||
}
|
||||
dirp = NULL;
|
||||
}
|
||||
dirp = NULL;
|
||||
|
||||
if (ht)
|
||||
{
|
||||
@@ -766,7 +769,7 @@ remove_dir (struct File_spec *fs, int need_save_cwd, const struct rm_options *x)
|
||||
return RM_ERROR;
|
||||
}
|
||||
|
||||
return RM_OK;
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Remove the file or directory specified by FS after checking appropriate
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
|
||||
AUTOMAKE_OPTIONS = 1.1 gnits
|
||||
|
||||
TESTS = r-1 r-2 r-3 i-1 ir-1 f-1 sunos-1 deep-1
|
||||
TESTS = r-1 r-2 r-3 i-1 ir-1 f-1 sunos-1 deep-1 # unreadable
|
||||
EXTRA_DIST = $(TESTS)
|
||||
TESTS_ENVIRONMENT = RM=../../src/rm MKDIR=../../src/mkdir
|
||||
TESTS_ENVIRONMENT = \
|
||||
RM=../../src/rm \
|
||||
MKDIR=../../src/mkdir \
|
||||
top_srcdir=$(top_srcdir) \
|
||||
srcdir=$(srcdir) \
|
||||
PERL="@PERL@" \
|
||||
PATH=../../src:$$PATH \
|
||||
PROG=rm
|
||||
|
||||
@@ -92,9 +92,16 @@ l = @l@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.1 gnits
|
||||
|
||||
TESTS = r-1 r-2 r-3 i-1 ir-1 f-1 sunos-1 deep-1
|
||||
TESTS = r-1 r-2 r-3 i-1 ir-1 f-1 sunos-1 deep-1 # unreadable
|
||||
EXTRA_DIST = $(TESTS)
|
||||
TESTS_ENVIRONMENT = RM=../../src/rm MKDIR=../../src/mkdir
|
||||
TESTS_ENVIRONMENT = \
|
||||
RM=../../src/rm \
|
||||
MKDIR=../../src/mkdir \
|
||||
top_srcdir=$(top_srcdir) \
|
||||
srcdir=$(srcdir) \
|
||||
PERL="@PERL@" \
|
||||
PATH=../../src:$$PATH \
|
||||
PROG=rm
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
|
||||
45
tests/rm/unreadable
Executable file
45
tests/rm/unreadable
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
: ${PERL=perl}
|
||||
: ${srcdir=.}
|
||||
|
||||
case "$PERL" in
|
||||
*'missing perl')
|
||||
echo 1>&2 "$0: configure didn't find a usable version of Perl, so can't run this test"
|
||||
exit 77
|
||||
;;
|
||||
esac
|
||||
|
||||
exec $PERL -w -I$srcdir/.. -MFetish -- - << \EOF
|
||||
require 5.003;
|
||||
use strict;
|
||||
|
||||
(my $program_name = $0) =~ s|.*/||;
|
||||
|
||||
# Turn off localisation of executable's ouput.
|
||||
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
|
||||
|
||||
my $d = "dir-$$";
|
||||
my $mkdir = {PRE => sub {mkdir $d,0100 or die "$d: $!\n"}};
|
||||
my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
|
||||
|
||||
my @Tests =
|
||||
(
|
||||
# test-name options input expected-output
|
||||
#
|
||||
['unreadable-1', '-rf', $d,
|
||||
{EXIT => 1}, {ERR => "$prog: $d/.: Permission denied\n"}, $mkdir],
|
||||
['unreadable-2', '-rf', $d,
|
||||
{EXIT => 1},
|
||||
{ERR => "$prog: $d/.: Permission denied\n" .
|
||||
"$prog: cannot remove directory `$d': File exists\n"},
|
||||
{PRE => sub { (mkdir $d,0700 and mkdir "$d/x",0700 and chmod 0100,$d)
|
||||
or die "$d: $!\n"}} ],
|
||||
);
|
||||
|
||||
my $save_temps = $ENV{SAVE_TEMPS};
|
||||
my $verbose = $ENV{VERBOSE};
|
||||
|
||||
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
|
||||
exit $fail;
|
||||
EOF
|
||||
Reference in New Issue
Block a user