echo
echo "*** fix headers"
cd $PRODUCT_INSTALL/bin
- sed -e "s%#\!.*python[0-9]*%#\!/usr/bin/env python3%" omniidl > _omniidl
+
+ pyVersionMajor=python$($PYTHONBIN -c 'import sys; print(".".join(map(str, sys.version_info[0:1])))')
+ if [ $? -ne 0 ]; then
+ echo ERROR: Failed to extract major Python version - assuming Python version equal to 3...
+ pyVersionMajor=python3
+ fi
+ echo INFO: Python version major: ${pyVersionMajor}
+ sed -e "s%#\!.*python[0-9]*%#\!/usr/bin/env ${pyVersionMajor}%" omniidl > _omniidl
mv -f _omniidl omniidl
chmod a+x omniidl
- sed -e "s%#\!.*python[0-9]*%#\!/usr/bin/env python3%" omniidlrun.py > _omniidlrun.py
+ sed -e "s%#\!.*python[0-9]*%#\!/usr/bin/env ${pyVersionMajor}%" omniidlrun.py > _omniidlrun.py
mv -f _omniidlrun.py omniidlrun.py
chmod a+x omniidlrun.py
fi