Left: | ||
Right: |
OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # coding: utf-8 | 2 # coding: utf-8 |
3 | 3 |
4 # This Source Code Form is subject to the terms of the Mozilla Public | 4 # This Source Code Form is subject to the terms of the Mozilla Public |
5 # License, v. 2.0. If a copy of the MPL was not distributed with this | 5 # License, v. 2.0. If a copy of the MPL was not distributed with this |
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 6 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
7 | 7 |
8 import sys | 8 import sys |
9 import os | 9 import os |
10 import posixpath | 10 import posixpath |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 if not pattern in file_content: | 290 if not pattern in file_content: |
291 file_content.append(pattern) | 291 file_content.append(pattern) |
292 f.seek(0, os.SEEK_SET) | 292 f.seek(0, os.SEEK_SET) |
293 f.truncate() | 293 f.truncate() |
294 for l in file_content: | 294 for l in file_content: |
295 print >>f, l | 295 print >>f, l |
296 | 296 |
297 if __name__ == "__main__": | 297 if __name__ == "__main__": |
298 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) | 298 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) |
299 | 299 |
300 if os.environ.get("SKIP_ENSURE_DEPENDENCIES"): | |
Sebastian Noack
2015/05/04 11:33:01
This will merely check whether the variable is set
kzar
2015/05/05 13:25:22
Well I realised that but sure, Done.
| |
301 logging.warning("SKIP_ENSURE_DEPENDENCIES environment variable set, skipping .") | |
Sebastian Noack
2015/05/04 11:33:01
I think I'd prefer to only show a warning if there
kzar
2015/05/05 13:25:22
Disagree with this one, I think that people that s
Sebastian Noack
2015/05/05 14:33:24
There are two situations in which people might use
Wladimir Palant
2015/05/05 14:46:37
While I'm not sure I agree with Sebastian's argume
kzar
2015/05/06 16:23:53
Felix / Matze - As you two are the main users/prop
Felix Dahlke
2015/05/06 16:31:23
Regarding the warning: Let's definitely have that
Sebastian Noack
2015/05/06 16:59:23
Nobody argues about that. We already have consensu
Felix Dahlke
2015/05/06 17:14:57
It'd be clear if you call it SKIP_DEPENDENCY_HG_UP
Wladimir Palant
2015/05/06 17:40:47
Mostly because these people never manage to provid
| |
302 sys.exit() | |
303 | |
300 parser = argparse.ArgumentParser(description="Verify dependencies for a set of repositories, by default the repository of this script.") | 304 parser = argparse.ArgumentParser(description="Verify dependencies for a set of repositories, by default the repository of this script.") |
301 parser.add_argument("repos", metavar="repository", type=str, nargs="*", help=" Repository path") | 305 parser.add_argument("repos", metavar="repository", type=str, nargs="*", help=" Repository path") |
302 parser.add_argument("-q", "--quiet", action="store_true", help="Suppress infor mational output") | 306 parser.add_argument("-q", "--quiet", action="store_true", help="Suppress infor mational output") |
303 args = parser.parse_args() | 307 args = parser.parse_args() |
304 | 308 |
305 if args.quiet: | 309 if args.quiet: |
306 logging.disable(logging.INFO) | 310 logging.disable(logging.INFO) |
307 | 311 |
308 repos = args.repos | 312 repos = args.repos |
309 if not len(repos): | 313 if not len(repos): |
310 repos = [os.path.dirname(__file__)] | 314 repos = [os.path.dirname(__file__)] |
311 for repo in repos: | 315 for repo in repos: |
312 resolve_deps(repo) | 316 resolve_deps(repo) |
OLD | NEW |