~libreoffice/+junk/3.3

« back to all changes in this revision

Viewing changes to scripts/gentranspkgs.py

  • Committer: Matthias Klose
  • Date: 2011-01-01 21:45:36 UTC
  • Revision ID: doko@canonical.com-20110101214536-tuygdwck1cbghcr6
- Fix list of dependency packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
import re, sys, fileinput
4
4
 
5
 
skip_packages = ('openoffice.org-dbg')
 
5
skip_packages = (
 
6
    'openoffice.org-dbg', # not in Ubuntu
 
7
    'openoffice.org-style-industrial' # not in LO
 
8
    )
6
9
 
7
10
def gen_transitonal_packages():
8
11
    skip = True
9
12
    copy_fields = ('Section', 'Architecture', 'Priority', 'Description')
10
13
    copy_fields = ('Section', 'Priority', 'Description')
11
 
    pkgs = {}
 
14
    pkgs = []
12
15
    for line in fileinput.input():
13
16
        if line == '\n':
14
17
            skip = True
18
21
            if f == 'Package':
19
22
                if v.startswith('libreoffice'):
20
23
                    n = v.replace('libreoffice', 'openoffice.org')
21
 
                    p =  {'Depends': v}
22
 
                    pkgs[n] = p
 
24
                    p =  {'Package': n, 'Depends': v}
 
25
                    pkgs.append(p)
23
26
                    skip = False
24
27
                else:
25
28
                    skip = True
26
29
            if not skip and f in copy_fields:
27
30
                p[f] = v
28
 
                
29
 
    for p, attrs in pkgs.iteritems():
30
 
        if p in skip_packages:
 
31
 
 
32
    for p in pkgs:
 
33
        if p['Package'] in skip_packages:
31
34
            continue
32
 
        print "Package: %s" % p
 
35
        print "Package: %s" % p['Package']
33
36
        print "Architecture: all"
34
 
        for f, v in attrs.items():
35
 
            if f in ('Depends', 'Description'):
 
37
        for f, v in p.items():
 
38
            if f in ('Package', 'Depends', 'Description'):
36
39
                continue
37
40
            print "%s: %s" % (f, v)
38
 
        print "Depends: %s" % attrs['Depends']
39
 
        print "Description: %s" % attrs['Description']
 
41
        print "Depends: %s" % p['Depends']
 
42
        print "Description: %s" % p['Description']
40
43
        print " This is a transitional package, replacing the OpenOffice.org packaging"
41
44
        print " with the LibreOffice packaging."
42
45
        print " ."