~ubuntu-branches/ubuntu/precise/enigmail/precise-security

« back to all changes in this revision

Viewing changes to build/unix/build-clang/create-manifest.py

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-11-12 16:36:01 UTC
  • mfrom: (0.12.15)
  • Revision ID: package-import@ubuntu.com-20121112163601-t8e8skdfi3ni9iqp
Tags: 2:1.4.6-0ubuntu0.12.04.1
* New upstream release v1.4.6
  - see LP: #1080212 for USN information
* Drop unneeded patches
  - remove debian/patches/correct-version-number.diff
  - remove debian/patches/dont_register_cids_multiple_times.diff
  - update debian/patches/series
* Support building in an objdir
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/python
 
2
 
 
3
import os
 
4
import os.path
 
5
import simplejson
 
6
import sys
 
7
import subprocess
 
8
import urllib
 
9
import glob
 
10
 
 
11
def check_run(args):
 
12
    r = subprocess.call(args)
 
13
    assert r == 0
 
14
 
 
15
old_files = glob.glob('*.manifest')
 
16
for f in old_files:
 
17
    try:
 
18
        os.unlink(f)
 
19
    except:
 
20
        pass
 
21
 
 
22
basedir = os.path.split(os.path.realpath(sys.argv[0]))[0]
 
23
tooltool = basedir + '/tooltool.py'
 
24
setup = basedir + '/setup.sh'
 
25
 
 
26
check_run(['python', tooltool, '-m', 'linux32.manifest', 'add',
 
27
           'clang-linux32.tar.bz2', setup])
 
28
check_run(['python', tooltool, '-m', 'linux64.manifest', 'add',
 
29
           'clang-linux64.tar.bz2', setup])
 
30
check_run(['python', tooltool, '-m', 'darwin.manifest', 'add',
 
31
           'clang-darwin.tar.bz2', setup])
 
32
 
 
33
def key_sort(item):
 
34
    item = item[0]
 
35
    if item == 'size':
 
36
        return 0
 
37
    if item == 'digest':
 
38
        return 1
 
39
    if item == 'algorithm':
 
40
        return 3
 
41
    return 4
 
42
 
 
43
rev = os.path.basename(os.getcwd()).split('-')[1]
 
44
 
 
45
for platform in ['darwin', 'linux32', 'linux64']:
 
46
    old_name = 'clang-' + platform + '.tar.bz2'
 
47
    manifest = platform + '.manifest'
 
48
    data = eval(file(manifest).read())
 
49
    new_name = data[1]['digest']
 
50
    data[1]['filename'] = 'clang.tar.bz2'
 
51
    data = [{'clang_version' : 'r%s' % rev }] + data
 
52
    out = file(manifest,'w')
 
53
    simplejson.dump(data, out, indent=0, item_sort_key=key_sort)
 
54
    out.write('\n')
 
55
    os.rename(old_name, new_name)