OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # coding: utf-8 | 2 # coding: utf-8 |
3 | 3 |
4 # This file is part of the Adblock Plus build tools, | 4 # This file is part of the Adblock Plus build tools, |
5 # Copyright (C) 2006-2014 Eyeo GmbH | 5 # Copyright (C) 2006-2014 Eyeo GmbH |
6 # | 6 # |
7 # Adblock Plus is free software: you can redistribute it and/or modify | 7 # Adblock Plus is free software: you can redistribute it and/or modify |
8 # it under the terms of the GNU General Public License version 3 as | 8 # it under the terms of the GNU General Public License version 3 as |
9 # published by the Free Software Foundation. | 9 # published by the Free Software Foundation. |
10 # | 10 # |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 def get_revision_id(self, repo, rev="HEAD"): | 80 def get_revision_id(self, repo, rev="HEAD"): |
81 command = ["git", "rev-parse", "--revs-only", rev] | 81 command = ["git", "rev-parse", "--revs-only", rev] |
82 return subprocess.check_output(command, cwd=repo).strip() | 82 return subprocess.check_output(command, cwd=repo).strip() |
83 | 83 |
84 def pull(self, repo): | 84 def pull(self, repo): |
85 subprocess.check_call(["git", "fetch", "--quiet", "--all", "--tags"], cwd=re
po) | 85 subprocess.check_call(["git", "fetch", "--quiet", "--all", "--tags"], cwd=re
po) |
86 | 86 |
87 def update(self, repo, rev): | 87 def update(self, repo, rev): |
88 subprocess.check_call(["git", "checkout", "--quiet", rev], cwd=repo) | 88 subprocess.check_call(["git", "checkout", "--quiet", rev], cwd=repo) |
89 | 89 |
90 repo_types = { | 90 repo_types = OrderedDict(( |
91 "hg": Mercurial(), | 91 ("hg", Mercurial()), |
92 "git": Git(), | 92 ("git", Git()), |
93 } | 93 )) |
94 | 94 |
95 def parse_spec(path, line): | 95 def parse_spec(path, line): |
96 if "=" not in line: | 96 if "=" not in line: |
97 logging.warning("Invalid line in file %s: %s" % (path, line)) | 97 logging.warning("Invalid line in file %s: %s" % (path, line)) |
98 return None, None | 98 return None, None |
99 | 99 |
100 key, value = line.split("=", 1) | 100 key, value = line.split("=", 1) |
101 key = key.strip() | 101 key = key.strip() |
102 items = value.split() | 102 items = value.split() |
103 if not len(items): | 103 if not len(items): |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 else: | 246 else: |
247 logging.warning("Cannot restart %s automatically, please rerun" % target
) | 247 logging.warning("Cannot restart %s automatically, please rerun" % target
) |
248 | 248 |
249 if __name__ == "__main__": | 249 if __name__ == "__main__": |
250 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) | 250 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) |
251 repos = sys.argv[1:] | 251 repos = sys.argv[1:] |
252 if not len(repos): | 252 if not len(repos): |
253 repos = [os.getcwd()] | 253 repos = [os.getcwd()] |
254 for repo in repos: | 254 for repo in repos: |
255 resolve_deps(repo) | 255 resolve_deps(repo) |
OLD | NEW |