diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2006-02-01 12:28:29 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2006-02-01 12:28:29 +0000 |
commit | 882ab0adfcf900abab9aa3df22fb7051df058a22 (patch) | |
tree | c3bcb7752d7ce593decb5fc93bf34b06c56e0e4e | |
parent | 2f9728a96276570abdcf3420f27ce03af0feddea (diff) | |
download | quilt-882ab0adfcf900abab9aa3df22fb7051df058a22.tar.gz |
- configure.ac: Remove uniq -D test; we no longer use it.
- compat/date.in: Compatibility wrapper that emulates the GNU
date features that quilt depends on (with minor cleanups from
Andreas Gruenbacher).
- configure.ac: Add test for date --rfc-822.
-rw-r--r-- | Makefile.in | 1 | ||||
-rw-r--r-- | compat/date.in | 60 | ||||
-rw-r--r-- | configure.ac | 19 | ||||
-rw-r--r-- | quilt.changes | 13 |
4 files changed, 84 insertions, 9 deletions
diff --git a/Makefile.in b/Makefile.in index e031b4c..d6a75cd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,7 +18,6 @@ POD2MAN := @POD2MAN@ COLUMN := @COLUMN@ GETOPT := @GETOPT@ CP := @CP@ -UNIQ := @UNIQ@ DATE := @DATE@ PERL := @PERL@ BASH := @BASH@ diff --git a/compat/date.in b/compat/date.in new file mode 100644 index 0000000..aaa2c6d --- /dev/null +++ b/compat/date.in @@ -0,0 +1,60 @@ +#! @PERL@ -w + +# This script is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# See the COPYING and AUTHORS files for more details. + +use strict; +use POSIX qw(strftime); +use Getopt::Long; +use Date::Parse; + +my $spec = '%a %b %e %H:%M:%S %Z %Y'; +my $now = time(); +my $utc = 0; + +sub usage() { + print "Usage: date [OPTION]... [+FORMAT] +Display the current time in the given FORMAT. + + -d, --date=STRING display time described by STRING, not `now' + -f, --file=DATEFILE like --date once for each line of DATEFILE + -R, --rfc-822 output RFC-822 compliant date string + -u, --utc, --universal print or set Coordinated Universal Time + --help display this help and exit +"; + exit 1; +} + +sub parse_utc_secs($) { + my ($now) = @_; + + if ($now =~ / UTC ([0-9]+) seconds$/) { + # This is an heuristic specifically for quilts mail.in invocation: + # date --rfc-822 -d "1970/01/01 UTC nnnnnnnn seconds" + return $1; + } + else { + return str2time($now); + } +} + +Getopt::Long::Configure("gnu_getopt"); + +GetOptions('rfc-822|R' => sub() { $spec = '%a, %d %b %Y %H:%M:%S %z' }, + 'utc|universal|u' => \$utc, + 'date|d=s' => sub() { $now = parse_utc_secs($_[1]) }, + 'help|h' => sub() { usage }) + or usage; + +if (@ARGV == 1 && $ARGV[0] =~ /^\+/) { + $spec = substr($ARGV[0], 1); +} elsif (@ARGV > 1) { + usage; +} + +my @now = $utc ? gmtime($now) : localtime($now); + +print strftime($spec, @now) . "\n"; diff --git a/configure.ac b/configure.ac index 8336028..de62dbb 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([quilt],[0.42],[quilt-dev@nongnu.org]) AC_CONFIG_AUX_DIR(config) AC_PREREQ(2.53) -AC_REVISION ($Revision: 1.69 $) +AC_REVISION ($Revision: 1.70 $) PACKAGE_RELEASE=1 AC_SUBST(PACKAGE_RELEASE) @@ -69,19 +69,22 @@ You can download GNU fileutils from ftp.gnu.org ]) fi -QUILT_COMPAT_PROG_PATH(UNIQ, uniq, [guniq uniq]) -AC_MSG_CHECKING(whether $UNIQ -D works) -if echo 'foo' | $UNIQ -D >/dev/null 2>/dev/null; then +QUILT_COMPAT_PROG_PATH(DATE, date, [gdate date]) + +if test -z "$INTERNAL_DATE"; then + AC_MSG_CHECKING([whether $DATE --rfc-822 works]) + if date --rfc-822 >/dev/null 2>/dev/null; then AC_MSG_RESULT(yes) -else + else AC_MSG_ERROR([no -You appear to have a `uniq' that does not support printing only -duplicates. You can download GNU coreutils from ftp.gnu.org. +If you don't have a version of `date' that supports --rfc-822, you +can specify '--without-date' and $PACKAGE_NAME will use its own +internal date. ]) + fi fi -QUILT_COMPAT_PROG_PATH(DATE, date, [gdate date]) QUILT_COMPAT_PROG_PATH(PERL, perl, [perl perl5]) QUILT_COMPAT_PROG_PATH(GREP, grep) diff --git a/quilt.changes b/quilt.changes index fc29377..c7f530e 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,17 @@ ------------------------------------------------------------------- +Wed Feb 1 13:28:36 CET 2006 - agruen@suse.de + +- configure.ac: Remove uniq -D test; we no longer use it. + +------------------------------------------------------------------- +Wed Feb 1 13:21:09 CET 2006 - jayvdb@gmail.com + +- compat/date.in: Compatibility wrapper that emulates the GNU + date features that quilt depends on (with minor cleanups from + Andreas Gruenbacher). +- configure.ac: Add test for date --rfc-822. + +------------------------------------------------------------------- Wed Feb 1 11:40:58 CET 2006 - agruen@suse.de - bin/guards: Update to latest version (supports --with-guards |