Don't wipe explicit vcpkg directories

This commit is contained in:
Brad Davis 2018-11-08 15:44:28 -08:00
parent 3d2e723438
commit 5f6369daf6

View file

@ -126,6 +126,9 @@ class VcpkgRepo:
def outOfDate(self):
global args
# Prevent doing a clean if we've explcitly set a directory for vcpkg
if args.vcpkg_root is not None:
return False
if args.force_build:
return True
print("Looking for tag file {}".format(self.tagFile))
@ -147,28 +150,31 @@ class VcpkgRepo:
shutil.rmtree(cleanPath, ignore_errors=True)
def bootstrap(self):
global args
if self.outOfDate():
self.clean()
global args
downloadVcpkg = False
if args.force_bootstrap:
print("Forcing bootstrap")
downloadVcpkg = True
# don't download the vcpkg binaries if we're working with an explicit
# vcpkg directory (possibly a git checkout)
if args.vcpkg_root is None:
downloadVcpkg = False
if args.force_bootstrap:
print("Forcing bootstrap")
downloadVcpkg = True
if not downloadVcpkg and not os.path.isfile(self.exe):
print("Missing executable, boostrapping")
downloadVcpkg = True
# Make sure we have a vcpkg executable
testFile = os.path.join(self.path, '.vcpkg-root')
if not downloadVcpkg and not os.path.isfile(testFile):
print("Missing {}, bootstrapping".format(testFile))
downloadVcpkg = True
if not downloadVcpkg and not os.path.isfile(self.exe):
print("Missing executable, boostrapping")
downloadVcpkg = True
# Make sure we have a vcpkg executable
testFile = os.path.join(self.path, '.vcpkg-root')
if not downloadVcpkg and not os.path.isfile(testFile):
print("Missing {}, bootstrapping".format(testFile))
downloadVcpkg = True
if downloadVcpkg:
print("Fetching vcpkg from {} to {}".format(self.vcpkgUrl, self.path))
downloadAndExtract(self.vcpkgUrl, self.path, self.vcpkgHash)
if downloadVcpkg:
print("Fetching vcpkg from {} to {}".format(self.vcpkgUrl, self.path))
downloadAndExtract(self.vcpkgUrl, self.path, self.vcpkgHash)
print("Replacing port files")
portsPath = os.path.join(self.path, 'ports')
@ -184,7 +190,6 @@ class VcpkgRepo:
dest = os.path.join(self.path, 'installed')
downloadAndExtract(url, dest, hash)
def run(self, commands):
actualCommands = [self.exe, '--vcpkg-root', self.path]
actualCommands.extend(commands)