On Wednesday 01 February 2006 15:12, Gary V. Vaughan wrote:
> Tag!
>
> Andreas Gruenbacher wrote:
> > On Wednesday 01 February 2006 11:44, Gary V. Vaughan wrote:
> > > Apparently, perl doesn't use the native strftime... or at least on
> > > darwin %z works within perl, but isn't used in Apple's date
> > > implementation.
> >
> > Okay, that's good for us.
> >
> > > Here is a patch for a perl date wrapper (my first perl script!), I hope
> > > you can commit this in time for 0.43...  with it, I can `./configure
> > > --without-date' and have the testsuite complete successfully.
> >
> > Looks very nice. I have only a few comments:
> >
> >  * I don't see why we would need the pass_through option;
> >    we still fail further below, anyway.
>
> Needed because GetOptions treats `+' as an option delimitter (as in '+%s'),
> and otherwise fails with:
>
>   Unknown option: %

Ah, do you have the prefix_pattern config, as in the attached patch?


> >  * You ignore the result of GetOptions, which is only minor.
> >  * parse_utc_secs() shouldn't affect the --utc option. Also, the seconds
> >    since the epoch are always relative to UTC.
> >  * In scalar contect, @ARGV evaluates to $#ARGV + 1.
> >  * When you use sub foo() { ... } instead of sub foo { }, the
> >    parentheses declare "no parameters". It should be sub
> >    parse_utc_secs($) { ... } instead.
> >  * "use" inside a subroutine??
>
> Okay, thanks.  Not too many slip ups for my first script in perl ;-) *ahem*

No, it's really good.

> > Can you maybe give the checked-in version a quick check?
>
> With the attached small change, everything is good on darwin!

Does the attached proposal work equally well?

Andreas
Index: compat/date.in
===================================================================
RCS file: /sources/quilt/quilt/compat/date.in,v
retrieving revision 1.1
diff -u -r1.1 date.in
--- compat/date.in	1 Feb 2006 12:28:29 -0000	1.1
+++ compat/date.in	1 Feb 2006 14:27:45 -0000
@@ -8,7 +8,7 @@
 
 use strict;
 use POSIX qw(strftime);
-use Getopt::Long;
+use Getopt::Long qw(:config gnu_getopt prefix_pattern=(--|-));
 use Date::Parse;
 
 my $spec = '%a %b %e %H:%M:%S %Z %Y';
@@ -41,8 +41,6 @@
     }
 }
 
-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]) },
_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to