Bug 1403407 - Require cargo-vendor 0.1.12 to remove .cargo-ok. r=gps

MozReview-Commit-ID: 2LhIUMOvkRL

--HG--
extra : rebase_source : eb9eb30740cfcd88e0b16cab909b1ef7b599f0f6
This commit is contained in:
Xidorn Quan 2017-10-01 21:32:50 +11:00
Родитель 74f48233cc
Коммит da57ee4877
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -39,18 +39,18 @@ class VendorRust(MozbuildObject):
def check_cargo_vendor_version(self, cargo):
'''
Ensure that cargo-vendor is new enough. cargo-vendor 0.1.11 and newer
strips out .orig and .rej files which we want.
Ensure that cargo-vendor is new enough. cargo-vendor 0.1.12 and newer
strips out .cargo-ok, .orig and .rej files which we want.
'''
for l in subprocess.check_output([cargo, 'install', '--list']).splitlines():
# The line looks like one of the following:
# cargo-vendor v0.1.11:
# cargo-vendor v0.1.11 (file:///path/to/local/build/cargo-vendor):
# cargo-vendor v0.1.12:
# cargo-vendor v0.1.12 (file:///path/to/local/build/cargo-vendor):
# and we want to extract the version part of it
m = re.match('cargo-vendor v((\d+\.)*\d+)', l)
if m:
version = m.group(1)
return LooseVersion(version) >= b'0.1.11'
return LooseVersion(version) >= b'0.1.12'
return False
def check_modified_files(self):
@ -117,7 +117,7 @@ Please commit or stash these changes before vendoring, or re-run with `--ignore-
self.run_process(args=[cargo, 'install', 'cargo-vendor'],
append_env=env)
elif not self.check_cargo_vendor_version(cargo):
self.log(logging.INFO, 'cargo_vendor', {}, 'cargo-vendor >= 0.1.11 required; force-reinstalling (this may take a few minutes)...')
self.log(logging.INFO, 'cargo_vendor', {}, 'cargo-vendor >= 0.1.12 required; force-reinstalling (this may take a few minutes)...')
env = self.check_openssl()
self.run_process(args=[cargo, 'install', '--force', 'cargo-vendor'],
append_env=env)