11
11
def get_bzr_branch_name():
12
12
output_lines = os.popen("bzr info").read().splitlines()
14
branch_matcher = re.compile(
15
r'\s*parent branch: (bzr\+ssh|http)://bazaar.launchpad.net/(?P<owner>.*?)/mixxx/(?P<branch_name>.*?)/$')
14
parent_matcher = re.compile(
15
r'\s*parent branch: (bzr\+ssh|http)://bazaar.launchpad.net/(?P<owner>.*?)/(?P<project>.*?)/(?P<branch_name>.*?)/$')
16
16
checkout_matcher = re.compile(
17
r'\s*checkout of branch: bzr\+ssh://bazaar.launchpad.net/%2Bbranch/(?P<project>.*?)/((?P<branch_name>.*?)/)?$')
17
r'\s*checkout of branch: (bzr\+ssh|http)://bazaar.launchpad.net/(?P<owner>.*?)/(?P<project>.*?)/((?P<branch_name>.*?)/)?$')
19
19
for line in output_lines:
20
match = branch_matcher.match(line)
20
match = checkout_matcher.match(line)
22
match = parent_matcher.match(line)
22
24
match = match.groupdict()
25
project = match['project']
26
branch_name = match['branch_name']
23
27
owner = match['owner']
24
branch_name = match['branch_name']
26
29
# Strip ~ from owner name
27
30
owner = owner.replace('~', '')
29
32
# Underscores are not ok in version names, dashes are fine though.
30
branch_name = branch_name.replace('_', '-')
34
branch_name = branch_name.replace('_', '-')
36
# Detect release Branch
37
if owner == '%2Bbranch' and project == 'mixxx':
39
return 'release-%s.x' % branch_name
32
42
# Don't include the default owner
33
43
if owner == 'mixxxdevelopers':
36
46
return "%s~%s" % (owner, branch_name)
38
match = checkout_matcher.match(line)
40
match = match.groupdict()
41
project = match['project']
42
branch_name = match['branch_name']
43
if project == 'mixxx':
45
return 'release-%s.x' % branch_name
48
47
# Fall back on branch nick.
48
print "ERROR: Could not determine branch name from output of 'bzr info'. Please file a bug with the output of 'bzr info' attached."
49
49
return os.popen('bzr nick').readline().strip()
52
51
def get_build_dir(platformString, bitwidth):
53
52
build_dir = '%s%s_build' % (platformString[0:3],bitwidth)