[OE-core] [PATCH 1/1] license.bbclass: fix copying license directories failed

Paul Eggleton paul.eggleton at linux.intel.com
Fri Nov 22 09:54:27 UTC 2013


On Friday 22 November 2013 14:06:01 Hongxu Jia wrote:
> Hi Paul,
> 
> On 11/22/2013 12:41 AM, Paul Eggleton wrote:
> > Hi Hongxu,
> > 
> > On Wednesday 20 November 2013 18:39:02 Hongxu Jia wrote:
> >> For each recipe, it populated license files to
> >> ${LICENSE_DIRECTORY}/${PN},
> >> such as kernel's license dir was
> >> ${LICENSE_DIRECTORY}/kernel-3.10.17-yocto-standard;
> >> 
> >> In do_rootfs task, it copied license directories from
> >> ${LICENSE_DIRECTORY}/
> >> ${pkg}, and ${pkg} was listed in ${INSTALLED_PKGS};
> >> 
> >> We got ${INSTALLED_PKGS} by rpm query, such as the kernel were
> >> 'kernel-*',
> >> but the kernel's PN was linux-yocto, so searching ${LICENSE_DIRECTORY}/
> >> kernel-* failed.
> >> 
> >> Copied license directories from ${LICENSE_DIRECTORY}/${PN} fixed this
> >> issue.
> >> 
> >> [YOCTO #5572]
> >> 
> >> Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
> >> ---
> >> 
> >>   meta/classes/license.bbclass | 9 ++++++---
> >>   1 file changed, 6 insertions(+), 3 deletions(-)
> >> 
> >> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> >> index 6d7ee94..32605ff 100644
> >> --- a/meta/classes/license.bbclass
> >> +++ b/meta/classes/license.bbclass
> >> @@ -68,15 +68,18 @@ license_create_manifest() {
> >> 
> >>   		if [ "${COPY_LIC_DIRS}" = "1" ]; then
> >>   		
> >>   			for pkg in ${INSTALLED_PKGS}; do
> >>   			
> >>   				mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}
> >> 
> >> -				for lic in `ls ${LICENSE_DIRECTORY}/${pkg}`; do
> >> +				pkged_pn="$(sed -n "/^PACKAGE NAME: ${pkg}$/,/^$/ \
> >> +                                           {s/^RECIPE NAME: //;
> >> /^PACKAGE
> >> NAME:/d; /^PACKAGE VERSION:/d; /^LICENSE:/d; p}" \ +
> >> 
> >>                     ${LICENSE_MANIFEST})"
> >> 
> >> +				for lic in `ls ${LICENSE_DIRECTORY}/${pkged_pn}`; do
> > 
> > This isn't the right way to do this. If you need to look up the recipe
> > name
> > 
> > from the target package name, in master you can now use:
> >    oe-pkgdata-util lookup-recipe ${PKGDATA_DIR} "<list of packages>"
> 
> I am afraid to use oe-pkgdata-util here is not a good idea:
> 
> - everything we need has been listed in ${LICENSE_MANIFEST},
>    we just need to sort them out;
> 
> - the oe-pkgdata-util utility only support to search the specific
>    ${PKGDATA_DIR} directory which was  ${TMPDIR}/pkgdata/
>    ${MULTIMACH_TARGET_SYS}, but we need to search multiple
>    ${MULTIMACH_TARGET_SYS} directories;

Note that in 1.5 the pkgdata structure changed - it is now under the machine-
specific sysroot, so there is only one directory to look in.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list