* [PATCH 0/1] license.bbclass: fix the code of installing and packaging license files
@ 2013-12-10 5:18 Qi.Chen
2013-12-10 5:18 ` [PATCH 1/1] " Qi.Chen
0 siblings, 1 reply; 2+ messages in thread
From: Qi.Chen @ 2013-12-10 5:18 UTC (permalink / raw)
To: openembedded-core
From: Chen Qi <Qi.Chen@windriver.com>
The following changes since commit 184038bedb20f74ba4dcad6ef2d92e87a9ba5f9a:
bitbake: fetch2/git: Ensure check is made in the correct directory (2013-12-06 14:10:15 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/license-rebuild
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/license-rebuild
Chen Qi (1):
license.bbclass: fix the code of installing and packaging license
files
meta/classes/license.bbclass | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] license.bbclass: fix the code of installing and packaging license files
2013-12-10 5:18 [PATCH 0/1] license.bbclass: fix the code of installing and packaging license files Qi.Chen
@ 2013-12-10 5:18 ` Qi.Chen
0 siblings, 0 replies; 2+ messages in thread
From: Qi.Chen @ 2013-12-10 5:18 UTC (permalink / raw)
To: openembedded-core
From: Chen Qi <Qi.Chen@windriver.com>
Previously, enabling and disabling 'LICENSE_CREATE_PACKAGE' doesn't cause
rerun of the packaging process. As a result, if this variable was enabled
before, then the generated packages would still require the '-lic' packages
even if the variable is now disabled.
Ideally, the packaging process should rerun if the value of the variable
LICENSE_CREATE_PACKAGE is modified. And as this variable also triggers
the installation of license files, the do_install task should also rerun
if the variable is modified. On the other hand, the tasks should not rerun
for native packages and nativesdk packages, because installing and packaging
the license files only applies to the target packages.
This patch achieves the above behavior.
[YOCTO #5635]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/classes/license.bbclass | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 7fe47b2..d35071c 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -98,15 +98,32 @@ python do_populate_lic() {
copy_license_files(lic_files_paths, destdir)
}
-# it would be better to copy them in do_install_append, but find_license_filesa is python
-python perform_packagecopy_prepend () {
+# Copy license files in do_install if necessary
+python install_lic_files() {
enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
lic_files_paths = find_license_files(d)
-
- # LICENSE_FILES_DIRECTORY starts with '/' so os.path.join cannot be used to join D and LICENSE_FILES_DIRECTORY
destdir = d.getVar('D', True) + os.path.join(d.getVar('LICENSE_FILES_DIRECTORY', True), d.getVar('PN', True))
copy_license_files(lic_files_paths, destdir)
+}
+do_install[postfuncs] += "install_lic_files "
+
+# When LICENSE_FILES_DIRECTORY or LICENSE_CREATE_PACKAGE changes, it should
+# only affect target packages
+python __anonymous() {
+ # The dependency of do_install should only apply for target packages...
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or \
+ bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or \
+ bb.data.inherits_class('cross-canadian', d):
+ return
+
+ d.appendVarFlag('do_install', 'vardeps', 'LICENSE_CREATE_PACKAGE LICENSE_FILES_DIRECTORY')
+}
+
+# Set up license packages if necessary
+python perform_packagecopy_prepend () {
+ enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
+ if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
add_package_and_files(d)
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-10 5:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 5:18 [PATCH 0/1] license.bbclass: fix the code of installing and packaging license files Qi.Chen
2013-12-10 5:18 ` [PATCH 1/1] " Qi.Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox