[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "make check" failure with sort-compress on OSF and Linux
From: |
Paul Eggert |
Subject: |
Re: "make check" failure with sort-compress on OSF and Linux |
Date: |
Sat, 24 Feb 2007 03:19:19 -0800 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Jim Meyering <address@hidden> writes:
> my jaw hit the floor when I saw the 500+ gzip zombies
> left hanging while I'm at a breakpoint in merge.
Here's a patch to disable compression by default, so that we can get a
more-stable version out the door. It also removes the findprog
module, which should be one less thing to worry about porting.
2007-02-24 Paul Eggert <address@hidden>
* NEWS: sort no longer compress temporaries by default.
* bootstrap.conf: Remove findprog.
* doc/coreutils.texi (sort invocation): The default is to not
compress. Don't treat "" specially.
* src/sort.c: Don't include findprog.h.
(create_temp): Compress only if the user specified --compress-program.
* tests/misc/sort-compress: Adjusts tests to match new behavior.
diff --git a/NEWS b/NEWS
index a099877..96ebd82 100644
--- a/NEWS
+++ b/NEWS
@@ -44,10 +44,9 @@ GNU coreutils NEWS -*-
outline -*-
** New features
- By default, sort usually compresses each temporary file it writes.
+ sort's new --compress-program=PROG option specifies a compression
+ program to use when writing and reading temporary files.
This can help save both time and disk space when sorting large inputs.
- The default compression program is gzip, but this can be overridden
- with sort's new --compress-program=PROG option.
** New features
diff --git a/bootstrap.conf b/bootstrap.conf
index e94478a..c54b035 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -44,7 +44,7 @@ gnulib_modules="
config-h configmake
closeout cycle-check d-ino d-type diacrit dirfd dirname dup2
error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl
- file-type fileblocks filemode filenamecat findprog fnmatch-gnu
+ file-type fileblocks filemode filenamecat fnmatch-gnu
fopen-safer
fprintftime fsusage ftruncate fts getdate getgroups gethrxtime
getline getloadavg getndelim2 getopt getpagesize getpass-gnu
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 04c1b4e..99412e4 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -3634,9 +3634,7 @@ Other options are:
@table @samp
@item address@hidden
-If @var{prog} is not the empty string, compress any temporary files
-with the program @var{prog} rather than with the default compression
-method. The default is currently @command{gzip} but this may change.
+Compress any temporary files with the program @var{prog}.
With no arguments, @var{prog} must compress standard input to standard
output, and when given the @option{-d} option it must decompress
@@ -3647,9 +3645,6 @@ Terminate with an error if @var{prog} exits with nonzero
status.
Whitespace and the backslash character should not appear in
@var{prog}; they are reserved for future use.
-If @var{prog} is the empty string, do not compress temporary
-files.
-
@item -k @var{pos1}[,@var{pos2}]
@itemx address@hidden,@var{pos2}]
@opindex -k
diff --git a/src/sort.c b/src/sort.c
index 6a7de9c..58ca66a 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -30,7 +30,6 @@
#include "system.h"
#include "argmatch.h"
#include "error.h"
-#include "findprog.h"
#include "hard-locale.h"
#include "hash.h"
#include "inttostr.h"
@@ -847,14 +846,7 @@ create_temp (FILE **pfp, pid_t *ppid)
struct tempnode *node = create_temp_file (&tempfd);
char *name = node->name;
- if (! compress_program)
- {
- static char const default_compress_program[] = "gzip";
- char const *prog = find_in_path (default_compress_program);
- compress_program = (prog == default_compress_program ? "" : prog);
- }
-
- if (*compress_program)
+ if (compress_program)
{
int pipefds[2];
@@ -875,8 +867,7 @@ create_temp (FILE **pfp, pid_t *ppid)
dup2_or_die (pipefds[0], STDIN_FILENO);
close (pipefds[0]);
- if (execlp (compress_program, compress_program,
- (char *) NULL) < 0)
+ if (execlp (compress_program, compress_program, (char *) NULL) < 0)
error (SORT_FAILURE, errno, _("couldn't execute %s"),
compress_program);
}
@@ -925,8 +916,7 @@ open_temp (const char *name, pid_t pid)
dup2_or_die (pipefds[1], STDOUT_FILENO);
close (pipefds[1]);
- if (execlp (compress_program, compress_program,
- "-d", (char *) NULL) < 0)
+ if (execlp (compress_program, compress_program, "-d", (char *) NULL) < 0)
error (SORT_FAILURE, errno, _("couldn't execute %s -d"),
compress_program);
}
diff --git a/tests/misc/sort-compress b/tests/misc/sort-compress
index b0f4dd7..0cafb2e 100755
--- a/tests/misc/sort-compress
+++ b/tests/misc/sort-compress
@@ -57,14 +57,14 @@ EOF
chmod +x gzip
# This will find our new gzip in PATH
-PATH=.:$PATH sort -S 1k in > out || fail=1
+PATH=.:$PATH sort -S 1k --compress-program=gzip in > out || fail=1
cmp exp out || fail=1
test $fail = 1 && diff out exp 2> /dev/null
test -f ok || fail=1
rm -f ok
-# This is to make sure we can disable compression
-PATH=.:$PATH sort --compress-program= -S 1k in > out || fail=1
+# This is to make sure it works with no compression.
+PATH=.:$PATH sort -S 1k in > out || fail=1
cmp exp out || fail=1
test $fail = 1 && diff out exp 2> /dev/null
test -f ok && fail=1
M ChangeLog
M NEWS
M bootstrap.conf
M doc/coreutils.texi
M src/sort.c
M tests/misc/sort-compress
Committed as be58204c66dc36ea36fe93b4542e1b664cc4f172
- Re: one last snapshot before test release, (continued)
- Re: one last snapshot before test release, Matthew Woehlke, 2007/02/21
- "make check" failure with sort-compress on OSF and Linux, Paul Eggert, 2007/02/22
- Re: "make check" failure with sort-compress on OSF and Linux, Jim Meyering, 2007/02/22
- Re: "make check" failure with sort-compress on OSF and Linux, Dan Hipschman, 2007/02/22
- Re: "make check" failure with sort-compress on OSF and Linux, Jim Meyering, 2007/02/23
- Re: "make check" failure with sort-compress on OSF and Linux, Dan Hipschman, 2007/02/23
- Re: "make check" failure with sort-compress on OSF and Linux,
Paul Eggert <=
- Re: "make check" failure with sort-compress on OSF and Linux, Jim Meyering, 2007/02/24
- Re: "make check" failure with sort-compress on OSF and Linux, Matthew Woehlke, 2007/02/26
- Re: "make check" failure with sort-compress on OSF and Linux, Matthew Woehlke, 2007/02/23