You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dnl Can we satisfy any NUT-Monitor installation request?
2411
2439
if test -n "${nut_with_nut_monitor_py2gtk2}${nut_with_nut_monitor_py3qt5}" ; then
2412
2440
case "${nut_with_nut_monitor}" in
@@ -2416,11 +2444,14 @@ if test x"${nut_with_nut_monitor}" != xno ; then
2416
2444
case "${nut_with_nut_monitor}" in
2417
2445
"auto") nut_with_nut_monitor="no" ;;
2418
2446
"yes")
2419
-
AC_MSG_ERROR([No python 2/3 interpreter with needed modules was found, as required for NUT-Monitor desktop application: ${PYTHON_FAILED_TEST_DETAILS}])
2447
+
AC_MSG_ERROR([No Python 2/3 interpreter with needed modules was found, as required for NUT-Monitor desktop application: ${PYTHON_FAILED_TEST_DETAILS}])
2420
2448
;;
2421
2449
esac
2422
2450
fi
2423
2451
fi
2452
+
2453
+
AC_MSG_CHECKING([if we can and should install NUT-Monitor desktop application])
dnl ${nut_with_pynut}: TODO: arg values to request python 2, 3 or both
2450
-
AC_MSG_CHECKING([if we can and should install PyNUT module (note for warnings from python 3.11 and beyond: we have a fallback nut_telnetlib module just in case)])
2451
-
nut_with_pynut_py=""
2452
-
nut_with_pynut_py2=""
2453
-
nut_with_pynut_py3=""
2482
+
dnl Check if we can use distributed or fallback telnetlib module for PyNUTClient
2483
+
nut_have_telnetlib_py=""
2484
+
nut_have_telnetlib_py2=""
2485
+
nut_have_telnetlib_py3=""
2454
2486
if test x"${nut_with_pynut}" != xno \
2455
2487
-a -n "${PYTHON}${PYTHON2}${PYTHON3}" \
2456
2488
; then
2457
-
if test -n "${PYTHON2}" \
2458
-
&& (command -v ${PYTHON2} || which ${PYTHON2}) >/dev/null 2>/dev/null \
2459
-
; then
2489
+
if test -n "${PYTHON2_VERSION_INFO_REPORT}" ; then
2490
+
AC_MSG_CHECKING([if we can use stock Python2 telnetlib module provided with interpreter ${PYTHON2}])
2460
2491
if ${PYTHON2} -c "import telnetlib" \
2461
2492
; then
2462
-
nut_with_pynut_py2="yes"
2493
+
nut_have_telnetlib_py2="yes"
2494
+
else
2495
+
nut_have_telnetlib_py2="no"
2463
2496
fi
2497
+
AC_MSG_RESULT([${nut_have_telnetlib_py2}])
2464
2498
fi
2465
2499
2466
-
if test -n "${PYTHON3}" \
2467
-
&& (command -v ${PYTHON3} || which ${PYTHON3}) >/dev/null 2>/dev/null \
2468
-
; then
2500
+
if test -n "${PYTHON3_VERSION_INFO_REPORT}" ; then
2501
+
AC_MSG_CHECKING([if we can use stock Python3 telnetlib module for PyNUTClient provided with interpreter ${PYTHON3} (note for warnings from Python 3.11 and beyond: we have a fallback nut_telnetlib module just in case)])
2469
2502
if ${PYTHON3} -c "import telnetlib" \
2470
2503
; then
2471
-
nut_with_pynut_py3="yes"
2504
+
nut_have_telnetlib_py3="yes"
2472
2505
else
2506
+
nut_have_telnetlib_py3="no"
2507
+
fi
2508
+
AC_MSG_RESULT([${nut_have_telnetlib_py3}])
2509
+
2510
+
if test x"${nut_have_telnetlib_py3}" = x"no" ; then
2473
2511
dnl We have a stashed copy from Python 3.10, so
2474
2512
dnl this line essentially checks for presence of
2475
2513
dnl a usable interpreter implementation compatible
2476
2514
dnl with Python 3.x syntax.
2477
-
if (cd script/python/module && ${PYTHON3} -c "import nut_telnetlib as telnetlib") \
2515
+
AC_MSG_CHECKING([if we can use fallback Python3 nut_telnetlib module for PyNUTClient])
2516
+
if (cd "${srcdir}"/scripts/python/module && ${PYTHON3} -c "import nut_telnetlib as telnetlib") \
2478
2517
; then
2479
-
nut_with_pynut_py3="yes"
2518
+
nut_have_telnetlib_py3="yes"
2480
2519
fi
2520
+
AC_MSG_RESULT([${nut_have_telnetlib_py3}])
2481
2521
fi
2482
2522
fi
2483
2523
2484
2524
dnl Test same-ness of pythons with sys.version also?
2485
-
if test -n "${PYTHON}" \
2486
-
&& (command -v ${PYTHON} || which ${PYTHON}) >/dev/null 2>/dev/null \
2487
-
&& test "${PYTHON}" != "${PYTHON2}" -a "${PYTHON}" != "${PYTHON3}" \
2525
+
if test -n "${PYTHON_VERSION_INFO_REPORT}" \
2526
+
&& test x"${PYTHON_VERSION_INFO_REPORT}" != x"${PYTHON3_VERSION_INFO_REPORT}" \
2527
+
&& test x"${PYTHON_VERSION_INFO_REPORT}" != x"${PYTHON2_VERSION_INFO_REPORT}" \
2488
2528
; then
2529
+
AC_MSG_CHECKING([if we can use stock Python telnetlib module for PyNUTClient provided with interpreter ${PYTHON} (note for warnings from Python 3.11 and beyond: we have a fallback nut_telnetlib module just in case)])
2489
2530
if ${PYTHON} -c "import telnetlib" \
2490
2531
; then
2491
-
nut_with_pynut_py="yes"
2532
+
nut_have_telnetlib_py="yes"
2492
2533
else
2534
+
nut_have_telnetlib_py="no"
2535
+
fi
2536
+
AC_MSG_RESULT([${nut_have_telnetlib_py}])
2537
+
2538
+
if test x"${nut_have_telnetlib_py}" = x"no" ; then
2493
2539
dnl See comments above
2494
-
if (cd script/python/module && ${PYTHON} -c "import nut_telnetlib as telnetlib") \
2540
+
AC_MSG_CHECKING([if we can use fallback Python nut_telnetlib module for PyNUTClient])
2541
+
if (cd "${srcdir}"/scripts/python/module && ${PYTHON} -c "import nut_telnetlib as telnetlib") \
2495
2542
; then
2496
-
nut_with_pynut_py="yes"
2543
+
nut_have_telnetlib_py="yes"
2497
2544
fi
2545
+
AC_MSG_RESULT([${nut_have_telnetlib_py}])
2498
2546
fi
2499
2547
fi
2500
2548
fi
2501
2549
2550
+
dnl ${nut_with_pynut}: TODO: arg values to request Python 2, 3 or both
2551
+
dnl Note that per block above, nut_have_telnetlib_py* values are definitive
2552
+
dnl if checked, or empty if skipped (no such Python, not nut_with_pynut, etc.)
2553
+
AC_MSG_CHECKING([if we can and should install PyNUT module])
2554
+
nut_with_pynut_py=""
2555
+
nut_with_pynut_py2=""
2556
+
nut_with_pynut_py3=""
2557
+
if test x"${nut_with_pynut}" != xno \
2558
+
-a -n "${PYTHON}${PYTHON2}${PYTHON3}" \
2559
+
; then
2560
+
if test x"${nut_have_telnetlib_py2}" = x"yes" ; then
2561
+
nut_with_pynut_py2="yes"
2562
+
fi
2563
+
2564
+
if test x"${nut_have_telnetlib_py3}" = x"yes" ; then
2565
+
nut_with_pynut_py3="yes"
2566
+
fi
2567
+
2568
+
if test x"${nut_have_telnetlib_py}" = x"yes" ; then
2569
+
nut_with_pynut_py="yes"
2570
+
fi
2571
+
fi
2572
+
2502
2573
if test -z "${nut_with_pynut_py}${nut_with_pynut_py2}${nut_with_pynut_py3}" ; then
2503
2574
dnl Not all prereqs are available...
2504
2575
case "${nut_with_pynut}" in
@@ -2537,7 +2608,7 @@ if test x"${nut_with_pynut}" != xno ; then
2537
2608
if test "${nut_with_nut_monitor}" = yes -o "${nut_with_nut_monitor}" = force ; then
2538
2609
nut_with_pynut="app"
2539
2610
else
2540
-
AC_MSG_ERROR([python interpreter and/or its site-packages location not found, but required for PyNUT])
2611
+
AC_MSG_ERROR([Python interpreter and/or its site-packages location not found, but required for PyNUT])
0 commit comments