diff options
author | Phil Blundell <philb@gnu.org> | 2004-07-04 15:24:14 +0000 |
---|---|---|
committer | Phil Blundell <philb@gnu.org> | 2004-07-04 15:24:14 +0000 |
commit | fd62b55281f1493f24bd4dd0a9c6a2c078390221 (patch) | |
tree | f7a22963645a5c1ad9f49733b4cfe2289f78ed0e /classes/package.oeclass | |
parent | f8790318128135669c3d7fe5aa2a3a4ab8c0f814 (diff) |
rationalise module handling in kernel packages and MACHINE.conf files.
changed module naming to use - rather than + as replacement for underscore.
ignore errors from update-modules in postinst, in case modutils-collateral is in use.
add postrm scripts.
BKrev: 40e8211eLQcjqqTncCe6a_iEukTM_g
Diffstat (limited to 'classes/package.oeclass')
-rw-r--r-- | classes/package.oeclass | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/classes/package.oeclass b/classes/package.oeclass index 1c9cc53cbb..cde4ef6e5c 100644 --- a/classes/package.oeclass +++ b/classes/package.oeclass @@ -1,4 +1,7 @@ -def do_split_packages(d, root, file_regex, output_pattern, description, postinst=None, recursive=False, hook=None, extra_depends=None, aux_files_pattern=None): +def legitimize_package_name(s): + return s.lower().replace('_', '-').replace('@', '+') + +def do_split_packages(d, root, file_regex, output_pattern, description, postinst=None, recursive=False, hook=None, extra_depends=None, aux_files_pattern=None, postrm=None): import os, os.path, oe dvar = oe.data.getVar('D', d, 1) @@ -13,6 +16,8 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst if postinst: postinst = '#!/bin/sh\n' + postinst + if postrm: + postrm = '#!/bin/sh\n' + postrm if not recursive: objs = os.listdir(dvar + root) else: @@ -34,7 +39,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst f = os.path.join(dvar + root, o) if not stat.S_ISREG(os.lstat(f).st_mode): continue - on = m.group(1).lower().replace('_', '+').replace('@', '+') + on = legitimize_package_name(m.group(1)) pkg = output_pattern % on if not pkg in packages: packages.append(pkg) @@ -47,6 +52,8 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst oe.data.setVar('DESCRIPTION_' + pkg, description % on, d) if postinst: oe.data.setVar('pkg_postinst_' + pkg, postinst, d) + if postrm: + oe.data.setVar('pkg_postrm_' + pkg, postrm, d) else: oldfiles = oe.data.getVar('FILES_' + pkg, d, 1) if not oldfiles: @@ -220,6 +227,7 @@ python populate_packages () { write_if_exists(f, pkg, 'ALLOW_EMPTY') write_if_exists(f, pkg, 'FILES') write_if_exists(f, pkg, 'pkg_postinst') + write_if_exists(f, pkg, 'pkg_postrm') f.close() oe.build.exec_func("read_subpackage_metadata", d) } @@ -399,7 +407,7 @@ python package_do_split_locales() { mainpkg = packages[0] for l in locales: - ln = l.lower().replace('_', '+').replace('@', '+') + ln = legitimize_package_name(l) pkg = pn + '-locale-' + ln packages.append(pkg) oe.data.setVar('FILES_' + pkg, os.path.join(datadir, 'locale', l), d) |