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

14
pip.py
View file

@ -1378,8 +1378,10 @@ execfile(__file__)
return return
## FIXME: this is not a useful record: ## FIXME: this is not a useful record:
## Also a bad location ## Also a bad location
## And not right on Windows if sys.platform == 'win32':
install_location = os.path.join(sys.prefix, 'lib', 'python%s' % sys.version[:3]) 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) 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 ## FIXME: I'm not sure if this is a reasonable location; probably not
## but we can't put it in the default location, as that is a virtualenv symlink that isn't writable ## but we can't put it in the default location, as that is a virtualenv symlink that isn't writable
@ -1571,12 +1573,10 @@ class RequirementSet(object):
else: else:
req_to_install = reqs.pop(0) req_to_install = reqs.pop(0)
install = True 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 req_to_install.check_if_exists():
if not self.upgrade: install = False
# If we are upgrading, we still need to check the version if req_to_install.satisfied_by is not None and not self.upgrade:
install = False
if req_to_install.satisfied_by is not None:
logger.notify('Requirement already satisfied: %s' % req_to_install) logger.notify('Requirement already satisfied: %s' % req_to_install)
elif req_to_install.editable: elif req_to_install.editable:
logger.notify('Checking out %s' % req_to_install) logger.notify('Checking out %s' % req_to_install)