On Saturday, March 29, 2025 2:24:04 AM Pacific Daylight Time Hal Murray via 
devel wrote:
> Somebody is adding that python-dev
> 
> Ahh.  I found this:
>     # Prerequisites for the client Python tools: python extensions
>     case $installer in
>         apt)
>             $install "python${PYVERS}-dev"
>             ;;
> So PYVERS must be empty.
> That's because python hasn't been installed yet so python --version
> doesn't work.
> 
> Mumble.  I'll try to fix it in the morning.
> 
> Do we care if buildprep works on python 2?

For clan Debian python-dev is being added at buildprep:258 in the tools 
section; python3-dev is also added at buildprep:189 under daemon.

There is a test at buildprep:67-71 that assumes there is a "python" in path 
and completely fails to check that. If there is a not-major-2 Python 
interpreter there it returns the major number, otherwise an empty string.

The penultimate way is probably to test for "python3" and then "python2" if 
that fails. mockery of an implementation follows.

```sh
if test -n "$(command -v python3)" && test -x $(command -v python3); then
  PYVERS="3"
elif test -z "$(command -v python2)" || ! test -x $(command -v python2); then
  echo "We have no Python"
  exit 1
fi
```

NOTE If Python 4 ever arrives this will need to be revised and it's only 
suggested because neither python-is-python3 nor python-unversioned-command is 
installed by default.


_______________________________________________
devel mailing list
devel@ntpsec.org
https://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to