~ubuntu-branches/ubuntu/breezy/pysvn/breezy

« back to all changes in this revision

Viewing changes to Builder/brand_version.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2005-09-08 05:13:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050908051333-qgsa2rksrb4az1h4
Tags: 1.3.0-1
Package from release tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
branding_info = {}
11
11
 
12
12
for line in file( version_details ):
13
 
        line = line.strip()
14
 
        if len(line) == 0:
15
 
                continue
16
 
        if line[0:1] == ['#']:
17
 
                continue
 
13
    line = line.strip()
 
14
    if len(line) == 0:
 
15
        continue
 
16
    if line[0:1] == ['#']:
 
17
        continue
18
18
 
19
 
        key, value = [s.strip() for s in line.split('=',1)]
20
 
        branding_info[ key ] = value
 
19
    key, value = [s.strip() for s in line.split('=',1)]
 
20
    branding_info[ key ] = value
21
21
 
22
22
build_revision = os.popen( 'svnversion -c "%s" 2>&1' % os.environ.get( 'PYSVN_EXPORTED_FROM', '..' ), 'r' ).read().strip()
23
 
print build_revision
24
 
if build_revision == 'exported':
25
 
       build_revision = os.environ.get('PYSVN_BUILD_REVISION', '0')
26
23
# build_revision is either a range nnn:mmm or mmm
27
24
# we only want the mmm
28
25
build_revision = build_revision.split(':')[-1]
29
26
print 'Info: revision %s' % build_revision
30
27
 
31
 
revision, modifiers = re.compile( '(\d+)(.*)' ).search( build_revision ).groups()
32
 
 
33
 
if modifiers:
34
 
        branding_info['BUILD'] = '0'
 
28
if build_revision.find( 'exported' ) >= 0:
 
29
    branding_info['BUILD'] = '0'
35
30
else:
36
 
        branding_info['BUILD'] = revision
 
31
    revision, modifiers = re.compile( '(\d+)(.*)' ).search( build_revision ).groups()
 
32
 
 
33
    if modifiers:
 
34
        branding_info['BUILD'] = '0'
 
35
    else:
 
36
        branding_info['BUILD'] = revision
37
37
 
38
38
 
39
39
# read all the input text