[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
human-time? (was: Re: Proposed module, releasedate)
From: |
Simon Josefsson |
Subject: |
human-time? (was: Re: Proposed module, releasedate) |
Date: |
Thu, 10 Jan 2008 15:56:16 +0100 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux) |
"James Youngman" <address@hidden> writes:
> On Jan 10, 2008 1:06 AM, Bruno Haible <address@hidden> wrote:
>> James Youngman wrote:
>> > Lots of packages get bug reports for releases that are pretty old.
>
>> > /* emit the standard version information first. */
>> >
>> > if (release_age (&age))
>> > {
>> > double weeks = age / (86400.0 * 7);
>> > printf(_("This release is %.0f weeks old."),
>> > weeks);
>> > if (weeks > 26.0)
>> > {
>> > printf(_(" If you are considering reporting a bug,\n"
>> > "please upgrade to the most recent release first.\n"));
>> > }
>>
>> You are assuming that you will be able to make a release at least
>> every 6 months?
>
> Yes. But that code is in the example, not the module.
This thread reminds me of this poor warning message from make:
make: Warning: File `Makefile.am' has modification time 7.9e+02 s in the future
There are humans that don't instinctual feel whether '7.9e+02 s' is a
time difference in milliseconds or years...
Compare this to the useful human.c in gnulib to print file sizes as
human readable values, i.e. to print 2.5T instead of 2801285853933.
Perhaps there is room for a module that works like:
char *
human_readable (uintmax_t n, char *buf, time_t age)
{
if (age < 60)
return xvasprintf ("%d seconds", age);
else if (age < 60*60)
return xvasprintf ("%d minutes", age / 60);
else if (age < 60*60*24)
return xvasprintf ("%d hours", age / 60 / 60);
else if (age < 60*60*24*7)
return xvasprintf ("%d weeks", age / 60 / 60 / 24);
...
}
Plus plural fixes and so on... I think I could use this to express when
kerberos tickets expired in one of my projects. Hm.
/Simon
- Proposed module, releasedate, James Youngman, 2008/01/09
- Re: Proposed module, releasedate, Bruno Haible, 2008/01/09
- Re: Proposed module, releasedate, James Youngman, 2008/01/10
- human-time? (was: Re: Proposed module, releasedate),
Simon Josefsson <=
- Re: human-time?, Bruno Haible, 2008/01/10
- Re: human-time?, Simon Josefsson, 2008/01/10
- Re: human-time?, Simon Josefsson, 2008/01/10
- Re: human-time?, Bruno Haible, 2008/01/10
- Re: human-time?, Paul Eggert, 2008/01/10
- Re: 'make' modification time warning (was: Re: human-time?), Bruno Haible, 2008/01/10
- Re: 'make' modification time warning, Paul Eggert, 2008/01/11
- Re: 'make' modification time warning, Matthew Woehlke, 2008/01/22
- Re: Proposed module, releasedate, Bruno Haible, 2008/01/10