Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: tools/cr/cr/commands/install.py

Issue 99393002: [cr tool] Adding the install command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix apostrophe Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cr/cr/commands/install.py
diff --git a/tools/cr/cr/commands/install.py b/tools/cr/cr/commands/install.py
new file mode 100644
index 0000000000000000000000000000000000000000..51a02b36eea620866b4b67226d4e912f5135eb1d
--- /dev/null
+++ b/tools/cr/cr/commands/install.py
@@ -0,0 +1,36 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""A module for the install command."""
+
+import cr
+
+
+class InstallCommand(cr.Command):
+ """The implementation of the install command.
+
+ This first uses Builder.Build to bring the target up to date, and then
+ installs it using Installer.Reinstall.
+ The builder installs its command line arguments, and you can use those to
+ select which builder is used. Selecting the skip builder
+ (using --builder=skip) bypasses the build stage.
+ """
+
+ def __init__(self):
+ super(InstallCommand, self).__init__()
+ self.help = 'Install a binary'
+
+ def AddArguments(self, subparsers):
+ parser = super(InstallCommand, self).AddArguments(subparsers)
+ cr.Builder.AddArguments(self, parser)
+ cr.Installer.AddArguments(self, parser)
+ cr.Target.AddArguments(self, parser, allow_multiple=True)
+ self.ConsumeArgs(parser, 'the installer')
+ return parser
+
+ def Run(self, context):
+ targets = cr.Target.GetTargets(context)
+ if not cr.Installer.Skipping(context):
+ cr.Builder.Build(context, targets, [])
+ cr.Installer.Reinstall(context, targets, context.remains)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698