samples 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/usr/bin/python
  2. # Copyright (c) 2009 Google Inc. 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. import os.path
  6. import shutil
  7. import sys
  8. gyps = [
  9. 'app/app.gyp',
  10. 'base/base.gyp',
  11. 'build/temp_gyp/googleurl.gyp',
  12. 'build/all.gyp',
  13. 'build/common.gypi',
  14. 'build/external_code.gypi',
  15. 'chrome/test/security_tests/security_tests.gyp',
  16. 'chrome/third_party/hunspell/hunspell.gyp',
  17. 'chrome/chrome.gyp',
  18. 'media/media.gyp',
  19. 'net/net.gyp',
  20. 'printing/printing.gyp',
  21. 'sdch/sdch.gyp',
  22. 'skia/skia.gyp',
  23. 'testing/gmock.gyp',
  24. 'testing/gtest.gyp',
  25. 'third_party/bzip2/bzip2.gyp',
  26. 'third_party/icu38/icu38.gyp',
  27. 'third_party/libevent/libevent.gyp',
  28. 'third_party/libjpeg/libjpeg.gyp',
  29. 'third_party/libpng/libpng.gyp',
  30. 'third_party/libxml/libxml.gyp',
  31. 'third_party/libxslt/libxslt.gyp',
  32. 'third_party/lzma_sdk/lzma_sdk.gyp',
  33. 'third_party/modp_b64/modp_b64.gyp',
  34. 'third_party/npapi/npapi.gyp',
  35. 'third_party/sqlite/sqlite.gyp',
  36. 'third_party/zlib/zlib.gyp',
  37. 'v8/tools/gyp/v8.gyp',
  38. 'webkit/activex_shim/activex_shim.gyp',
  39. 'webkit/activex_shim_dll/activex_shim_dll.gyp',
  40. 'webkit/build/action_csspropertynames.py',
  41. 'webkit/build/action_cssvaluekeywords.py',
  42. 'webkit/build/action_jsconfig.py',
  43. 'webkit/build/action_makenames.py',
  44. 'webkit/build/action_maketokenizer.py',
  45. 'webkit/build/action_useragentstylesheets.py',
  46. 'webkit/build/rule_binding.py',
  47. 'webkit/build/rule_bison.py',
  48. 'webkit/build/rule_gperf.py',
  49. 'webkit/tools/test_shell/test_shell.gyp',
  50. 'webkit/webkit.gyp',
  51. ]
  52. def Main(argv):
  53. if len(argv) != 3 or argv[1] not in ['push', 'pull']:
  54. print 'Usage: %s push/pull PATH_TO_CHROME' % argv[0]
  55. return 1
  56. path_to_chrome = argv[2]
  57. for g in gyps:
  58. chrome_file = os.path.join(path_to_chrome, g)
  59. local_file = os.path.join(os.path.dirname(argv[0]), os.path.split(g)[1])
  60. if argv[1] == 'push':
  61. print 'Copying %s to %s' % (local_file, chrome_file)
  62. shutil.copyfile(local_file, chrome_file)
  63. elif argv[1] == 'pull':
  64. print 'Copying %s to %s' % (chrome_file, local_file)
  65. shutil.copyfile(chrome_file, local_file)
  66. else:
  67. assert False
  68. return 0
  69. if __name__ == '__main__':
  70. sys.exit(Main(sys.argv))