Chris Smart 92ad6107e1 Tell existing shell about upgraded pip
When using pip to upgrade itself on a system which already has it
installed, the existing shell does not quite know about the new version.
Even though the 'which' command knows about the new package, running
'pip' will actually execute the previous version.

This means any scripts which require a new version of pip will not work
as expected. This is related to 07123ebeaa39 "Fix wrong version of pip
used in bootstrap" where the wrong version of pip was being used
(although it was fixed in a different manner there due to the use of
virtualenv).

Note that this does not affect systems which do not already have pip
installed, nor instances which run a new shell after upgrading pip.

This can be seen if one uses apt-get to install pip on Ubuntu 14.04 and
then uses pip to upgrade itself. For example:

root@ubuntu:~# apt-get install python-pip

root@ubuntu:~# which pip
/usr/bin/pip

root@ubuntu:~# pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

root@ubuntu:~# pip install --upgrade pip

root@ubuntu:~# which pip
/usr/local/bin/pip

root@ubuntu:~# pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

root@ubuntu:~# hash -r pip

root@ubuntu:~# pip --version
pip 8.1.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)

This patch forces the shell to re-hash the location of pip after an
upgrade.

Change-Id: Ifd9182ec862d6f8e9de2f0e4dc7778fbd46bb594
2016-08-24 21:22:09 +10:00
..
2016-06-02 08:54:41 -05:00
2015-08-21 15:44:05 +00:00