✘Python 2.7 broken

Gary E. Miller gem at rellim.com
Sun Dec 13 20:33:54 UTC 2020


Yo James!

On Sun, 13 Dec 2020 11:25:40 -0800
James Browning via devel <devel at ntpsec.org> wrote:

> How about the attached patches then. The first tries to grab the time
> of the last git commit, but only if neither the environment nor
> command line contains a timestamp.

Time is not good.  Git branches can do ugly things to time.  Do what
gpsd does and use:

if 'dev' in gpsd_version:
    (st, gpsd_revision) = _getstatusoutput('git describe --tags')
    if st != 0:
        # Only if git describe failed
        # Use timestamp from latest relevant file,
        # ignoring generated files (../$variantdir)
        # from root, not from $variantdir
        files = FileList(['../*.c', '../*/*.c', '../*.cpp', '../*/*.cpp',
                          '../include/*.h', '../*.in', '../*/*.in',
                          '../SConstruct', '../SConscript'],
                         '../%s' % variantdir)
        timestamps = map(GetMtime, files)
        if timestamps:
            from datetime import datetime
            latest = datetime.fromtimestamp(sorted(timestamps)[-1])
            gpsd_revision = '%s-%s' % (gpsd_version, latest.isoformat())
        else:
            gpsd_revision = gpsd_version  # Paranoia
else:
    gpsd_revision = gpsd_version
gpsd_revision = gpsd_revision.strip()

So release get the release name.  Builds with gid use the 'git describe --tags'
and the final fall back is news source file date.


> The latter changes the extended version format to list commits since
> the last tag (if not 0) and a dirty tree indicator.

--dirty is an interesting idea.  If only we could force that on for
distro patches.  :-)

getting a working build is more important than an improved version text.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20201213/645b5bd1/attachment.bin>


More information about the devel mailing list