Files
tubestation/testing/taskcluster/scripts/builder/gaia_props.py
d2623a315c Bug 1132562 - Use workspace directory so autoclobber can function with caches r=wcosta
- Move builder scripts into tree proper instead of baked into docker images
2015-02-24 08:26:48 -08:00

42 lines
1.1 KiB
Python
Executable File

#! /usr/bin/env python
'''
Command line interface to fetch details from the b2g/config/gaia.json properties
file used to link a particular version of gaia to gecko.
'''
import argparse
import os
import json
import sys
import urlparse
parser = argparse.ArgumentParser(
description='Get various information about gaia version tied to particular \
gecko')
parser.add_argument('gecko', metavar="GECKO_DIR", help="Path to gecko revision")
parser.add_argument('prop', help="Property type",
choices=['repository', 'revision'])
args = parser.parse_args()
if not os.path.isdir(args.gecko):
print >> sys.stderr, 'Given gecko path is not a directory'
sys.exit(1)
props_path = os.path.join(args.gecko, 'b2g/config/gaia.json')
if not os.path.isfile(props_path):
print >> sys.stderr, \
'Gecko directory does not contain b2g/config/gaia.json'
sys.exit(1)
props = json.load(open(props_path))
if args.prop == 'revision':
print(props['revision']);
if args.prop == 'repository':
print(urlparse.urljoin('https://hg.mozilla.org', props['repo_path']))