Compare commits

...

79 Commits

Author SHA1 Message Date
Jim Meyering
843b44b3f7 *** empty log message *** 1998-10-18 01:50:53 +00:00
Jim Meyering
5edb65b5c4 . 1998-10-18 01:49:44 +00:00
Jim Meyering
a71cb7cad1 Declare localtime_r if necessary. 1998-10-18 01:11:35 +00:00
Jim Meyering
e2d1b297e7 Declare localtime_r if necessary. 1998-10-18 01:10:21 +00:00
Jim Meyering
70bea7fd3e *** empty log message *** 1998-10-18 01:08:54 +00:00
Jim Meyering
ec936db8d7 (jm_CHECK_DECLS): Reflect interface change.
(jm_CHECK_DECL_LOCALTIME_R): New macro.
1998-10-18 01:08:22 +00:00
Jim Meyering
2b69ce2d89 (jm_CHECK_DECLARATION): Don't hard-code which headers to
include, though we still hard-code the `require'-like AC_CHECK_HEADERS
calls for those previously hard-coded headers.  Instead, take a new parameter.
(jm_CHECK_DECLARATIONS): Reflect interface change.
1998-10-18 01:07:17 +00:00
Jim Meyering
0a25bc498d Test for spring-forward gap before long-running test. 1998-10-18 00:58:07 +00:00
Jim Meyering
6cc7e13732 (run_tests): Run $prog with --version only if $verbose. 1998-10-17 12:47:21 +00:00
Jim Meyering
0e1c643956 *** empty log message *** 1998-10-17 12:39:57 +00:00
Jim Meyering
2e29b32116 Some systems require <unistd.h> to be included before <time.h> for
localtime_r to be declared properly.
1998-10-17 12:39:30 +00:00
Jim Meyering
082787996c Use the more portable "TZ=PST8PDT,M4.1.0,M10.5.0"
instead of "TZ=America/Vancouver".  From Paul Eggert.
1998-10-14 21:27:52 +00:00
Jim Meyering
edef42bf40 *** empty log message *** 1998-10-12 03:51:35 +00:00
Jim Meyering
efce5c3bdf . 1998-10-12 03:50:44 +00:00
Jim Meyering
18ac22d2fc . 1998-10-12 03:50:24 +00:00
Jim Meyering
c20eae80c7 add jm_ prefix to cache variable 1998-10-12 03:20:21 +00:00
Jim Meyering
6f43239736 *** empty log message *** 1998-10-12 02:56:35 +00:00
Jim Meyering
c6b7de061f *** empty log message *** 1998-10-12 02:55:35 +00:00
Jim Meyering
10d64e02c4 Require jm_AM_FUNC_MKTIME, not AM_FUNC_MKTIME. 1998-10-12 02:55:28 +00:00
Jim Meyering
852a30165b (jm_AM_FUNC_MKTIME): New file and macro. 1998-10-12 02:55:17 +00:00
Jim Meyering
e4d0cf679c . 1998-10-12 02:51:10 +00:00
Jim Meyering
57c0968203 *** empty log message *** 1998-10-12 02:51:01 +00:00
Jim Meyering
761ed79f4d (_REENTRANT): Define again -- linux-2.0.33 needs it. 1998-10-12 02:00:59 +00:00
Jim Meyering
f49ea966c3 *** empty log message *** 1998-10-12 01:18:08 +00:00
Jim Meyering
8c6d49c84d *** empty log message *** 1998-10-11 23:04:04 +00:00
Jim Meyering
061a10d1ff (__mktime_internal): When the requested time falls
in a spring-forward gap of size DT, return a time that is DT
away from the requested time, preferring a time whose tm_isdst
differs from the requested value.  Bump the max number of
probes from 4 to 6 to account for the extra probes needed to
discover a spring-forward gap in the worst case.
1998-10-11 23:03:41 +00:00
Jim Meyering
787dfe9c83 . 1998-10-10 18:38:05 +00:00
Jim Meyering
9e3949fa6f . 1998-10-10 18:37:44 +00:00
Jim Meyering
62b64a0e92 *** empty log message *** 1998-10-08 12:24:40 +00:00
Jim Meyering
37c289ea31 (my_mktime_localtime_r): Renamed from localtime_r.
Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
a body that merely expands localtime_r; this works around a
bug in Digital Unix 4.0A and 4.0D.
1998-10-08 12:19:48 +00:00
Jim Meyering
297a13a5a3 import 1.5b 1998-10-06 04:07:25 +00:00
Jim Meyering
2aae4df6ef *** empty log message *** 1998-10-05 12:27:03 +00:00
Jim Meyering
8670ecb6cb (long_options): Add entry for --suffix=SUFFIX option. 1998-10-05 12:23:21 +00:00
Jim Meyering
1b1bcc5e29 *** empty log message *** 1998-10-05 04:30:40 +00:00
Jim Meyering
03d1ff2dea *** empty log message *** 1998-10-05 04:24:42 +00:00
Jim Meyering
1381664a56 . 1998-10-05 04:21:39 +00:00
Jim Meyering
3ed45d5062 back out last change 1998-10-05 04:20:33 +00:00
Jim Meyering
dfd3465715 half-hearted attempt to support file name quoting 1998-10-05 04:20:12 +00:00
Jim Meyering
86488adef8 *** empty log message *** 1998-10-05 04:05:41 +00:00
Jim Meyering
3564013e18 add double quotes 1998-10-05 03:34:17 +00:00
Jim Meyering
a019f34623 (TESTS_ENVIRONMENT): Define PERL. 1998-10-05 03:30:41 +00:00
Jim Meyering
0e2247a55b *** empty log message *** 1998-10-04 13:53:18 +00:00
Jim Meyering
253d68786d *** empty log message *** 1998-10-04 13:50:52 +00:00
Jim Meyering
f6a19e2c78 . 1998-10-04 13:15:15 +00:00
Jim Meyering
f7880af3db . 1998-10-04 03:23:24 +00:00
Jim Meyering
ce55ab29b1 . 1998-10-04 03:11:32 +00:00
Jim Meyering
6bbbdce4d8 *** empty log message *** 1998-10-04 03:08:54 +00:00
Jim Meyering
5027e9d281 *** empty log message *** 1998-10-04 03:06:22 +00:00
Jim Meyering
701e23d1e4 (split_3): Rename local variable, to `escaped_filename'.
(main): Output the leading backslash not just when there's a newline
in the file name, but also when there's a backslash.
1998-10-04 03:05:37 +00:00
Jim Meyering
516e60ed10 Add tests with filenames containing newline and backslash characters. 1998-10-04 03:01:12 +00:00
Jim Meyering
61c04cdaed use debug, not verbose 1998-10-04 02:54:15 +00:00
Jim Meyering
3d58b592ed rewrite for Fetish.pm 1998-10-04 02:51:30 +00:00
Jim Meyering
71aa0114bb . 1998-10-04 02:45:26 +00:00
Jim Meyering
cbd698b247 . 1998-10-04 01:08:18 +00:00
Jim Meyering
bf887b6800 . 1998-10-04 01:04:55 +00:00
Jim Meyering
d8827d033a *** empty log message *** 1998-10-04 01:03:51 +00:00
Jim Meyering
434df90510 (TESTS_ENVIRONMENT): Add PATH. 1998-10-04 01:03:26 +00:00
Jim Meyering
483b1367bc *** empty log message *** 1998-10-03 19:51:36 +00:00
Jim Meyering
df694b9339 . 1998-10-03 19:50:10 +00:00
Jim Meyering
dcd55a5277 . 1998-10-03 19:47:20 +00:00
Jim Meyering
742600e30d Invoke program with --manhelp option only if
--name=STRING not specified.  Otherwise, this would fail with `yes'.
1998-10-03 19:15:41 +00:00
Jim Meyering
62db78c613 *** empty log message *** 1998-10-03 17:39:49 +00:00
Jim Meyering
f439fa811c . 1998-10-03 17:27:28 +00:00
Jim Meyering
169bead160 . 1998-10-03 17:21:02 +00:00
Jim Meyering
2ebff08169 (main): Update to use new version of posixtime. 1998-10-03 17:18:52 +00:00
Jim Meyering
5b1af11410 . 1998-10-03 16:49:01 +00:00
Jim Meyering
62ff4ae63c Make `VERBOSE' be a little more verbose. 1998-10-03 16:47:44 +00:00
Jim Meyering
9ef5ce0581 (TESTS): Add i-1. 1998-10-03 16:46:27 +00:00
Jim Meyering
d21a17dbb4 . 1998-10-03 16:45:10 +00:00
Jim Meyering
cfd0d53368 . 1998-10-03 05:00:26 +00:00
Jim Meyering
432e6df3e4 Include /bin/sh driver framework. 1998-10-03 04:59:26 +00:00
Jim Meyering
95fd28c290 *** empty log message *** 1998-10-03 04:58:28 +00:00
Jim Meyering
2239a0ff2c . 1998-10-03 04:58:21 +00:00
Jim Meyering
0345ac460a . 1998-10-03 04:54:54 +00:00
Jim Meyering
8b0f15401b . 1998-10-03 04:52:09 +00:00
Jim Meyering
af988b5428 . 1998-10-03 04:43:55 +00:00
Jim Meyering
2e4ebbf522 *** empty log message *** 1998-10-02 14:31:24 +00:00
Jim Meyering
84fd56fe2a *** empty log message *** 1998-10-02 14:31:11 +00:00
Jim Meyering
a23ce11f2a latest from ftp.gnu.org 1998-10-02 03:21:04 +00:00
108 changed files with 1879 additions and 1418 deletions

View File

@@ -50,7 +50,8 @@ THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
PREV_VERSION := $(shell echo $(VERSION)|tr a-z Xa-y)
PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
v = Version
url = ftp://alpha.gnu.org/gnu/fetish/$(distdir).tar.gz
url-host-prefix = ftp://alpha.gnu.org
url = $(url-host-prefix)/gnu/fetish/$(distdir).tar.gz
md5 = $(shell md5sum < $(distdir).tar.gz|sed 's/ -//')
rel-check:
@@ -87,7 +88,7 @@ alpha:
ln $(distdir).tar.gz ../release
chmod a-w $(distdir).tar.gz
@echo =====================================
@echo 'ncftp -u $(dir $(url))'
@echo 'ncftp -u $(url-host-prefix)/fs/share/ftp/gnu/fetish/'
@echo '# put $(distdir).tar.gz'
@echo '# send the /tmp/announcement e-mail'
@echo 'pot-mail $(distdir).tar.gz | bash'

2
THANKS
View File

@@ -2,7 +2,9 @@ This is just a start at listing e-mail addresses of contributors.
The rest of the addresses are still in the ChangeLog.
Achim Blumensath: blume@corona.oche.de
aldomel: aldomel@ix.netcom.com
Akim Demaille: demaille@inf.enst.fr
Andreas Jaeger: jaeger@gnu.org
Andreas Schwab: schwab@issan.informatik.uni-dortmund.de
Andries Brouwer: Andries.Brouwer@cwi.nl
Arne Henrik Juul: arnej@imf.unit.no

File diff suppressed because it is too large Load Diff

View File

@@ -29,8 +29,8 @@
#endif
/* Some systems need this in order to declare localtime_r properly. */
#ifndef _REENTRANT
# define _REENTRANT 1
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
#ifdef _LIBC
@@ -49,6 +49,11 @@
#include <sys/types.h> /* Some systems define `time_t' here. */
#include <time.h>
/* Provide a declaration of localtime_r on systems that lack it. */
#if ! defined HAVE_DECL_LOCALTIME_R
extern struct tm* localtime_r ();
#endif
#if HAVE_LIMITS_H
# include <limits.h>
#endif
@@ -127,22 +132,33 @@ time_t __mktime_internal __P ((struct tm *,
#ifdef _LIBC
# define localtime_r __localtime_r
#else
# if ! HAVE_LOCALTIME_R && ! defined localtime_r
/* Approximate localtime_r as best we can in its absence. */
# define localtime_r my_mktime_localtime_r
static struct tm *localtime_r __P ((const time_t *, struct tm *));
# if HAVE_LOCALTIME_R == defined localtime_r
/* Provide our own substitute for a missing or possibly broken localtime_r. */
static struct tm *my_mktime_localtime_r __P ((const time_t *, struct tm *));
static struct tm *
localtime_r (t, tp)
my_mktime_localtime_r (t, tp)
const time_t *t;
struct tm *tp;
{
# ifdef localtime_r
/* Digital Unix 4.0A and 4.0D have a macro localtime_r with the
standard meaning, along with an unwanted, nonstandard function
localtime_r. The placeholder function my_mktime_localtime_r
invokes the macro; use that instead of the system's bogus
localtime_r. */
return localtime_r (t, tp);
# undef localtime_r
# else /* ! defined (localtime_r) */
/* Approximate localtime_r as best we can in its absence. */
struct tm *l = localtime (t);
if (! l)
return 0;
*tp = *l;
return tp;
# endif /* ! defined localtime_r */
}
# endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */
# define localtime_r my_mktime_localtime_r
# endif /* HAVE_LOCALTIME_R == defined localtime_r */
#endif /* ! _LIBC */
@@ -259,14 +275,14 @@ __mktime_internal (tp, convert, offset)
struct tm *(*convert) __P ((const time_t *, struct tm *));
time_t *offset;
{
time_t t, dt, t0;
time_t t, dt, t0, t1, t2;
struct tm tm;
/* The maximum number of probes (calls to CONVERT) should be enough
to handle any combinations of time zone rule changes, solar time,
and leap seconds. POSIX.1 prohibits leap seconds, but some hosts
have them anyway. */
int remaining_probes = 4;
leap seconds, and oscillations around a spring-forward gap.
POSIX.1 prohibits leap seconds, but some hosts have them anyway. */
int remaining_probes = 6;
/* Time requested. Copy it in case CONVERT modifies *TP; this can
occur if TP is localtime's returned value and CONVERT is localtime. */
@@ -312,15 +328,27 @@ __mktime_internal (tp, convert, offset)
tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm);
for (t = t0 + *offset;
for (t = t1 = t2 = t0 + *offset;
(dt = ydhms_tm_diff (year, yday, hour, min, sec,
ranged_convert (convert, &t, &tm)));
t += dt)
if (--remaining_probes == 0)
t1 = t2, t2 = t, t += dt)
if (t == t1 && t != t2
&& (isdst < 0 || tm.tm_isdst < 0
|| (isdst != 0) != (tm.tm_isdst != 0)))
/* We can't possibly find a match, as we are oscillating
between two values. The requested time probably falls
within a spring-forward gap of size DT. Follow the common
practice in this case, which is to return a time that is DT
away from the requested time, preferring a time whose
tm_isdst differs from the requested value. In practice,
this is more useful than returning -1. */
break;
else if (--remaining_probes == 0)
return -1;
/* Check whether tm.tm_isdst has the requested value, if any. */
if (0 <= isdst && 0 <= tm.tm_isdst)
/* If we have a match, check whether tm.tm_isdst has the requested
value, if any. */
if (dt == 0 && 0 <= isdst && 0 <= tm.tm_isdst)
{
int dst_diff = (isdst != 0) - (tm.tm_isdst != 0);
if (dst_diff)

View File

@@ -1,4 +1,4 @@
/* Parse dates for touch.
/* Parse dates for touch and date.
Copyright (C) 1989, 1990, 1991, 1998 Free Software Foundation Inc.
This program is free software; you can redistribute it and/or modify

View File

@@ -1,242 +0,0 @@
/* Parse dates for touch.
Copyright (C) 1989, 1990, 1991 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Jim Kingdon and David MacKenzie. */
%{
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* The following block of alloca-related preprocessor directives is here
solely to allow compilation by non GNU-C compilers of the C parser
produced from this file by old versions of bison. Newer versions of
bison include a block similar to this one in bison.simple. */
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else
#ifdef _AIX
#pragma alloca
#else
void *alloca ();
#endif
#endif
#endif
#include <stdio.h>
#include <sys/types.h>
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif
/* Some old versions of bison generate parsers that use bcopy.
That loses on systems that don't provide the function, so we have
to redefine it here. */
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
#define bcopy(from, to, len) memcpy ((to), (from), (len))
#endif
#define YYDEBUG 1
/* Lexical analyzer's current scan position in the input string. */
static char *curpos;
/* The return value. */
static struct tm t;
time_t mktime ();
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
yacc generated parsers in the same program. Note that these are only
the variables produced by yacc. If other parser generators (bison,
byacc, etc) produce additional global names that conflict at link time,
then those parser generators need to be fixed instead of adding those
names to this list. */
#define yymaxdepth pt_maxdepth
#define yyparse pt_parse
#define yylex pt_lex
#define yyerror pt_error
#define yylval pt_lval
#define yychar pt_char
#define yydebug pt_debug
#define yypact pt_pact
#define yyr1 pt_r1
#define yyr2 pt_r2
#define yydef pt_def
#define yychk pt_chk
#define yypgo pt_pgo
#define yyact pt_act
#define yyexca pt_exca
#define yyerrflag pt_errflag
#define yynerrs pt_nerrs
#define yyps pt_ps
#define yypv pt_pv
#define yys pt_s
#define yy_yys pt_yys
#define yystate pt_state
#define yytmp pt_tmp
#define yyv pt_v
#define yy_yyv pt_yyv
#define yyval pt_val
#define yylloc pt_lloc
#define yyreds pt_reds /* With YYDEBUG defined */
#define yytoks pt_toks /* With YYDEBUG defined */
#define yylhs pt_yylhs
#define yylen pt_yylen
#define yydefred pt_yydefred
#define yydgoto pt_yydgoto
#define yysindex pt_yysindex
#define yyrindex pt_yyrindex
#define yygindex pt_yygindex
#define yytable pt_yytable
#define yycheck pt_yycheck
static int yylex ();
static int yyerror ();
%}
%token DIGIT
%%
date :
digitpair /* month */
digitpair /* day */
digitpair /* hours */
digitpair /* minutes */
year
seconds {
if ($1 >= 1 && $1 <= 12)
t.tm_mon = $1 - 1;
else {
YYABORT;
}
if ($2 >= 1 && $2 <= 31)
t.tm_mday = $2;
else {
YYABORT;
}
if ($3 >= 0 && $3 <= 23)
t.tm_hour = $3;
else {
YYABORT;
}
if ($4 >= 0 && $4 <= 59)
t.tm_min = $4;
else {
YYABORT;
}
}
year : digitpair {
t.tm_year = $1;
/* Deduce the century based on the year.
See POSIX.2 section 4.63.3. */
if ($1 <= 68)
t.tm_year += 100;
}
| digitpair digitpair {
t.tm_year = $1 * 100 + $2;
if (t.tm_year < 1900) {
YYABORT;
} else
t.tm_year -= 1900;
}
| /* empty */ {
time_t now;
struct tm *tmp;
/* Use current year. */
time (&now);
tmp = localtime (&now);
t.tm_year = tmp->tm_year;
}
;
seconds : /* empty */ {
t.tm_sec = 0;
}
| '.' digitpair {
if ($2 >= 0 && $2 <= 61)
t.tm_sec = $2;
else {
YYABORT;
}
}
;
digitpair : DIGIT DIGIT {
$$ = $1 * 10 + $2;
}
;
%%
static int
yylex ()
{
char ch = *curpos++;
if (ch >= '0' && ch <= '9')
{
yylval = ch - '0';
return DIGIT;
}
else if (ch == '.' || ch == 0)
return ch;
else
return '?'; /* Cause an error. */
}
static int
yyerror ()
{
return 0;
}
/* Parse a POSIX-style date and return it, or (time_t)-1 for an error. */
time_t
posixtime (s)
char *s;
{
curpos = s;
/* Let mktime decide whether it is daylight savings time. */
t.tm_isdst = -1;
if (yyparse ())
return (time_t)-1;
else
return mktime (&t);
}
/* Parse a POSIX-style date and return it, or NULL for an error. */
struct tm *
posixtm (s)
char *s;
{
if (posixtime (s) == -1)
return NULL;
return &t;
}

View File

@@ -48,6 +48,11 @@
#include <ctype.h>
#include <sys/types.h> /* Some systems define `time_t' here. */
/* Provide a declaration of localtime_r on systems that lack it. */
#if ! defined HAVE_DECL_LOCALTIME_R
extern struct tm* localtime_r ();
#endif
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>

View File

@@ -1,3 +1,26 @@
1998-10-17 Jim Meyering <meyering@ascend.com>
* decl.m4 (jm_CHECK_DECLARATION): Don't hard-code which headers to
include, though we still hard-code the `require'-like AC_CHECK_HEADERS
calls for those previously hard-coded headers. Instead, take a new
parameter.
(jm_CHECK_DECLARATIONS): Reflect interface change.
* check-decl.m4 (jm_CHECK_DECLS): Likewise.
(jm_CHECK_DECL_LOCALTIME_R): New macro.
* mktime.m4: Test for spring-forward gap before long-running test.
1998-10-14 Jim Meyering <meyering@ascend.com>
* mktime.m4: Use the more portable "TZ=PST8PDT,M4.1.0,M10.5.0"
instead of "TZ=America/Vancouver". From Paul Eggert.
1998-10-11 Jim Meyering <meyering@ascend.com>
* mktime.m4 (jm_AM_FUNC_MKTIME): New file and macro.
This adds a test for a recently added compatibility fix for mktime.c.
* jm-mktime.m4: Require jm_AM_FUNC_MKTIME, not AM_FUNC_MKTIME.
1998-09-27 Jim Meyering <meyering@ascend.com>
* jm-macros.m4 (jm_MACROS): Require jm_FUNC_FNMATCH.

View File

@@ -6,8 +6,8 @@ chown.m4 const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 fnmatch.m4 \
fstypename.m4 getgroups.m4 getline.m4 getloadavg.m4 gettext.m4 glibc.m4 \
inttypes_h.m4 isc-posix.m4 jm-glibc-io.m4 jm-macros.m4 jm-mktime.m4 \
jm-winsz1.m4 jm-winsz2.m4 lchown.m4 lcmessage.m4 lfs.m4 ls-mntd-fs.m4 \
lstat.m4 malloc.m4 memcmp.m4 perl.m4 prereq.m4 progtest.m4 putenv.m4 \
readdir.m4 realloc.m4 regex.m4 st_dm_mode.m4 st_mtim.m4 stat.m4 \
lstat.m4 malloc.m4 memcmp.m4 mktime.m4 perl.m4 prereq.m4 progtest.m4 \
putenv.m4 readdir.m4 realloc.m4 regex.m4 st_dm_mode.m4 st_mtim.m4 stat.m4 \
strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4 utime.m4 utimes.m4
##m4-files-end

View File

@@ -95,8 +95,8 @@ chown.m4 const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 fnmatch.m4 \
fstypename.m4 getgroups.m4 getline.m4 getloadavg.m4 gettext.m4 glibc.m4 \
inttypes_h.m4 isc-posix.m4 jm-glibc-io.m4 jm-macros.m4 jm-mktime.m4 \
jm-winsz1.m4 jm-winsz2.m4 lchown.m4 lcmessage.m4 lfs.m4 ls-mntd-fs.m4 \
lstat.m4 malloc.m4 memcmp.m4 perl.m4 prereq.m4 progtest.m4 putenv.m4 \
readdir.m4 realloc.m4 regex.m4 st_dm_mode.m4 st_mtim.m4 stat.m4 \
lstat.m4 malloc.m4 memcmp.m4 mktime.m4 perl.m4 prereq.m4 progtest.m4 \
putenv.m4 readdir.m4 realloc.m4 regex.m4 st_dm_mode.m4 st_mtim.m4 stat.m4 \
strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4 utime.m4 utimes.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h

View File

@@ -1,10 +1,29 @@
#serial 2
#serial 3
dnl This is just a wrapper function to encapsulate this kludge.
dnl Putting it in a separate file like this helps share it between
dnl different packages.
AC_DEFUN(jm_CHECK_DECLS,
[
headers='
#include <stdio.h>
#ifdef HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#else
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
'
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put entries
@@ -14,5 +33,44 @@ AC_DEFUN(jm_CHECK_DECLS,
AC_CHECK_FUNCS(DECL_FREE DECL_LSEEK DECL_MALLOC DECL_MEMCHR DECL_REALLOC \
DECL_STPCPY DECL_STRSTR)
fi
jm_CHECK_DECLARATIONS(free lseek malloc memchr realloc stpcpy strstr)
jm_CHECK_DECLARATIONS($headers, free lseek malloc \
memchr realloc stpcpy strstr)
# Check for a declaration of localtime_r.
jm_CHECK_DECL_LOCALTIME_R
])
dnl localtime_r is a special case...
dnl Code that uses the result of this test must use the same cpp
dnl directives as are used below. Also include the following declaration
dnl after the inclusion of time.h.
dnl
dnl #if ! defined HAVE_DECL_LOCALTIME_R
dnl extern struct tm* localtime_r ();
dnl #endif
AC_DEFUN(jm_CHECK_DECL_LOCALTIME_R,
[
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put entries
dnl for each of these symbols in the config.h.in.
dnl Otherwise, I'd have to update acconfig.h every time I change
dnl this list of functions.
AC_CHECK_FUNCS(DECL_LOCALTIME_R)
fi
headers='
/* Some systems need this in order to declare localtime_r properly. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h>
#include <time.h>
'
jm_CHECK_DECLARATIONS($headers, localtime_r)
])

View File

@@ -1,4 +1,4 @@
#serial 2
#serial 3
AC_DEFUN(jm_CHECK_DECLARATION,
[
@@ -10,24 +10,7 @@ AC_DEFUN(jm_CHECK_DECLARATION,
test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h)
AC_MSG_CHECKING([whether $1 is declared])
AC_CACHE_VAL(jm_cv_func_decl_$1,
[AC_TRY_COMPILE([
#include <stdio.h>
#ifdef HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#else
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif],
[AC_TRY_COMPILE($2,
[
#ifndef $1
char *(*pfn) = (char *(*)) $1
@@ -38,23 +21,23 @@ char *(*pfn) = (char *(*)) $1
if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
ifelse([$3], , :, [$3])
else
AC_MSG_RESULT(no)
ifelse([$3], , , [$3
ifelse([$4], , , [$4
])dnl
fi
])dnl
dnl jm_CHECK_DECLARATIONS(FUNCTION... [, ACTION-IF-DECLARED
dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
dnl [, ACTION-IF-NOT-DECLARED]])
AC_DEFUN(jm_CHECK_DECLARATIONS,
[
for jm_func in $1
for jm_func in $2
do
jm_CHECK_DECLARATION($jm_func,
jm_CHECK_DECLARATION($jm_func, $1,
[
jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
AC_DEFINE_UNQUOTED($jm_tr_func) $2], $3)dnl
AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
done
])

View File

@@ -7,12 +7,12 @@ dnl /* Define to rpl_mktime if the replacement function should be used. */
dnl #undef mktime
dnl
AC_DEFUN(jm_FUNC_MKTIME,
[AC_REQUIRE([AM_FUNC_MKTIME])dnl
[AC_REQUIRE([jm_AM_FUNC_MKTIME])dnl
dnl mktime.c uses localtime_r if it exists. Check for it.
AC_CHECK_FUNCS(localtime_r)
if test $am_cv_func_working_mktime = no; then
if test $jm_am_cv_func_working_mktime = no; then
AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
fi
])

166
m4/mktime.m4 Normal file
View File

@@ -0,0 +1,166 @@
#serial 1001
dnl Just like mktime.m4 from automake-1.3b, but with an additional test.
dnl Renamed to have jm_ prefix and to use jm_ prefix on cache variable names.
AC_DEFUN(jm_AM_FUNC_MKTIME,
[AC_REQUIRE([AC_HEADER_TIME])dnl
AC_CHECK_HEADERS(sys/time.h unistd.h)
AC_CHECK_FUNCS(alarm)
AC_CACHE_CHECK([for working mktime], jm_am_cv_func_working_mktime,
[AC_TRY_RUN(
changequote(<<, >>)dnl
<</* Test program from Paul Eggert (eggert@twinsun.com)
and Tony Leneis (tony@plaza.ds.adp.com). */
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#if !HAVE_ALARM
# define alarm(X) /* empty */
#endif
/* Work around redefinition to rpl_putenv by other config tests. */
#undef putenv
static time_t time_t_max;
/* Values we'll use to set the TZ environment variable. */
static const char *const tz_strings[] = {
(const char *) 0, "TZ=GMT0", "TZ=JST-9",
"TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
};
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
/* Fail if mktime fails to convert a date in the spring-forward gap.
Based on a problem report from Andreas Jaeger. */
static void
spring_forward_gap ()
{
/* glibc (up to about 1998-10-07) failed this test) */
struct tm tm;
/* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
instead of "TZ=America/Vancouver" in order to detect the bug even
on systems that don't support the Olson extension, or don't have the
full zoneinfo tables installed. */
putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
tm.tm_year = 98;
tm.tm_mon = 3;
tm.tm_mday = 5;
tm.tm_hour = 2;
tm.tm_min = 0;
tm.tm_sec = 0;
tm.tm_isdst = -1;
if (mktime (&tm) == (time_t)-1)
exit (1);
}
static void
mktime_test (now)
time_t now;
{
struct tm *lt;
if ((lt = localtime (&now)) && mktime (lt) != now)
exit (1);
now = time_t_max - now;
if ((lt = localtime (&now)) && mktime (lt) != now)
exit (1);
}
static void
irix_6_4_bug ()
{
/* Based on code from Ariel Faigon. */
struct tm tm;
tm.tm_year = 96;
tm.tm_mon = 3;
tm.tm_mday = 0;
tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;
tm.tm_isdst = -1;
mktime (&tm);
if (tm.tm_mon != 2 || tm.tm_mday != 31)
exit (1);
}
static void
bigtime_test (j)
int j;
{
struct tm tm;
time_t now;
tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
/* This test makes some buggy mktime implementations loop.
Give up after 10 seconds. */
alarm (10);
now = mktime (&tm);
alarm (0);
if (now != (time_t) -1)
{
struct tm *lt = localtime (&now);
if (! (lt
&& lt->tm_year == tm.tm_year
&& lt->tm_mon == tm.tm_mon
&& lt->tm_mday == tm.tm_mday
&& lt->tm_hour == tm.tm_hour
&& lt->tm_min == tm.tm_min
&& lt->tm_sec == tm.tm_sec
&& lt->tm_yday == tm.tm_yday
&& lt->tm_wday == tm.tm_wday
&& ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
== (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
exit (1);
}
}
int
main ()
{
time_t t, delta;
int i, j;
spring_forward_gap ();
for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
continue;
time_t_max--;
delta = time_t_max / 997; /* a suitable prime number */
for (i = 0; i < N_STRINGS; i++)
{
if (tz_strings[i])
putenv (tz_strings[i]);
for (t = 0; t <= time_t_max - delta; t += delta)
mktime_test (t);
mktime_test ((time_t) 60 * 60);
mktime_test ((time_t) 60 * 60 * 24);
for (j = 1; 0 < j; j *= 2)
bigtime_test (j);
bigtime_test (j - 1);
}
irix_6_4_bug ();
exit (0);
}
>>,
changequote([, ])dnl
jm_am_cv_func_working_mktime=yes, jm_am_cv_func_working_mktime=no,
dnl When crosscompiling, assume mktime is missing or broken.
jm_am_cv_func_working_mktime=no)
])
if test $jm_am_cv_func_working_mktime = no; then
LIBOBJS="$LIBOBJS mktime.o"
fi
])

2
man/basename.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/cat.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/chroot.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/cksum.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/comm.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/csplit.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/cut.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/date.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/dirname.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/echo.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/env.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/expand.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/expr.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/false.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/fmt.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/fold.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/groups.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/head.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

View File

@@ -26,7 +26,7 @@ use strict;
use Getopt::Long;
use POSIX 'strftime';
my $RCS_Id = '$Id: help2man,v 1.1 1998/09/09 13:47:43 meyering Exp $';
my $RCS_Id = '$Id: help2man,v 1.3 1998/10/06 04:07:25 meyering Exp $';
my $this_program = 'help2man';
my $this_version = '0.0';
@@ -129,14 +129,12 @@ if ($include or $opt_include)
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
# Grab help and version paragraphs from executable
my @help = split /\n\n+/, `$ARGV[0] --manhelp 2>/dev/null`;
my @help = split /\n\n+/, `$ARGV[0] --help 2>/dev/null`
or die "$this_program: can't get `--help' info from $ARGV[0]\n";
my @version = split /\n\n+/, `$ARGV[0] --version 2>/dev/null`
or die "$this_program: can't get `--version' info from $ARGV[0]\n";
@help = split /\n\n+/, `$ARGV[0] --help 2>/dev/null`
or die "$this_program: can't get `--help' info from $ARGV[0]\n"
unless @help;
my $date = strftime "%B %Y", localtime;
(my $program = $ARGV[0]) =~ s!.*/!!;
my $package = $program;
@@ -185,14 +183,7 @@ else
$program =~ s!.*/!!;
# Check for name in help output
if ($help[0] =~ s/^(?:name|oneliner):\s*(\S.*)//)
{
($include{NAME} = "$program \\- $1") =~ s/\s+$//;
shift @help unless length $help[0];
}
# --name overrides --include contents and/or --manhelp oneliner
# --name overrides --include contents
$include{NAME} = "$program \\- $opt_name" if $opt_name;
# Default (useless) NAME paragraph

2
man/hostid.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/hostname.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/id.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/join.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/logname.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/md5sum.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/nice.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/nl.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/nohup.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/od.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/paste.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/pathchk.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/pr.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/printenv.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/printf.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/pwd.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/seq.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/sleep.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/sort.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/split.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/stty.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/su.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/sum.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/tac.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/tail.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/tee.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/test.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/tr.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/true.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/tty.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/uname.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/unexpand.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/uniq.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/users.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/wc.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/who.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/whoami.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

2
man/yes.x Normal file
View File

@@ -0,0 +1,2 @@
[DESCRIPTION]
.\" Add any additional description here

View File

@@ -1,3 +1,82 @@
1998-10-17 Jim Meyering <meyering@ascend.com>
* Version 4.0-b4.
* lib/mktime.c: Declare localtime_r if necessary.
* lib/strftime.c: Likewise.
* tests/Fetish.pm (run_tests): Run $prog with --version only
if $verbose.
1998-10-11 Jim Meyering <meyering@ascend.com>
* Version 4.0-b3.
1998-10-08 Paul Eggert <eggert@twinsun.com>
* mktime.c (__mktime_internal): When the requested time falls
in a spring-forward gap of size DT, return a time that is DT
away from the requested time, preferring a time whose tm_isdst
differs from the requested value. Bump the max number of
probes from 4 to 6 to account for the extra probes needed to
discover a spring-forward gap in the worst case.
1998-10-08 Paul Eggert <eggert@twinsun.com>
* mktime.c (my_mktime_localtime_r): Renamed from localtime_r.
Define also if HAVE_LOCALTIME_R && defined (localtime_r), with
a body that merely expands localtime_r; this works around a
bug in Digital Unix 4.0A and 4.0D.
1998-10-05 Jim Meyering <meyering@ascend.com>
* po/Makefile.in.in (uninstall): Remove (historical?) command that
removed po-Makefile.in.in. From Akim Demaille.
* src/install.c (long_options): Add entry for --suffix=SUFFIX option.
From aldomel.
1998-10-04 Jim Meyering <meyering@ascend.com>
* tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL.
From Kaveh Ghazi.
1998-10-03 Jim Meyering <meyering@ascend.com>
* Version 4.0-b2.
* tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH.
* man/Makefile.maint ($(man_MANS)): Don't depend on actual executables.
Instead, depend on corresponding source file and on configure.in.
Based on suggestion and code from Akim Demaille.
Factor out irregular men into Makefile.summ.
* man/Makefile.am (EXTRA_DIST): Add Makefile.summ.
* man/Makefile.summ: New file.
* man/Makefile.maint: Include it.
* tests/Fetish.pm: Make `DEBUG' be a little more verbose.
* tests/mv/Makefile.am (TESTS): Add i-1.
* tests/mv/i-1: New test.
1998-10-02 Jim Meyering <meyering@ascend.com>
* tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test.
* tests/ls-2/run-test: Remove file.
* tests/ls-2/quoting: Include /bin/sh driver framework.
* tests/dircolors/simple: Remove file.
* tests/dircolors/run-test: Embed it here instead.
* tests/dircolors/simple: Rename from run-test.
1998-10-01 Jim Meyering <meyering@ascend.com>
* tests/Makefile.am (EXTRA_DIST): Remove README.
From Akim Demaille.
1998-09-28 Jim Meyering <meyering@ascend.com>
* Version 4.0-pre1.

View File

@@ -1,4 +1,14 @@
Changes in release 3.17:
Changes in release 4.0:
[4.0-b4]
* mktime.c portability tweak for headers with GNU libc 5.4.44.
[4.0-b3]
* mktime.c works around problems with Digital Unix 4.0A and 4.0D.
* mktime.c handles dates in the spring-forward gap the same way other
implementations do
* install accepts long option --suffix=SUFFIX
[4.0-b2]
* man/Makefile.maint framework tweaks
* add test for `mv -i' bug
[4.0-pre1]
* fix serious bug whereby `touch a b; echo n|mv -i a b' would remove b.
[3.16z]

View File

@@ -1,3 +1,33 @@
1998-10-03 Jim Meyering <meyering@ascend.com>
* man/Makefile.am: Switch to using help2man.
(EXTRA_DIST): Add Makefile.summ.
* man/help2man: Invoke program with --manhelp option only if
--name=STRING not specified. Otherwise, this would fail with `yes'.
* man/Makefile.summ: New file.
* man/Makefile.maint: Include it.
* man/help2man: New file.
* man/GNUmakefile: New file.
* man/Makefile.maint: New file.
* man/*.x: New files.
* man/*.1: Remove files.
* src/Makefile.am (install-exec-local): Change comments to use `##'
to avoid automake warning.
* lib/Makefile.am (noinst_HEADERS): s/posixtm.c/posixtm.h/
(libsu_a_SOURCES): s/posixtm.y/posixtm.y/
(libsu_a_SOURCES): Remove getdate.c. Add fnmatch.h.
* src/date.c (main): Update to use new version of posixtime.
* lib/posixtm.c: New file.
* lib/posixtm.h: New file.
* lib/posixtm.y: Remove file.
* lib/fnmatch.c: New file. (unused)
* lib/fnmatch.h: New file. (unused)
1998-09-27 Jim Meyering <meyering@ascend.com>
* src/seq.c (main): Decrement optind when we find an `option' that

View File

@@ -1,3 +1,51 @@
1998-10-04 Jim Meyering <meyering@ascend.com>
* Version 1.22g.
* lib/fnmatch.h: New file. (unused)
* lib/fnmatch.c: New file. (unused)
* lib/Makefile.am (noinst_HEADERS): Add fnmatch.h.
1998-10-03 Jim Meyering <meyering@ascend.com>
* man/Makefile.am: Switch to using help2man.
(EXTRA_DIST): Add Makefile.summ.
* man/help2man: Invoke program with --manhelp option only if
--name=STRING not specified. Otherwise, this would fail with `yes'.
* man/Makefile.summ: New file.
* man/Makefile.maint: Include it.
* man/help2man: New file.
* man/GNUmakefile: New file.
* man/Makefile.maint: New file.
* man/*.x: New files.
* man/*.1: Remove files.
* src/md5sum.c (split_3): Rename local variable, to `escaped_filename'.
(main): Output the leading backslash not just when there's a newline
in the file name, but also when there's a backslash.
Reported by Jim Dennis.
* tests/md5sum/basic-1: Add tests with filenames containing newline
and backslash characters. (for the bug fixed above)
* tests/Makefile.am (EXTRA_DIST): Add Fetish.pm.
* tests/Fetish.pm: New file.
* tests/md5sum/basic-1: New file: rewrite of old tests to use Fetish.pm.
* tests/md5sum/Test.pm: Remove file.
* tests/md5sum/Makefile.am: Rewrite.
1998-09-19 Jim Meyering <meyering@ascend.com>
* src/ptx.c (program_name): Declare *not* to be const.
1998-08-29 Jim Meyering <meyering@ascend.com>
* src/cut.c: Don't assume ASCII.
* src/pr.c: Likewise.
* src/tail.c: Likewise.
1998-08-15 Jim Meyering <meyering@ascend.com>
* src/pr.c (usage): Reformat.

View File

@@ -1,5 +1,6 @@
Changes in release 1.23
[1.22g]
* md5sum can handle file names with embedded backslash characters
* pr accepts long option names (see `pr --help')
* new program: ptx (moved to this package from being its own distribution)
[1.22f]

View File

@@ -27,6 +27,7 @@
#include "getline.h"
#include "error.h"
#include "getdate.h"
#include "posixtm.h"
#ifndef STDC_HEADERS
size_t strftime ();
@@ -37,7 +38,6 @@ int putenv ();
int stime ();
char *xstrdup ();
time_t posixtime ();
static void show_date PARAMS ((const char *format, time_t when));
static void usage PARAMS ((int status));
@@ -307,7 +307,8 @@ argument must be a format string beginning with `+'."),
given in the POSIX-format. */
set_date = 1;
datestr = argv[optind];
when = posixtime (datestr);
when = posixtime (datestr,
PDS_TRAILING_YEAR | PDS_CENTURY | PDS_SECONDS);
format = NULL;
}
else

View File

@@ -193,6 +193,7 @@ static struct option const long_options[] =
{"owner", required_argument, NULL, 'o'},
{"preserve-timestamps", no_argument, NULL, 'p'},
{"backup", no_argument, NULL, 'b'},
{"suffix", required_argument, NULL, 'S'},
{"version-control", required_argument, NULL, 'V'},
{"verbose", no_argument, NULL, 'v'},
{"help", no_argument, &show_help, 1},

View File

@@ -132,7 +132,7 @@ static int
split_3 (char *s, size_t s_len, unsigned char **u, int *binary, char **w)
{
size_t i;
int filename_has_newline = 0;
int escaped_filename = 0;
#define ISWHITE(c) ((c) == ' ' || (c) == '\t')
@@ -150,7 +150,7 @@ split_3 (char *s, size_t s_len, unsigned char **u, int *binary, char **w)
if (s[i] == '\\')
{
++i;
filename_has_newline = 1;
escaped_filename = 1;
}
*u = (unsigned char *) &s[i];
@@ -171,7 +171,7 @@ split_3 (char *s, size_t s_len, unsigned char **u, int *binary, char **w)
significant -- that includes leading and trailing white space. */
*w = &s[i];
if (filename_has_newline)
if (escaped_filename)
{
/* Translate each `\n' string in the file name to a NEWLINE,
and each `\\' string to a backslash. */
@@ -575,8 +575,8 @@ verifying checksums"));
size_t i;
/* Output a leading backslash if the file name contains
a newline. */
if (strchr (file, '\n'))
a newline or backslash. */
if (strchr (file, '\n') || strchr (file, '\\'))
putchar ('\\');
for (i = 0; i < 16; ++i)

View File

@@ -12,9 +12,11 @@ use FileHandle;
use File::Compare qw(compare);
@ISA = qw(Exporter);
($VERSION = '$Revision: 1.3 $ ') =~ tr/[0-9].//cd;
($VERSION = '$Revision: 1.6 $ ') =~ tr/[0-9].//cd;
@EXPORT = qw (run_tests);
my $debug = $ENV{DEBUG};
my @Types = qw (IN OUT ERR EXIT PRE POST);
my %Types = map {$_ => 1} @Types;
my %Zero_one_type = map {$_ => 1} qw (OUT ERR EXIT PRE POST);
@@ -77,6 +79,8 @@ sub _create_file ($$$$)
++$Global_count;
}
warn "creating file `$file' with contents `$data'\n" if $debug;
# The test spec gave a string.
# Write it to a temp file and return tempfile name.
my $fh = new FileHandle "> $file";
@@ -119,7 +123,7 @@ sub run_tests ($$$$$)
return 1 if $found_duplicate;
# FIXME check exit status
system ($prog, '--version');
system ($prog, '--version') if $verbose;
my @junk_files;
my $fail = 0;
@@ -243,7 +247,7 @@ sub run_tests ($$$$$)
push @junk_files, $tmp{OUT}, $tmp{ERR};
my @cmd = ($prog, @args, "> $tmp{OUT}", "2> $tmp{ERR}");
my $cmd_str = join ' ', @cmd;
warn "Running command: `$cmd_str'\n" if $verbose;
warn "Running command: `$cmd_str'\n" if $debug;
my $rc = 0xffff & system $cmd_str;
if ($rc == 0xff00)
{

View File

@@ -1,9 +1,10 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Makefile.in generated automatically by automake 1.3b from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@@ -31,7 +32,7 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -187,7 +188,7 @@ check-TESTS: $(TESTS)
info:
dvi:
check: all
$(MAKE) check-TESTS
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
installcheck:
install-exec:
@$(NORMAL_INSTALL)
@@ -201,24 +202,21 @@ install: install-exec install-data all
uninstall:
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-generic
clean: clean-generic mostlyclean

View File

@@ -0,0 +1 @@
Makefile

View File

@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
EXTRA_DIST = $(TESTS) simple
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
@@ -9,4 +9,4 @@ TESTS_ENVIRONMENT = \
PATH=../../src:$$PATH \
PROG=dircolors
TESTS = run-test
TESTS = simple

View File

@@ -90,7 +90,7 @@ VERSION = @VERSION@
YACC = @YACC@
l = @l@
EXTRA_DIST = $(TESTS) simple
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
@@ -99,7 +99,7 @@ TESTS_ENVIRONMENT = \
PATH=../../src:$$PATH \
PROG=dircolors
TESTS = run-test
TESTS = simple
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =

View File

@@ -1,13 +0,0 @@
#!/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 -- $srcdir/simple

View File

@@ -1,4 +1,16 @@
#!/usr/bin/perl -w
#!/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;
@@ -20,3 +32,4 @@ my $verbose = $ENV{VERBOSE};
my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
exit $fail;
EOF

View File

@@ -1,9 +1,10 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Makefile.in generated automatically by automake 1.3b from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@@ -31,7 +32,7 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -182,7 +183,7 @@ check-TESTS: $(TESTS)
info:
dvi:
check: all
$(MAKE) check-TESTS
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
installcheck:
install-exec:
@$(NORMAL_INSTALL)
@@ -196,24 +197,21 @@ install: install-exec install-data all
uninstall:
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-generic
clean: clean-generic mostlyclean

1
tests/install/.cvsignore Normal file
View File

@@ -0,0 +1 @@
Makefile

View File

@@ -1,9 +1,10 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Makefile.in generated automatically by automake 1.3b from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@@ -31,7 +32,7 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -185,7 +186,7 @@ check-TESTS: $(TESTS)
info:
dvi:
check: all
$(MAKE) check-TESTS
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
installcheck:
install-exec:
@$(NORMAL_INSTALL)
@@ -199,24 +200,21 @@ install: install-exec install-data all
uninstall:
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-generic
clean: clean-generic mostlyclean

View File

@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
EXTRA_DIST = $(TESTS) quoting
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
@@ -9,4 +9,4 @@ TESTS_ENVIRONMENT = \
PATH=../../src:$$PATH \
PROG=ls
TESTS = run-test
TESTS = quoting

View File

@@ -90,7 +90,7 @@ VERSION = @VERSION@
YACC = @YACC@
l = @l@
EXTRA_DIST = $(TESTS) quoting
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
@@ -99,7 +99,7 @@ TESTS_ENVIRONMENT = \
PATH=../../src:$$PATH \
PROG=ls
TESTS = run-test
TESTS = quoting
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =

View File

@@ -1,4 +1,16 @@
#!/usr/bin/perl -w
#!/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;
@@ -38,3 +50,4 @@ my $verbose = $ENV{VERBOSE};
my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
exit $fail;
EOF

View File

@@ -1,13 +0,0 @@
#!/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 -- $srcdir/quoting

View File

@@ -1,8 +1 @@
*.I
*.E
*.X
*.O
*-tests
build-script
Makefile
mk-script

View File

@@ -1,36 +1,12 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
##test-files-begin
x = md5sum
explicit =
maint_gen = 1.I 1.X 2.I 2.X 3.I 3.X 4.I 4.X 5.I 5.X 6.I 6.X 7.I 7.X
run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E
##test-files-end
EXTRA_DIST = $(TESTS)
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
srcdir=$(srcdir) \
PERL="@PERL@" \
PATH=../../src:$$PATH \
PROG=md5sum
PERL = @PERL@
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,@srcdir@,g'
TESTS = $x-tests
mk_script = $(srcdir)/../mk-script
$(srcdir)/$x-tests: $(mk_script) Test.pm
$(PERL) -I. -w -- $(mk_script) ../../src/$x > $@.n
mv $@.n $@
chmod 755 $@
MAINTAINERCLEANFILES = $x-tests $(maint_gen)
CLEANFILES = $(run_gen)
check: $(maint_gen)
Makefile.am: ../Makefile.am.in Test.pm $(mk_script)
rm -f $@ $@t
sed -n '1,/^##test-files-begin/p' $< > $@t
tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
echo "x = $$tool" >> $@t
$(PERL) -I. -w -- $(mk_script) --list >> $@t
sed -n '/^##test-files-end/,$$p' $< >> $@t
mv $@t $@
TESTS = basic-1

View File

@@ -1,9 +1,10 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Makefile.in generated automatically by automake 1.3b from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@@ -31,7 +32,7 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -76,6 +77,7 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
POW_LIBM = @POW_LIBM@
@@ -86,28 +88,19 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
l = @l@
x = md5sum
explicit =
maint_gen = 1.I 1.X 2.I 2.X 3.I 3.X 4.I 4.X 5.I 5.X 6.I 6.X 7.I 7.X
run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E
EXTRA_DIST = $(TESTS)
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
srcdir=$(srcdir) \
PERL="@PERL@" \
PATH=../../src:$$PATH \
PROG=md5sum
PERL = @PERL@
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,@srcdir@,g'
TESTS = $x-tests
mk_script = $(srcdir)/../mk-script
MAINTAINERCLEANFILES = $x-tests $(maint_gen)
CLEANFILES = $(run_gen)
TESTS = basic-1
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
SCRIPTS = $(noinst_SCRIPTS)
DIST_COMMON = Makefile.am Makefile.in
@@ -115,7 +108,7 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
all: Makefile $(SCRIPTS)
all: Makefile
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
@@ -173,7 +166,7 @@ check-TESTS: $(TESTS)
info:
dvi:
check: all
$(MAKE) check-TESTS
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
installcheck:
install-exec:
@$(NORMAL_INSTALL)
@@ -187,24 +180,19 @@ install: install-exec install-data all
uninstall:
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-generic
clean: clean-generic mostlyclean
@@ -221,21 +209,6 @@ install-data install uninstall all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
$(srcdir)/$x-tests: $(mk_script) Test.pm
$(PERL) -I. -w -- $(mk_script) ../../src/$x > $@.n
mv $@.n $@
chmod 755 $@
check: $(maint_gen)
Makefile.am: ../Makefile.am.in Test.pm $(mk_script)
rm -f $@ $@t
sed -n '1,/^##test-files-begin/p' $< > $@t
tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
echo "x = $$tool" >> $@t
$(PERL) -I. -w -- $(mk_script) --list >> $@t
sed -n '/^##test-files-end/,$$p' $< >> $@t
mv $@t $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@@ -1,40 +0,0 @@
# -*-perl-*-
package Test;
require 5.002;
use strict;
sub test_vector
{
my @tvec =
(
# test-name options input expected-output expected-return-code
#
['1', '', '', 'd41d8cd98f00b204e9800998ecf8427e', 0],
['2', '', 'a', '0cc175b9c0f1b6a831c399e269772661', 0],
['3', '', 'abc', '900150983cd24fb0d6963f7d28e17f72', 0],
['4', '', 'message digest', 'f96b697d7cb7938d525a2f31aaf161d0', 0],
['5', '', 'abcdefghijklmnopqrstuvwxyz',
'c3fcd3d76192e4007dfb496cca67e13b', 0],
['6', '',
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
'd174ab98d277d9f5a5611c2c9f419d9f', 0],
['7', '', '1234567890123456789012345678901234567890'
. '1234567890123456789012345678901234567890',
'57edf4a22be3c955ac49da2e2107b67a', 0],
);
my @tv;
# Append two spaces, the input file name (-), and a newline to each
# expected output string.
my $t;
foreach $t (@tvec)
{
my ($test_name, $flags, $in, $exp, $ret) = @$t;
push (@tv, [$test_name, $flags, $in, "$exp -\n", $ret]);
$Test::input_via{$test_name} = {REDIR => 0, PIPE => 0};
}
return @tv;
}
1;

49
tests/md5sum/basic-1 Executable file
View File

@@ -0,0 +1,49 @@
#!/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 $degenerate = "d41d8cd98f00b204e9800998ecf8427e";
my @Tests =
(
['1', {IN=> {x=> ''}}, {OUT=>"$degenerate x\n"}],
['2', {IN=> {x=> 'a'}}, {OUT=>"0cc175b9c0f1b6a831c399e269772661 x\n"}],
['3', {IN=> {x=> 'abc'}}, {OUT=>"900150983cd24fb0d6963f7d28e17f72 x\n"}],
['4', {IN=> {x=> 'message digest'}},
{OUT=>"f96b697d7cb7938d525a2f31aaf161d0 x\n"}],
['5', {IN=> {x=> 'abcdefghijklmnopqrstuvwxyz'}},
{OUT=>"c3fcd3d76192e4007dfb496cca67e13b x\n"}],
['6', {IN=> {x=> join ('', 'A'..'Z', 'a'..'z', '0'..'9')}},
{OUT=>"d174ab98d277d9f5a5611c2c9f419d9f x\n"}],
['7', {IN=> {x=> '1234567890' x 8}},
{OUT=>"57edf4a22be3c955ac49da2e2107b67a x\n"}],
['backslash', {IN=> {"\\.foo"=> ''}},
{OUT=>"\\$degenerate \\\\.foo\n"}],
['newline', {IN=> {"a\nb"=> ''}},
{OUT=>"\\$degenerate a\\nb\n"}],
);
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
exit $fail;
EOF

View File

@@ -1,265 +0,0 @@
#! /bin/sh
# This script was generated automatically by build-script.
case $# in
0) xx='../../src/md5sum';;
*) xx="$1";;
esac
test "$VERBOSE" && echo=echo || echo=:
$echo testing program: $xx
errors=0
test "$srcdir" || srcdir=.
test "$VERBOSE" && $xx --version 2> /dev/null
# Make sure we get English translations.
LANGUAGE=C
export LANGUAGE
LC_ALL=C
export LC_ALL
LANG=C
export LANG
cat $srcdir/1.I | $xx > 1.O 2> 1.E
code=$?
if test $code != 0 ; then
$echo "Test 1(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 1.O $srcdir/1.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 1(|)"; fi ;;
1) $echo "Test 1(|) failed: files 1.O and $srcdir/1.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 1(|) may have failed." 1>&2;
$echo The command "cmp 1.O $srcdir/1.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 1.E || rm -f 1.E
$xx < $srcdir/1.I > 1.O 2> 1.E
code=$?
if test $code != 0 ; then
$echo "Test 1(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 1.O $srcdir/1.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 1(<)"; fi ;;
1) $echo "Test 1(<) failed: files 1.O and $srcdir/1.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 1(<) may have failed." 1>&2;
$echo The command "cmp 1.O $srcdir/1.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 1.E || rm -f 1.E
cat $srcdir/2.I | $xx > 2.O 2> 2.E
code=$?
if test $code != 0 ; then
$echo "Test 2(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 2.O $srcdir/2.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 2(|)"; fi ;;
1) $echo "Test 2(|) failed: files 2.O and $srcdir/2.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 2(|) may have failed." 1>&2;
$echo The command "cmp 2.O $srcdir/2.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 2.E || rm -f 2.E
$xx < $srcdir/2.I > 2.O 2> 2.E
code=$?
if test $code != 0 ; then
$echo "Test 2(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 2.O $srcdir/2.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 2(<)"; fi ;;
1) $echo "Test 2(<) failed: files 2.O and $srcdir/2.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 2(<) may have failed." 1>&2;
$echo The command "cmp 2.O $srcdir/2.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 2.E || rm -f 2.E
cat $srcdir/3.I | $xx > 3.O 2> 3.E
code=$?
if test $code != 0 ; then
$echo "Test 3(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 3.O $srcdir/3.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 3(|)"; fi ;;
1) $echo "Test 3(|) failed: files 3.O and $srcdir/3.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 3(|) may have failed." 1>&2;
$echo The command "cmp 3.O $srcdir/3.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 3.E || rm -f 3.E
$xx < $srcdir/3.I > 3.O 2> 3.E
code=$?
if test $code != 0 ; then
$echo "Test 3(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 3.O $srcdir/3.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 3(<)"; fi ;;
1) $echo "Test 3(<) failed: files 3.O and $srcdir/3.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 3(<) may have failed." 1>&2;
$echo The command "cmp 3.O $srcdir/3.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 3.E || rm -f 3.E
cat $srcdir/4.I | $xx > 4.O 2> 4.E
code=$?
if test $code != 0 ; then
$echo "Test 4(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 4.O $srcdir/4.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 4(|)"; fi ;;
1) $echo "Test 4(|) failed: files 4.O and $srcdir/4.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 4(|) may have failed." 1>&2;
$echo The command "cmp 4.O $srcdir/4.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 4.E || rm -f 4.E
$xx < $srcdir/4.I > 4.O 2> 4.E
code=$?
if test $code != 0 ; then
$echo "Test 4(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 4.O $srcdir/4.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 4(<)"; fi ;;
1) $echo "Test 4(<) failed: files 4.O and $srcdir/4.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 4(<) may have failed." 1>&2;
$echo The command "cmp 4.O $srcdir/4.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 4.E || rm -f 4.E
cat $srcdir/5.I | $xx > 5.O 2> 5.E
code=$?
if test $code != 0 ; then
$echo "Test 5(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 5.O $srcdir/5.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 5(|)"; fi ;;
1) $echo "Test 5(|) failed: files 5.O and $srcdir/5.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 5(|) may have failed." 1>&2;
$echo The command "cmp 5.O $srcdir/5.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 5.E || rm -f 5.E
$xx < $srcdir/5.I > 5.O 2> 5.E
code=$?
if test $code != 0 ; then
$echo "Test 5(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 5.O $srcdir/5.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 5(<)"; fi ;;
1) $echo "Test 5(<) failed: files 5.O and $srcdir/5.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 5(<) may have failed." 1>&2;
$echo The command "cmp 5.O $srcdir/5.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 5.E || rm -f 5.E
cat $srcdir/6.I | $xx > 6.O 2> 6.E
code=$?
if test $code != 0 ; then
$echo "Test 6(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 6.O $srcdir/6.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 6(|)"; fi ;;
1) $echo "Test 6(|) failed: files 6.O and $srcdir/6.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 6(|) may have failed." 1>&2;
$echo The command "cmp 6.O $srcdir/6.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 6.E || rm -f 6.E
$xx < $srcdir/6.I > 6.O 2> 6.E
code=$?
if test $code != 0 ; then
$echo "Test 6(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 6.O $srcdir/6.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 6(<)"; fi ;;
1) $echo "Test 6(<) failed: files 6.O and $srcdir/6.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 6(<) may have failed." 1>&2;
$echo The command "cmp 6.O $srcdir/6.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 6.E || rm -f 6.E
cat $srcdir/7.I | $xx > 7.O 2> 7.E
code=$?
if test $code != 0 ; then
$echo "Test 7(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 7.O $srcdir/7.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 7(|)"; fi ;;
1) $echo "Test 7(|) failed: files 7.O and $srcdir/7.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 7(|) may have failed." 1>&2;
$echo The command "cmp 7.O $srcdir/7.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 7.E || rm -f 7.E
$xx < $srcdir/7.I > 7.O 2> 7.E
code=$?
if test $code != 0 ; then
$echo "Test 7(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp 7.O $srcdir/7.X > /dev/null 2>&1
case $? in
0) if test "$VERBOSE" ; then $echo "passed 7(<)"; fi ;;
1) $echo "Test 7(<) failed: files 7.O and $srcdir/7.X differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 7(<) may have failed." 1>&2;
$echo The command "cmp 7.O $srcdir/7.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s 7.E || rm -f 7.E
if test $errors = 0 ; then
$echo Passed all 14 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi
test $errors = 0 || errors=1
exit $errors

View File

@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
AUTOMAKE_OPTIONS = 1.3 gnits
TESTS = mv-special-1 into-self into-self-2 backup-is-src
TESTS = mv-special-1 into-self into-self-2 backup-is-src i-1
EXTRA_DIST = $(TESTS) setup
TESTS_ENVIRONMENT = \
DF=../../src/df \
@@ -11,4 +11,7 @@ TESTS_ENVIRONMENT = \
MKNOD=../../src/mknod \
MV=../../src/mv \
RM=../../src/rm \
TOUCH=../../src/touch
TOUCH=../../src/touch \
PERL="@PERL@" \
PATH=../../src:$$PATH \
PROG=mv

Some files were not shown because too many files have changed in this diff Show More