Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # YUM3.sh
- # v201303050112
- # [Tested on Fedora 18 x86_64 - yum-3.4.3-51 + python-2.7.3-13 + python3-3.3.0-1]
- # yum refuses to deal with python3 as default python version
- # here's a simple and dirt python version switcher
- # just copy to /bin/ and launch from your path as you would as usual
- # [sudo] yum3 [options] [command] [package ...]
- if [ -L /bin/python3 ] ; then
- echo -e "\e[00;31m * Switching to Python2 for YUM's sake \e[00m"
- # removing symlink && creating symlink to python2
- rm -f /bin/python && ln -s /bin/python2 /bin/python
- /bin/yum $@
- echo -e "\e[00;31m * Falling back to Python3 \e[00m"
- # removing symlink && creating back symlink to python3
- rm -f /bin/python && ln -s /bin/python3 /bin/python
- else
- echo -e "\e[00;31m * No symlink found, refusing to proceed \e[00m"
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement