Tagged v6.5.6-RC1

Jonas Kalderstam jonas at cowboyprogrammer.org
Fri May 23 12:24:18 BST 2014


On 2014-05-23 Fri 11:16, rea at codelabs.ru wrote:
> Fri, May 23, 2014 at 10:14:31AM +0200, Tomasz Żok wrote:
> I'll check what is done for RedHat and Debian/Unbuntu to make sure
> that they also have some ways to make OI to use Python 2.x.

One idea could be to bundle a script which will try to find a suitable
version.

So main install script would have the following hash bang:

#!python_wrapper.sh


And python_wrapper would look something like:

    PYTHON="0"
    ### First try plain python
    if hash python 2>/dev/null;
    then
      PYVER=$(python -c "import sys;print(sys.version)")
      if [[ $PYVER == *2.* ]]
      then
        PYTHON="python"
      fi
    fi

    ### If plain python is not v2, then try with explicit versions
    if [[ $PYTHON == 0 ]]
    then
      if hash python2.7 2>/dev/null;
      then
        PYTHON="python2.7"
      fi
    fi

    ### And so on for other possible versions and executable names


But of course, the correct course of action is to support python3. This
is a quick and dirty way of making sure that python2 is used though.

--
Jonas Kalderstam
PGP key: 987C54AB0D4451ED
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20140523/c9007688/attachment-0003.sig>


More information about the OfflineIMAP-project mailing list