gpsd-dev
[Top][All Lists]
Advanced

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

Re: ✘gpsinfo


From: Fred Wright
Subject: Re: ✘gpsinfo
Date: Mon, 15 Mar 2021 18:51:51 -0700 (PDT)
User-agent: Alpine 2.23 (OSX 453 2020-06-18)


On Mon, 15 Mar 2021, Gary E. Miller wrote:

On Mon, 15 Mar 2021 18:05:33 -0700 (PDT)
Fred Wright <fw@fwright.net> wrote:

[...]
The only Python that matters is the one referenced in the shebang
lines. Aside from error checking, that means something like this:

        $(head -1 $(which gpscat) | cut -b 3-) -V

gpsdebuginfo alreay does this:

   head -n 1 `which xgps`

Your command assumes that the shebang is present and working.  And hides
valuable debug info.  gpsdebuginfo is for when things are broken.

Which is why I said "aside from error checking".

The current test also prints gpsd module version, which may differ
from the python client version.  Which your does not do.

My test was intended solely for the Python version test, and nothing else.

And, just today on IRC, a user wanted both python and python3, so best to
keep the script inclusive of options.

When invoked normally, the programs will only use the one python version they're shebanged for. Reporting the version of a Python they're *not* using is rather pointless.

If you're really trying to report on all possible Pythons, regardless of whether gpsd's programs actually use them, you won't necessarily get that even if you use 'python', 'python2', and 'python3'. I have a program which attempts to report some information about all Pythons installed in the system, but it would be gross overkill for this use case. E.g.:

        MacPro:Python fw$ ./python_paths.py | tail -1
        Found 18 unique Python installations out of 25 total

Also note that running "gpscat -V" is sufficient to check that
imports work, including the packetizer.

Assuming gpscat is not broken.  People run the script when things are
broken.

If gpscat is present and able to do -V, then the imports work. If it's present and not able to do -V, that almost certainly means that the imports don't work. Hence, it's a straightforward import test.

Anything related to Python needs to be optional, in case the install
used "python=no".

No way to know if python=no.  Worse, this will usually be run when
gpsd installed from packages.  It fails nicely, so I'm not worried about
running when not needed.  The problem is not being run when it needs to.

It can't directly know "python=no", but if everything else works and Python-based programs are missing, then that's a pretty good bet, and probably worth an appropriate message.

Fred Wright



reply via email to

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