1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

[svn r21132] Fixed --upgrade when a package is already installed (before it would not upgrade installed packages, even though it would download and appear to install them). Put install-record-X.txt in the right location on Windows (#7)

This commit is contained in:
Ian Bicking 2008-10-30 13:57:04 -05:00
parent 356b2a2547
commit fca571a9eb

10
pip.py
View file

@ -1378,7 +1378,9 @@ execfile(__file__)
return
## FIXME: this is not a useful record:
## Also a bad location
## And not right on Windows
if sys.platform == 'win32':
install_location = os.path.join(sys.prefix, 'Lib')
else:
install_location = os.path.join(sys.prefix, 'lib', 'python%s' % sys.version[:3])
record_filename = os.path.join(install_location, 'install-record-%s.txt' % self.name)
## FIXME: I'm not sure if this is a reasonable location; probably not
@ -1571,12 +1573,10 @@ class RequirementSet(object):
else:
req_to_install = reqs.pop(0)
install = True
if not self.ignore_installed and not req_to_install.editable:
if not self.ignore_installed and not req_to_install.editable and not self.upgrade:
if req_to_install.check_if_exists():
if not self.upgrade:
# If we are upgrading, we still need to check the version
install = False
if req_to_install.satisfied_by is not None:
if req_to_install.satisfied_by is not None and not self.upgrade:
logger.notify('Requirement already satisfied: %s' % req_to_install)
elif req_to_install.editable:
logger.notify('Checking out %s' % req_to_install)