Yo James! On Sun, 13 Dec 2020 11:25:40 -0800 James Browning via devel <devel@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 g...@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
pgphDoskaZsDo.pgp
Description: OpenPGP digital signature
_______________________________________________ devel mailing list devel@ntpsec.org http://lists.ntpsec.org/mailman/listinfo/devel