Handle cases where no python2 interpreter is found
authorDodji Seketeli <dodji@redhat.com>
Wed, 16 May 2018 12:28:08 +0000 (14:28 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 16 May 2018 12:28:08 +0000 (14:28 +0200)
If no python2 interpreter is found and only a python3 one is found,
then use that one rather than just bailing.

* configure.ac: When no python2 is found and only python3 is
found, then use python3.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
configure.ac

index 1fbd3bd..c9e50f6 100644 (file)
@@ -385,15 +385,27 @@ if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then
   fi
 
   if test x$MINIMAL_PYTHON_VERSION_FOUND = xno; then
+    AC_MSG_NOTICE([no minimal version of python found])
     MISSING_FEDABIPKGDIFF_DEP=yes
     if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
       AC_MSG_ERROR([could not find a python program of version at least $MINIMAL_PYTHON2_VERSION])
     fi
+    if test x$PYTHON = xno; then
+       AC_MSG_NOTICE([python binary wasn't found])
+       if test x$PYTHON3_INTERPRETER != xno; then
+                 AC_MSG_NOTICE([using $PYTHON3_INTERPRETER instead])
+                 PYTHON=$PYTHON3_INTERPRETER
+         MINIMAL_PYTHON_VERSION_FOUND=yes
+         MISSING_FEDABIPKGDIFF_DEP=no
+       fi
+    fi
   else
+    AC_MSG_NOTICE([a minimal version of python was found ...])
     if test x$PYTHON3_INTERPRETER != xno; then
      # We were instructed to use python3 and it's present on the
      # system.  Let's update the PYTHON variable that points to the
      # actual python interpreter we are going to be using
+     AC_MSG_NOTICE([... and it was $PYTHON3_INTERPRETER])
      PYTHON=$PYTHON3_INTERPRETER
     fi
   fi