Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 """A module for the install command.""" | |
| 6 | |
| 7 import cr | |
| 8 | |
| 9 | |
| 10 class InstallCommand(cr.Command): | |
| 11 """The implementation of the install command. | |
| 12 | |
| 13 This first uses Builder.Build to bring the target up to date, and then | |
| 14 installs it using Installer.Reinstall. | |
| 15 You can set the builder to a skip version to bypass that stage. | |
|
bulach
2013/12/02 18:33:09
this comment is a bit cryptic.. :) is it a command
| |
| 16 """ | |
| 17 | |
| 18 def __init__(self): | |
| 19 super(InstallCommand, self).__init__() | |
| 20 self.help = 'Install a binary' | |
| 21 | |
| 22 def AddArguments(self, subparsers): | |
| 23 parser = super(InstallCommand, self).AddArguments(subparsers) | |
| 24 cr.Builder.AddArguments(self, parser) | |
| 25 cr.Installer.AddArguments(self, parser) | |
| 26 cr.Target.AddArguments(self, parser, allow_multiple=True) | |
| 27 self.ConsumeArgs(parser, 'the installer') | |
| 28 return parser | |
| 29 | |
| 30 def Run(self, context): | |
| 31 targets = cr.Target.GetTargets(context) | |
| 32 if not cr.Installer.Skipping(context): | |
| 33 cr.Builder.Build(context, targets, []) | |
| 34 cr.Installer.Reinstall(context, targets, context.remains) | |
| OLD | NEW |