Python ntpq lands - what to do next?

Hal Murray hmurray at
Sun Nov 6 02:10:03 UTC 2016

> What's going on: In fulfilment of a request from Gary to make package
> version information easily accessible from Python, I told waf to generate a
> file pylib/ using VERSION as input.  Mine looks like this: 
> ...

> I believe that the production won't fire (and fail) if pylib/
> exists and is newer than VERSION, which I expect to be the case in a tarball
> that prserves dates (because it will always be true after waf runs).

I'm not actually making a tarball, just trying to do something similar.

I have a script to do all the work, mostly so I don't forget a critical step, 
but also to make a log file without extra typing and such.  It should be a 
line or two in the right place if/when I figure out what to do.

> So the first question is, does your unpacked tarball have a pylib/
> And is it newer or older than VERSION? 

-rw-rw-r-- 1 murray murray   6 Oct 13 01:45 VERSION
-rw-rw-r-- 1 murray murray 408 Nov  5 17:37 pylib/

[100/132] Compiling VERSION
18:11:27 runner ' VERSION=`cat ../VERSION` ../wafhelpers/ -t 
python > '
error: No repo or cache detected.

That's from my attempt at mimicking a tarball process.

So I tried the real things.
./waf distcheck worked and left behind  noname-1.0.tar.bz2
I scp-ed that to another machine that didn't have git, untared, and ...

[ 98/132] Compiling VERSION
error: No repo or cache detected.

Waf: Leaving directory `/home/murray/foo/noname-1.0/build/main'
Build failed
 -> task in '/home/murray/foo/noname-1.0/pylib/' failed with exit 
status 1 (run with -v to display more information)


This is turning into an interesting can of worms.

waf clean doesn't get pylib/ or pylib/ or 
is that a bug or feature?

The parallel non-python version stuff just uses the time if it can't get info 
from git.
You may want to "fix" that to do something similar.
It's only used by ntpd.  (There used to be one for ntpq too.)

There are actually two times of interest.  One is the latest time a source 
file was modified.  The other is the time the package was built.  Python may 
not have the concept of build, but it might come back if you are translating 
from python to c.

If you edit a file, waf doesn't automagically update version.c
So my rebuild script deletes 
so waf rebuilds it to get the updated build-time.

That version stuff is currently half broken.
  ntpd --version --version
  ntpd 0.9.5-5feab12-glypnod Nov  5 2016 17:37:08

These are my opinions.  I hate spam.

More information about the devel mailing list