packages/qt4/qt_packaging.inc: Fix packaging of the -dbg packages
authorHolger Freyther <zecke@selfish.org>
Tue, 22 Jan 2008 08:39:29 +0000 (08:39 +0000)
committerHolger Freyther <zecke@selfish.org>
Tue, 22 Jan 2008 08:39:29 +0000 (08:39 +0000)
    split in packages.bbclass gets called after the work in do_populate_packages_prepend()
    is done. This means that on the first packaging attempt no .debug files exist. So
    create one -dbg package for every plugin we find and assume that the file is getting
    split out.

packages/qt4/qt_packaging.inc

index 931c567..ba2a037 100644 (file)
@@ -134,22 +134,24 @@ python populate_packages_prepend() {
            new packages to the meta package.
            """
            plugin_dir     = bb.data.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/' % path, d)
-           plugin_dir_dbg = bb.data.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/.debug/' % path, d)
            if not os.path.exists("%s%s" % (bb.data.expand('${D}',d), plugin_dir)):
                bb.note("The path does not exist:", bb.data.expand('${D}', d), plugin_dir)
                return
 
-           plugin_name    = bb.data.expand('${QT_BASE_NAME}-plugin-%s-%%s' % name, d)
-           plugin_name_dbg= bb.data.expand('${QT_BASE_NAME}-plugin-%s-%%s-dbg' % name, d)
-           print plugin_name, plugin_name_dbg, glob
-
-           dev_packages = []
-           dev_hook = lambda a,pkg,b,c,d:dev_packages.append(pkg)
-           dbg_packages = []
-           dbg_hook = lambda a,pkg,b,c,d:dbg_packages.append(pkg)
-           do_split_packages(d, plugin_dir,     glob, plugin_name,     '{PN} %s for %%s' % name, extra_depends='', hook=dev_hook)
-           do_split_packages(d, plugin_dir_dbg, glob, plugin_name_dbg, '{PN} %s for %%s' % name, extra_depends='', hook=dbg_hook)
-
+            plugin_name    = bb.data.expand('${QT_BASE_NAME}-plugin-%s-%%s' % name, d)
+            dev_packages = []
+            dev_hook = lambda file,pkg,b,c,d:dev_packages.append((file,pkg))
+            do_split_packages(d, plugin_dir,     glob, plugin_name,     '{PN} %s for %%s' % name, extra_depends='', hook=dev_hook)
+            # Create a -dbg package as well
+            plugin_dir_dbg     = bb.data.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/.debug' % path, d)
+            packages = bb.data.getVar('PACKAGES',d)
+            for (file,package) in dev_packages:
+                packages = "%s %s-dbg" % (packages, package)
+                file_name = os.path.join(plugin_dir_dbg, os.path.basename(file))
+                bb.data.setVar("FILES_%s-dbg" % package, file_name, d)
+                bb.data.setVar("DESCRIPTION_%s-dbg" % package, "{PN} %s for %s" % (name, package), d) 
+
+            bb.data.setVar('PACKAGES', packages, d)
 
        qtopia_split('accessible',  'accessible',  '^libq(.*)\.so$')
        qtopia_split('codecs',      'codec',       '^libq(.*)\.so$')