• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /usr/bin/env python
2# Copyright 2016 The Chromium Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6import argparse
7import os
8import sys
9
10sys.path.append(
11    os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
12from dependency_manager import base_config
13
14
15def UpdateDependency(dependency, platform, path, config):
16  c = base_config.BaseConfig(config, writable=True)
17  c.AddCloudStorageDependencyUpdateJob(
18      dependency, platform, path, version=None, execute_job=True)
19
20
21def main(raw_args):
22  parser = argparse.ArgumentParser()
23  parser.add_argument('--config', required=True, type=os.path.realpath,
24                      help='Path to the dependency configuration file.')
25  parser.add_argument('--dependency', required=True,
26                      help='Dependency name.')
27  parser.add_argument('--path', required=True, type=os.path.realpath,
28                      help='Path to the new dependency.')
29  parser.add_argument('--platform', required=True,
30                      help='Platform to update.')
31  args = parser.parse_args(raw_args)
32  UpdateDependency(args.dependency, args.platform, args.path, args.config)
33  return 0
34
35
36if __name__ == '__main__':
37  sys.exit(main(sys.argv[1:]))
38