зеркало из https://github.com/mozilla/stoneridge.git
Make all build IDs unique
This commit is contained in:
Родитель
8b6e610147
Коммит
78f6dafdbc
|
@ -27,6 +27,7 @@ os_version = None
|
|||
download_platform = None
|
||||
download_suffix = None
|
||||
current_netconfig = None
|
||||
buildid_suffix = None
|
||||
|
||||
# Paths that multiple programs need to know about
|
||||
installroot = None
|
||||
|
@ -269,6 +270,18 @@ def setup_dirnames(srroot, srwork, srxpcout):
|
|||
# don't worry if we can't get it earlier in the process
|
||||
pass
|
||||
|
||||
_netconfig_ids = {
|
||||
'broadband':'0',
|
||||
'umts':'1',
|
||||
'gsm':'2',
|
||||
}
|
||||
|
||||
_os_ids = {
|
||||
'windows':'w',
|
||||
'linux':'l',
|
||||
'mac':'m',
|
||||
}
|
||||
|
||||
class ArgumentParser(argparse.ArgumentParser):
|
||||
"""An argument parser for stone ridge programs that handles the arguments
|
||||
required by all of them
|
||||
|
@ -290,6 +303,7 @@ class ArgumentParser(argparse.ArgumentParser):
|
|||
def parse_args(self, **kwargs):
|
||||
global _conffile
|
||||
global current_netconfig
|
||||
global buildid_suffix
|
||||
|
||||
args = argparse.ArgumentParser.parse_args(self, **kwargs)
|
||||
|
||||
|
@ -298,4 +312,6 @@ class ArgumentParser(argparse.ArgumentParser):
|
|||
|
||||
setup_dirnames(args._sr_root_, args._sr_work_, args._sr_xpcout_)
|
||||
|
||||
buildid_suffix = _os_ids[os_name] + _netconfig_ids[current_netconfig]
|
||||
|
||||
return args
|
||||
|
|
|
@ -27,14 +27,16 @@ class StoneRidgeInfoGatherer(object):
|
|||
build_info['branch'] = stoneridge.current_netconfig
|
||||
|
||||
# Due to the way the graph server works, we need to create a unique
|
||||
# build id for each build/netconfig combination. We also want to keep
|
||||
# build id for each build/os/netconfig combination. We also want to keep
|
||||
# the unmodified build ID around for posterity.
|
||||
build_info['original_buildid'] = cp.get('App', 'BuildID')
|
||||
# Cut off the century and the seconds from the date in the build id, as
|
||||
# they are relatively useless bits of information.
|
||||
buildid_base = build_info['original_buildid'][2:-2]
|
||||
# Build ID is limited to 16 characters in the receiving database.
|
||||
build_info['id'] = (buildid_base + stoneridge.current_netconfig)[:16]
|
||||
|
||||
# Build ID is limited to 16 characters in the receiving database, and
|
||||
# our suffix is 2 characters, so we truncate the original to 14
|
||||
# characters before adding our suffix. It should already be only 14
|
||||
# characters, but we do this Just In Case.
|
||||
buildid_base = build_info['original_buildid'][:14]
|
||||
build_info['id'] = buildid_base + stoneridge.buildid_suffix
|
||||
|
||||
machine_info = {}
|
||||
machine_info['name'] = platform.node()
|
||||
|
|
|
@ -31,8 +31,11 @@ for fname in sys.argv[1:]:
|
|||
|
||||
# See stoneridge_info_gatherer.py for why the buildid is the way it is.
|
||||
netconfig = info['test_build']['branch']
|
||||
os_name = info['test_machine']['os']
|
||||
buildid_suffix = (stoneridge._os_ids[os_name] +
|
||||
stoneridge._netconfig_ids[netconfig])
|
||||
original_buildid = info['test_build']['id']
|
||||
new_buildid = (original_buildid[2:-2] + netconfig)[:16]
|
||||
new_buildid = original_buildid[:14] + buildid_suffix
|
||||
|
||||
info['test_build']['original_buildid'] = original_buildid
|
||||
info['test_build']['id'] = new_buildid
|
||||
|
|
Загрузка…
Ссылка в новой задаче