~mixxxdevelopers/mixxx/mixxx-buildserver

« back to all changes in this revision

Viewing changes to mixxx/build/util.py

  • Committer: Albert Santoni
  • Date: 2011-03-20 00:27:15 UTC
  • mfrom: (2607.1.162 mixxx-1.9)
  • Revision ID: alberts@mixxx.org-20110320002715-sa2d88zbuc5kkyya
MergedĀ fromĀ 1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
def get_mixxx_version():
41
41
    """
42
 
    Parses defs.h to figure out the current Mixxx version.
 
42
    Figures out the current mixxx version:
 
43
        First parses build.h which will have the version number if this is not a release branch.
 
44
        If nothing there, uses defs_version.h.
43
45
    """
44
46
    #have to handle out-of-tree building, that's why the '#' :(
 
47
    buld = Script.File('#src/build.h')
45
48
    defs = Script.File('#src/defs_version.h')
 
49
    version = ""
46
50
 
47
 
    for line in open(str(defs)).readlines():
 
51
    for line in open(str(buld)).readlines():
48
52
        if line.strip().startswith("#define VERSION"):
49
53
            version = line
50
54
            break
51
 
    else:
 
55
            
 
56
    if version == "":
 
57
        for line in open(str(defs)).readlines():
 
58
            if line.strip().startswith("#define VERSION"):
 
59
                version = line
 
60
                break
 
61
 
 
62
    if version == "":
52
63
        raise ValueError("Version not found")
53
64
 
54
65
    version = version.split()[-1].replace('"', '')