Re: yup and python2?


Subject: Re: yup and python2?
From: Patrick Callahan (pac1@tiac.net)
Date: Wed Dec 12 2001 - 17:39:27 MST


On Wednesday 12 December 2001 02:06, you wrote:
> Hi,
>
> I would like to update python (version 1.5) to python2 but didn't know if
> the upgrade would break the existing tools that use python in ydl 2.1?
> Anybody have any ideas if yup would break with python2?
>
> Thanks,
>
> John Schmidt
> jas@netbrick.com
yup does break if you try to use python2 to run it.
The solution I use is to have both python1.5.2 and python 2.2 installed

/bin/python is a sym link to either python1.5 or python2.2

cat <<EOF >/usr/bin/pythonsetver
#!/bin/sh
# script to set python to either version 1.5 or 2.2
cd /usr/bin
rm -rf /usr/bin/python
ln -s /usr/bin/python\$1 /usr/bin/python
ls -lah /usr/bin/python*
EOF

[root@localhost pac1]# chmod +x /usr/bin/pythonsetver
[root@localhost pac1]# /usr/bin/pythonsetver 1.5
lrwxrwxrwx 1 root root 18 Dec 12 19:17 /usr/bin/python ->
/usr/bin/python1.5
-rwxr-xr-x 1 root root 437k Sep 23 17:53 /usr/bin/python1.5
-rwxr-xr-x 1 root root 2.3M Dec 8 15:04 /usr/bin/python2.2
-rwxrwxr-x 1 root root 162 Dec 12 19:17 /usr/bin/pythonsetver

Then just yup to your heart's content.

When done,

just /usr/bin/pythonsetver 2.2

switch as needed.

[root@localhost pac1]# /usr/bin/pythonsetver 1.5
lrwxrwxrwx 1 root root 18 Dec 12 19:38 /usr/bin/python ->
/usr/bin/python1.5
-rwxr-xr-x 1 root root 437k Sep 23 17:53 /usr/bin/python1.5
-rwxr-xr-x 1 root root 2.3M Dec 8 15:04 /usr/bin/python2.2
-rwxrwxr-x 1 root root 162 Dec 12 19:38 /usr/bin/pythonsetver
[root@localhost pac1]# /usr/bin/pythonsetver 2.2
lrwxrwxrwx 1 root root 18 Dec 12 19:38 /usr/bin/python ->
/usr/bin/python2.2
-rwxr-xr-x 1 root root 437k Sep 23 17:53 /usr/bin/python1.5
-rwxr-xr-x 1 root root 2.3M Dec 8 15:04 /usr/bin/python2.2
-rwxrwxr-x 1 root root 162 Dec 12 19:38 /usr/bin/pythonsetver



This archive was generated by hypermail 2a24 : Wed Dec 12 2001 - 18:07:28 MST