python package_do_split_gconvs () {
import os
- def do_split(root, pattern, format, description, postinst):
- dvar = oe.data.getVar('D', d, 1)
- if not dvar:
- oe.error("D not defined")
- return
-
- packages = oe.data.getVar('PACKAGES', d, 1).split()
- if not packages:
- # might be glibc-initial
- return
-
- if postinst:
- postinst = '#!/bin/sh\n' + postinst
- objs = os.listdir(dvar + root)
- mainpkg = oe.data.getVar('PKG_' + packages[0], d) or packages[0]
- for o in objs:
- import re
- m = re.match(pattern, o)
- if not m:
- continue
- on = m.group(1).lower().replace('_', '+').replace('@', '+')
- pkg = format % on
- packages.append(pkg)
- oe.data.setVar('FILES_' + pkg, os.path.join(root, o), d)
- oe.data.setVar('RDEPENDS_' + pkg, mainpkg, d)
- oe.data.setVar('DESCRIPTION_' + pkg, description % on, d)
- if postinst:
- oe.data.setVar('pkg_postinst_' + pkg, postinst, d)
-
- oe.data.setVar('PACKAGES', ' '.join(packages), d)
-
if (oe.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'):
oe.note("package requested not splitting gconvs")
return
gconv_libdir = os.path.join(libdir, "gconv")
- do_split(gconv_libdir, '^(.*)\.so$', 'glibc-gconv-%s', 'gconv module for character set %s', None)
+ do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern='glibc-gconv-%s', description='gconv module for character set %s')
oe.data.setVar('PACKAGES', oe.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
}