Bug 1216817 - Part 3: Add files from artifacts to $OBJDIR/_build_manifests/install/dist_bin. r=glandium

This allows to run |mach artifact install| immediately after |mach
configure| and not have a subsequent |mach build| delete the files
that |mach artifact install| copied into dist/bin.

--HG--
extra : commitid : DUlkhNNPeFt
extra : rebase_source : 0bebba8f16f5496fda762f2ec5402d9c5ea83448
This commit is contained in:
Nick Alexander 2015-10-30 12:39:46 -07:00
Родитель d9a97523e3
Коммит 77de883dd7
1 изменённых файлов: 18 добавлений и 1 удалений

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

@ -10,6 +10,10 @@ import os
import mozpack.path as mozpath
from mozpack.manifests import (
InstallManifest,
)
from mozbuild.base import (
MachCommandBase,
MachCommandConditions as conditions,
@ -168,7 +172,20 @@ class PackageFrontend(MachCommandBase):
self._set_log_level(verbose)
tree, job = self._compute_defaults(tree, job)
artifacts = self._make_artifacts(tree=tree, job=job)
return artifacts.install_from(source, self.bindir)
manifest_path = mozpath.join(self.topobjdir, '_build_manifests', 'install', 'dist_bin')
manifest = InstallManifest(manifest_path)
def install_callback(path, file_existed, file_updated):
if path not in manifest:
manifest.add_optional_exists(path)
retcode = artifacts.install_from(source, self.bindir, install_callback=install_callback)
if retcode == 0:
manifest.write(manifest_path)
return retcode
@ArtifactSubCommand('artifact', 'last',
'Print the last pre-built artifact installed.')