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