bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#505927: just use the date(1) -d library instead of your own poor


From: jidanni
Subject: Re: Bug#505927: just use the date(1) -d library instead of your own poorer date parser
Date: Tue, 25 Aug 2009 04:18:25 +0800

>>>>> Regarding http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505927
>>>>> "BSB" == Bernd Siggy Brentrup <address@hidden> writes:

BSB> Hi,

BSB> I'm currently evaluating at's wishlist bugs for my 'at' replacement
BSB> 'at-ng' which is a complete rewrite from scratch.

Uh oh, "at no good"? :-)

BSB> On Mon, Nov 17, 2008 at 05:49 +0800, address@hidden wrote:
>> Package: at
>> Version: 3.1.10.2
>> Severity: wishlist
>> 
>> At should be more flexible. Just use the date libraries instead of
>> your own parser.
>> $ at -v 'now + 5 years + 11 months'
>> syntax error. Last token seen: +
>> Garbled time
>> $ date -d 'now + 5 years + 11 months'
>> Fri Oct 17 03:53:15 CST 2014
>> However to get at to accept such a date, one needs:
>> $ at -v $(date --rfc-3339=date -d 'now + 5 years + 11 months')
>> Fri Oct 17 03:56:00 2014
>> warning: commands will be executed using /bin/sh

>> If at would use the same library as date -d, you could 1. parse lots
>> more types of dates. 2. Eliminate maintenance of duplicate code.

BSB> If there only were such a library, static or preferrably dynamic!
BSB> ldd /bin/date shows there is no dynamic one and dpkg -L coreutils shows
BSB> no static version either.

BSB> I might get coreutils sources and use the relevant parts but that
BSB> deprives me of my freedom to choose a license at my will.  IANAL but
BSB> in my understanding using GPLed source code means you must release
BSB> everything under the GPL.

I'll Cc the coreutils people and thus hook you up so you fellows can
figure out the best way to reuse code.

I'm a big Stallman http://jidanni.org/comp/index.html#rms fan, so any
license of his is good with me.

BSB> I'm not yet decided what to do, in particular when thinking about
BSB> i18n which may demand to cope with cultural differences.  How does
BSB> date handle these?

I recall its output was better than its input, but then on your at(1)
man page you can say "if at(1) can't parse Chinese dates yet, blame date(1)"!

BSB> Regards
BSB>   Siggy

BSB> [1] https://launchpad.net/~at-ng
BSB>     not much there for now,  but by next week there will be
BSB>     demos for the cli commands at & friends.  Server-side
BSB>     will take somewhat longer.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]