~libreoffice/+junk/3.3

« back to all changes in this revision

Viewing changes to scripts/gentranspkgs.py

  • Committer: Matthias Klose
  • Date: 2011-01-01 20:18:14 UTC
  • Revision ID: doko@canonical.com-20110101201814-i3k731a5oc78fz0k
  * Merged Debian packaging up to r2290.
  * Allow the generation of transitional openoffice.org-* packages.
  * Add patches/no-mysql-cppcon-unpack.diff.

Show diffs side-by-side

added added

removed removed

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