~mixxxdevelopers/mixxx/features_multi-track

« back to all changes in this revision

Viewing changes to mixxx/build/util.py

  • Committer: Raffitea
  • Date: 2012-01-08 22:00:08 UTC
  • mfrom: (2837.3.15 mixxx-1.10)
  • Revision ID: raffitea-20120108220008-kjlduz99xdl84u4q
Merging from 1.10 to get SSMP3 fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
def get_bzr_branch_name():
12
12
    output_lines = os.popen("bzr info").read().splitlines()
13
13
 
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>.*?)/)?$')
18
18
 
19
19
    for line in output_lines:
20
 
        match = branch_matcher.match(line)
 
20
        match = checkout_matcher.match(line)
 
21
        if not match:
 
22
            match = parent_matcher.match(line)
21
23
        if match:
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']
25
28
 
26
29
            # Strip ~ from owner name
27
30
            owner = owner.replace('~', '')
28
31
 
29
32
            # Underscores are not ok in version names, dashes are fine though.
30
 
            branch_name = branch_name.replace('_', '-')
 
33
            if branch_name:
 
34
                branch_name = branch_name.replace('_', '-')
 
35
 
 
36
            # Detect release Branch
 
37
            if owner == '%2Bbranch' and project == 'mixxx':
 
38
                if branch_name:
 
39
                    return 'release-%s.x' % branch_name
 
40
                return 'trunk'
31
41
 
32
42
            # Don't include the default owner
33
43
            if owner == 'mixxxdevelopers':
34
44
                return branch_name
35
45
 
36
46
            return "%s~%s" % (owner, branch_name)
37
 
 
38
 
        match = checkout_matcher.match(line)
39
 
        if match:
40
 
            match = match.groupdict()
41
 
            project = match['project']
42
 
            branch_name = match['branch_name']
43
 
            if project == 'mixxx':
44
 
                if branch_name:
45
 
                    return 'release-%s.x' % branch_name
46
 
                return 'trunk'
47
 
 
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()
50
50
 
51
 
 
52
51
def get_build_dir(platformString, bitwidth):
53
52
    build_dir = '%s%s_build' % (platformString[0:3],bitwidth)
54
53
    return build_dir