Bug 697

Summary: Get PY_MAJOR_VERSION failure at configure
Product: unbound Reporter: Kunitaka Namba <master>
Component: serverAssignee: unbound team <unbound-team>
Status: RESOLVED FIXED    
Severity: normal CC: cathya, wouter
Priority: P5    
Version: 1.5.4   
Hardware: Sun   
OS: other   

Description Kunitaka Namba 2015-08-25 15:56:47 CEST
configure Error:

checking for pthread_spinlock_t... yes
checking for pthread_rwlock_t... yes
./configure: line 15901: syntax error at line 16104: `(' unexpected


configure:

  16099    if test ! -z "$PYTHON_VERSION"; then
  16100         if test `$PYTHON -c "print('$PYTHON_VERSION' >= '2.4.0')"` = "False"; then
  16101                 as_fn_error $? "Python version >= 2.4.0 is required" "$LINENO" 5
  16102         fi
  16103
  16104       PY_MAJOR_VERSION="`$PYTHON -c "import sys; print(sys.version_info.major)"`"
  16105
  16106       # Have Python

Python 2.4 to 2.6 can not use "sys.version_info.major",
Better it was changed to "sys.version_info[0]"

https://docs.python.org/2.7/library/sys.html#sys.version_info

Changed in version 2.7: Added named component attributes


$ diff configure configure.org
16104c16104
<       PY_MAJOR_VERSION="`$PYTHON -c \"import sys; print(sys.version_info[0])\"`"
---
>       PY_MAJOR_VERSION="`$PYTHON -c "import sys; print(sys.version_info.major)"`"
Comment 1 Wouter Wijngaards 2015-08-28 08:57:15 CEST
Hi Kunitaka,

Thank you for the fix!  I did not know the python version numbering had changed.
I have applied the change to the source.

Best regards, Wouter