[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

./packages/libreoffice/3.3.0/experimental r2294: - Allow the generation of transitional openoffice.org-* packages.



------------------------------------------------------------
revno: 2294
committer: Matthias Klose <doko@canonical.com>
branch nick: experimental
timestamp: Sat 2011-01-01 20:45:36 +0100
message:
      - Allow the generation of transitional openoffice.org-* packages.
added:
  scripts/gentranspkgs.py
modified:
  changelog
  rules
=== modified file 'changelog'
--- a/changelog	2011-01-01 16:53:32 +0000
+++ b/changelog	2011-01-01 19:45:36 +0000
@@ -27,6 +27,7 @@
     - Don't special case CC_PREFIX on sparc, not needed.
     - Eliminate the explicit macros for the configuration of system
       components.
+    - Allow the generation of transitional openoffice.org-* packages.
   * debian/control.in:
     - Remove packages and versions in build dependencies,
       which are present in the last old stable release.

=== modified file 'rules'
--- a/rules	2011-01-01 16:08:21 +0000
+++ b/rules	2011-01-01 19:45:36 +0000
@@ -111,6 +111,8 @@
 PATCHSET=$(DIST)
 BUILD_DEPS=
 
+OOO_TRANS_PKGS=n
+
 # These are components which can be built from internal copies, or used from the
 # distribution. See configure --help for valid values (--with-system-<value>).
 SYSTEM_STUFF = dicts
@@ -1751,6 +1753,12 @@
 	perl -pi -e 's/^Breaks:.*myspell.*\n//' debian/control
 endif
 
+ifeq "$(OOO_TRANS_PKGS)" "y"
+	python debian/scripts/gentranspkgs.py < debian/control > debian/control.ooo
+	cat debian/control.ooo >> debian/control
+	rm -f debian/control.ooo
+endif
+
 .DELETE_ON_ERROR: debian/control
 
 build: build-arch build-indep

=== added file 'scripts/gentranspkgs.py'
--- a/scripts/gentranspkgs.py	1970-01-01 00:00:00 +0000
+++ b/scripts/gentranspkgs.py	2011-01-01 19:45:36 +0000
@@ -0,0 +1,49 @@
+#! /usr/bin/python
+
+import re, sys, fileinput
+
+skip_packages = ('')
+
+def gen_transitonal_packages():
+    skip = True
+    copy_fields = ('Section', 'Architecture', 'Priority', 'Description')
+    copy_fields = ('Section', 'Priority', 'Description')
+    pkgs = {}
+    for line in fileinput.input():
+        if line == '\n':
+            skip = True
+        if ':' in line:
+            f, v = line.split(':', 1)
+            v = v.strip()
+            if f == 'Package':
+                if v.startswith('libreoffice-'):
+                    n = v.replace('libreoffice-', 'openoffice.org-')
+                    p =  {'Depends': v}
+                    pkgs[n] = p
+                    skip = False
+                else:
+                    skip = True
+            if not skip and f in copy_fields:
+                p[f] = v
+                
+    for p, attrs in pkgs.iteritems():
+        if p in skip_packages:
+            continue
+        print "Package: %s" % p
+        print "Architecture: all"
+        for f, v in attrs.items():
+            if f in ('Depends', 'Description'):
+                continue
+            print "%s: %s" % (f, v)
+        print "Depends: %s" % attrs['Depends']
+        print "Description: %s" % attrs['Description']
+        print " This is a transitional package, replacing the OpenOffice.org packaging"
+        print " with the LibreOffice packaging."
+        print " ."
+        print " It can be safely removed after an upgrade."
+        print
+
+def main():
+    gen_transitonal_packages()
+
+main()


Reply to: