gpsd-dev
[Top][All Lists]
Advanced

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

Re: ✘leapsecond.py


From: Gary E. Miller
Subject: Re: ✘leapsecond.py
Date: Fri, 1 Nov 2019 17:11:13 -0700

Yo Bernd!

On Fri, 1 Nov 2019 23:29:54 +0100
Bernd Zeimetz <address@hidden> wrote:

> Hi,
> 
> so basically the leapseconds.py code is doing
> 
> % wc -l leapseconds.cache
> 19 leapseconds.cache
> 
> so the issue is in the cache generation.
> 
> First question:
> 
> does ftp://maia.usno.navy.mil work for anybody? Seems dead to me.

Yup.  NTPsec changed recently to use:

https://www.ietf.org/timezones/data/leap-seconds.list

> looking at the output of leapseconds.py -v -f foo the fix seems to be
> 
> diff --git a/leapsecond.py b/leapsecond.py
> index b0ef0935d..8acf94dcf 100755
> --- a/leapsecond.py
> +++ b/leapsecond.py
> @@ -229,7 +221,7 @@ def save_leapseconds(outfile):
>              line = polystr(line)
>              if verbose:
>                  sys.stderr.write("%s\n" % line[:-1])
> -            if line.startswith(" 1980"):
> +            if line.startswith(" 1981"):
>                  skip = False
>              if skip:
>                  continue
> 
> 
> 
> But imho the whole thing is a mess as it assumes that there is only
> one leapsecond per year and I think that leapseconds.cache file is
> only used to count the number of lines.

Yup.  Is this worth fixing?

> I *think* the proper fix would be to parse the number of leapseconds
> from the bulletin and just use it. No idea why we need to keep a
> history of that stuff and count lines while assuming a line means one
> seconds....

If the goal is a reproduceable build, any objections to just
hard coding:

#define BUILD_CENTURY   2000
#define BUILD_LEAPSECONDS       18

And update the file manually every release?

Will people really be building old versions of gpsd after leap second
changes?  Or just wait until the next releave (or five).

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgplSrAShRDiM.pgp
Description: OpenPGP digital signature


reply via email to

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