Re: [OE-core] [PATCH] insane: Add SH4 musl mapping to the QA arch tests
Hello Khem, On 12/09/2016 03:29 AM, Khem Raj wrote: > >> On Dec 6, 2016, at 7:17 AM, Vladimir Zapolskiy wrote: >> >> This change allows to pass QA for packages built with sh4-oe-linux-musl >> toolchain, the problem is reproted while building core-image-minimal target: >> >> ERROR: readline-7.0-r0 do_package_qa: >> Error executing a python function in exec_python_func() autogenerated >> >> Signed-off-by: Vladimir Zapolskiy >> --- >> meta/classes/insane.bbclass | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass >> index 5ddb87b..01494e3 100644 >> --- a/meta/classes/insane.bbclass >> +++ b/meta/classes/insane.bbclass >> @@ -138,6 +138,7 @@ def package_qa_get_machine_dict(d): >> "microblaze": (189, 0,0, False, >> 32), >> "microblazeeb":(189, 0,0, False, >> 32), >> "microblazeel":(189, 0,0, True, >> 32), >> +"sh4":( 42, 0,0, True, >> 32), > > Can you also add sh4eb as well while you are at it ? > I don't build or do runtime testing of sh4eb, and you may notice that there is no any other sh4eb target in the file at the moment. I'll try to find some time in the future and test sh4eb linux, linux-musl and linux-uclibc toolchains and add all of them together as a distinct change. Since missing sh4 linux-musl hits me immediately, I would like to ask you to apply the change as is. Thank you. -- With best wishes, Vladimir -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] insane: Add SH4 musl mapping to the QA arch tests
This change allows to pass QA for packages built with sh4-oe-linux-musl toolchain, the problem is reproted while building core-image-minimal target: ERROR: readline-7.0-r0 do_package_qa: Error executing a python function in exec_python_func() autogenerated Signed-off-by: Vladimir Zapolskiy --- meta/classes/insane.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 5ddb87b..01494e3 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -138,6 +138,7 @@ def package_qa_get_machine_dict(d): "microblaze": (189, 0,0, False, 32), "microblazeeb":(189, 0,0, False, 32), "microblazeel":(189, 0,0, True, 32), +"sh4":( 42, 0,0, True, 32), }, "uclinux-uclibc" : { "bfin": ( 106, 0,0, True, 32), -- 2.10.2 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 1/2] chrpath: correct subprocess.Popen.communicate() return values
This is a non-functional change, which intends to correct element names of a tuple returned by Popen.communicate(). Both in python2 and python3 subprocess.Popen.communicate() method returns a tuple (stdoutdata, stderrdata), thus old assignments and collateral comments are incorrect from human's point of view, however formally there is no error in the code. The change is desired to have to avoid copy-paste errors in future. Signed-off-by: Vladimir Zapolskiy --- meta/classes/chrpath.bbclass | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass index cdd7f27..72e8a12 100644 --- a/meta/classes/chrpath.bbclass +++ b/meta/classes/chrpath.bbclass @@ -5,17 +5,17 @@ def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d): import subprocess as sub p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE) -err, out = p.communicate() -# If returned successfully, process stderr for results +out, err = p.communicate() +# If returned successfully, process stdout for results if p.returncode != 0: return -err = err.decode('utf-8') +out = out.decode('utf-8') # Handle RUNPATH as well as RPATH -err = err.replace("RUNPATH=","RPATH=") +out = out.replace("RUNPATH=","RPATH=") # Throw away everything other than the rpath list -curr_rpath = err.partition("RPATH=")[2] +curr_rpath = out.partition("RPATH=")[2] #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip())) rpaths = curr_rpath.split(":") new_rpaths = [] @@ -46,11 +46,11 @@ def process_file_darwin(cmd, fpath, rootdir, baseprefix, tmpdir, d): import subprocess as sub p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', fpath],stdout=sub.PIPE,stderr=sub.PIPE) -err, out = p.communicate() -# If returned successfully, process stderr for results +out, err = p.communicate() +# If returned successfully, process stdout for results if p.returncode != 0: return -for l in err.split("\n"): +for l in out.split("\n"): if "(compatibility" not in l: continue rpath = l.partition("(compatibility")[0].strip() @@ -59,7 +59,7 @@ def process_file_darwin(cmd, fpath, rootdir, baseprefix, tmpdir, d): newpath = "@loader_path/" + os.path.relpath(rpath, os.path.dirname(fpath.replace(rootdir, "/"))) p = sub.Popen([d.expand("${HOST_PREFIX}install_name_tool"), '-change', rpath, newpath, fpath],stdout=sub.PIPE,stderr=sub.PIPE) -err, out = p.communicate() +out, err = p.communicate() def process_dir (rootdir, directory, d): import stat -- 2.8.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 2/2] package: correct subprocess.Popen.communicate() return values
This is a non-functional change, which intends to correct element names of a tuple returned by Popen.communicate(). Both in python2 and python3 subprocess.Popen.communicate() method returns a tuple (stdoutdata, stderrdata), thus old assignments and collateral comments are incorrect from human's point of view, however formally there is no error in the code. The change is desired to have to avoid copy-paste errors in future. Signed-off-by: Vladimir Zapolskiy --- meta/classes/package.bbclass | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index d6204cf..c592ce1 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -1557,19 +1557,19 @@ python package_do_shlibs() { if file.endswith('.dylib') or file.endswith('.so'): rpath = [] p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-l', file],stdout=sub.PIPE,stderr=sub.PIPE) -err, out = p.communicate() -# If returned successfully, process stderr for results +out, err = p.communicate() +# If returned successfully, process stdout for results if p.returncode == 0: -for l in err.split("\n"): +for l in out.split("\n"): l = l.strip() if l.startswith('path '): rpath.append(l.split()[1]) p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', file],stdout=sub.PIPE,stderr=sub.PIPE) -err, out = p.communicate() -# If returned successfully, process stderr for results +out, err = p.communicate() +# If returned successfully, process stdout for results if p.returncode == 0: -for l in err.split("\n"): +for l in out.split("\n"): l = l.strip() if not l or l.endswith(":"): continue -- 2.8.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 0/2] meta/classes: correct subprocess.Popen.communicate() return values
This is a non-functional change, which intends to correct element names of a tuple returned by Popen.communicate() in oe-core classes chrpath and package. Both in python2 and python3 subprocess.Popen.communicate() method returns a tuple (stdoutdata, stderrdata), thus some old assignments and collateral comments are incorrect from human's point of view, however formally there is no error in the code. The issue was occasionally found by code inspection while investigating early build errors due to not installed chrpath utility on a host. The change is desired to have to avoid excessive astonishment while reading code and of course copy-paste errors in future. Vladimir Zapolskiy (2): chrpath: correct subprocess.Popen.communicate() return values package: correct subprocess.Popen.communicate() return values meta/classes/chrpath.bbclass | 18 +- meta/classes/package.bbclass | 12 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) -- 2.8.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] package_ipk: allow to specify OPKG_ARGS in local.conf
Hi Ross, On 02.12.2015 11:48, Burton, Ross wrote: > > On 2 December 2015 at 04:48, Vladimir Zapolskiy <mailto:v...@mleia.com>> wrote: > > sh: /tmp/opkg-5jPLag/run-postinsts-UsUtaI/preinst: /bin/sh: bad > interpreter: Permission denied > > > Whilst the patch is fine, this is worrying as noexec /tmp shouldn't > break opkg. Maybe opkg should be changed to use something in /var for > the scripts? > here IMHO two cases should be reviewed, build host side execution and opkg on a target. On a target /var/lib/opkg/$some_dir should be fine as a default temporary directory, and it might be nice to have a config option in /etc/opkg/opkg.conf On a build host side /var/* may have permission restrictions also, so * there should be a possibility to accept a user defined tmp dir, * if /tmp is not good enough as a default opkg directory, probably some subfolder of ${TOPDIR} should fit, either a fixed one or dynamic somewhere in a working folder of bb recipe, which calls opkg. Just my two cents. With best wishes, Vladimir -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] package_ipk: allow to specify OPKG_ARGS in local.conf
If user specific parameters to opkg are set in local.conf, they are rewritten in package_ipk.bbclass and ignored, instead append package_ipk specific arguments to the user defined ones. The change is needed, if a user has to pass an alternative path to a temporary directory for opkg, e.g. OPKG_ARGS = "--tmp-dir=${TOPDIR}/tmp-opkg" The default /tmp directory may be unusable for do_rootfs task, for example if there is no enough space or /tmp is mounted with noexec mount option, then an alternative path allows to complete do_rootfs and fix the problems like this: ERROR: Unable to install packages. ... sh: /tmp/opkg-5jPLag/run-postinsts-UsUtaI/preinst: /bin/sh: bad interpreter: Permission denied sh: /tmp/opkg-5jPLag/base-files-4hFwQS/preinst: /bin/sh: bad interpreter: Permission denied sh: /tmp/opkg-5jPLag/run-postinsts-UsUtaI/preinst: /bin/sh: bad interpreter: Permission denied sh: /tmp/opkg-5jPLag/busybox-syslog-sJmfbw/preinst: /bin/sh: bad interpreter: Permission denied ... Signed-off-by: Vladimir Zapolskiy --- meta/classes/package_ipk.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 4dd7a7e..51bee28 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -10,7 +10,7 @@ PKGWRITEDIRIPK = "${WORKDIR}/deploy-ipks" # Program to be used to build opkg packages OPKGBUILDCMD ??= "opkg-build" -OPKG_ARGS = "--force_postinstall --prefer-arch-to-version" +OPKG_ARGS += "--force_postinstall --prefer-arch-to-version" OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}" OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE', True) or "").split())][(d.getVar("PACKAGE_EXCLUDE", True) or "") != ""]}" -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] lttng: support more compatible hosts
THis change extends COMAPTIBLE_HOST matchings, which allows to include more hosts with TARGET_OS like linux-gnuspe or linux-gnueabi etc. Signed-off-by: Vladimir Zapolskiy --- meta/recipes-kernel/lttng-2.0/babeltrace_0.12.bb |4 ++-- meta/recipes-kernel/lttng-2.0/lttng-modules_2.0.5.bb |4 ++-- meta/recipes-kernel/lttng-2.0/lttng-tools_2.0.4.bb |4 ++-- meta/recipes-kernel/lttng-2.0/lttng2-ust_2.0.5.bb|4 ++-- meta/recipes-kernel/lttng/lttng-ust_0.16.bb |4 ++-- meta/recipes-support/liburcu/liburcu_0.6.7.bb|5 ++--- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/meta/recipes-kernel/lttng-2.0/babeltrace_0.12.bb b/meta/recipes-kernel/lttng-2.0/babeltrace_0.12.bb index eaf7eeb..95d65f5 100644 --- a/meta/recipes-kernel/lttng-2.0/babeltrace_0.12.bb +++ b/meta/recipes-kernel/lttng-2.0/babeltrace_0.12.bb @@ -12,7 +12,7 @@ DEPENDS = "gtk+ util-linux" SRCREV = "0d8f8c2ea27df096269aa76b4baeab26b68b95d4" PV = "0.12+git${SRCPV}" -PR = "r0" +PR = "r1" SRC_URI = "git://git.efficios.com/babeltrace.git;protocol=git" @@ -25,4 +25,4 @@ do_configure_prepend () { # Due to liburcu not building for MIPS currently this recipe needs to # be limited also. # So here let us first suppport x86/arm/powerpc platforms now. -COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*)-linux' +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*)-linux.*' diff --git a/meta/recipes-kernel/lttng-2.0/lttng-modules_2.0.5.bb b/meta/recipes-kernel/lttng-2.0/lttng-modules_2.0.5.bb index 4c78f36..d81e9b8 100644 --- a/meta/recipes-kernel/lttng-2.0/lttng-modules_2.0.5.bb +++ b/meta/recipes-kernel/lttng-2.0/lttng-modules_2.0.5.bb @@ -12,7 +12,7 @@ inherit module SRCREV = "4d3e89e379fc66480d729abe8daa5c86eb585400" PV = "2.0.pre11+git${SRCREV}" -PR = "r0" +PR = "r1" SRC_URI = "git://git.lttng.org/lttng-modules.git;protocol=git \ file://lttng-modules-replace-KERNELDIR-with-KERNEL_SRC.patch \ @@ -27,4 +27,4 @@ S = "${WORKDIR}/git" # Due to liburcu not building for MIPS currently this recipe needs to # be limited also. # So here let us first suppport x86/arm/powerpc platforms now. -COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*)-linux' +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*)-linux.*' diff --git a/meta/recipes-kernel/lttng-2.0/lttng-tools_2.0.4.bb b/meta/recipes-kernel/lttng-2.0/lttng-tools_2.0.4.bb index e7f1016..ab0cf15 100644 --- a/meta/recipes-kernel/lttng-2.0/lttng-tools_2.0.4.bb +++ b/meta/recipes-kernel/lttng-2.0/lttng-tools_2.0.4.bb @@ -13,7 +13,7 @@ DEPENDS = "liburcu popt lttng2-ust" SRCREV = "8c3919ea2dc77fdd47fb1c90e41490a20bb4d478" PV = "v2.0.1+git${SRCREV}" -PR = "r0" +PR = "r1" SRC_URI = "git://git.lttng.org/lttng-tools.git;protocol=git" @@ -29,4 +29,4 @@ FILES_${PN}-dbg += "${libdir}/lttng/libexec/.debug" # Due to liburcu not building for MIPS currently this recipe needs to # be limited also. # So here let us first suppport x86/arm/powerpc platforms now. -COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*)-linux' +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*)-linux.*' diff --git a/meta/recipes-kernel/lttng-2.0/lttng2-ust_2.0.5.bb b/meta/recipes-kernel/lttng-2.0/lttng2-ust_2.0.5.bb index 8f650a4..5e9a529 100644 --- a/meta/recipes-kernel/lttng-2.0/lttng2-ust_2.0.5.bb +++ b/meta/recipes-kernel/lttng-2.0/lttng2-ust_2.0.5.bb @@ -14,7 +14,7 @@ DEPENDS = "liburcu util-linux" SRCREV = "a367ee66aad3ffd21ef64d1b24efc6f862e09562" PV = "2.0.2+git${SRCPV}" -PR = "r0" +PR = "r1" SRC_URI = "git://git.lttng.org/lttng-ust.git;protocol=git" @@ -27,4 +27,4 @@ do_configure_prepend () { # Due to liburcu not building for MIPS currently this recipe needs to # be limited also. # So here let us first suppport x86/arm/powerpc platforms now. -COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*)-linux' +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*)-linux.*' diff --git a/meta/recipes-kernel/lttng/lttng-ust_0.16.bb b/meta/recipes-kernel/lttng/lttng-ust_0.16.bb index e954083..3618a2d 100644 --- a/meta/recipes-kernel/lttng/lttng-ust_0.16.bb +++ b/meta/recipes-kernel/lttng/lttng-ust_0.16.bb @@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=e647752e045a8c45b6f583771bd561ef \ DEPENDS = "liburcu" -PR = "r0" +PR = "r1" PE = "1" SRC_URI = "http://lttng.org/files/ust/releases/ust-${PV}.tar.gz"; @@ -28,5 +28,5 @@ inherit autotools # Due to liburcu not building on MIPS currently this recipe needs to # be limited also. # So here let us first suppport x86/arm/powerpc platforms now. -COMPATIBLE_HOST = '(x86_64.*|i.86.*|a
Re: [OE-core] Feature Developement vs. Stablisation and Bug fixing
Hi Richard, On 12.09.2012 13:15, Richard Purdie wrote: Hi, I know in the past this has taken some people by surprise. Both OE-Core and the Yocto Project are aiming at release points every six months, roughly October and April. In order to prepare for those there is a period of 6-8 weeks beforehand which is aimed at stabilisation and bug fixing. We are now entering that window where we need to heavily taper off new features and concentrate on the quality and stability of the release which is scheduled for mid October. I'm not saying no new feature patches will get taken but I will be asking questions like "why is this being worked on?" and "shouldn't this wait until after release?". I'd really like to see effort being focused on bugs now, not enhancements. I know there are a couple of things which have been worked on for a while and have been slightly delayed which I'd probably lean towards taking (some offline postinstall work spring to mind). I was asked whether I'd take a binutils update in a couple of weeks and the answer is no, I'd very likely not as we're at the point we need to lock in on the toolchain now (and major kernel version). Does anyone have any questions? do you expect to have a filed bug in Yocto's bugzilla to attract attention to a problem, or published patchset with problem description and a fix is sufficient? With best wishes, Vladimir ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
[OE-core] [PATCH 6/6 v2] classes/license: place all found licenses on one line
Cosmetic change, settle all found licenses into one line and report warning about missing licenses loudly. Signed-off-by: Vladimir Zapolskiy --- Changes from v1 to v2: * interpret backslash escapes in the closing echo meta/classes/license.bbclass |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 4b5954d..29fe938 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -112,16 +112,16 @@ license_create_manifest() { echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST} echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST} - echo "LICENSE: " >> ${LICENSE_MANIFEST} + echo -n "LICENSE:" >> ${LICENSE_MANIFEST} for lic in ${pkged_lic}; do # to reference a license file trim trailing + symbol if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then - echo ${lic} >> ${LICENSE_MANIFEST} + echo -n " ${lic}" >> ${LICENSE_MANIFEST} else - echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST} + echo "WARNING: The license listed ${lic} was not in the licenses collected for ${pkged_pn}" fi done - echo "" >> ${LICENSE_MANIFEST} + echo -e "\n" >> ${LICENSE_MANIFEST} done # Two options here: -- 1.7.10.4 ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
[OE-core] [PATCH 0/6] classes/license: various bugfixes and improvements
This trivial set of changes fixes several bugs including: * check license.manifest for multiple records about the same * put precise information about licensing into license.manifest * specify licensing of packages, where info is in form of LICENSE_${pkg} Also the change set has some intention to improve performance and source code readability. Vladimir Zapolskiy (6): classes/license: define LICENSE_MANIFEST variable classes/license: check license manifest for double records classes/license: remove redundant nested if statements classes/license: account LICENSE_${pkg} values in manifest classes/license: correct license info in lisense.manifest classes/license: place all found licenses on one line meta/classes/license.bbclass | 55 ++ 1 file changed, 34 insertions(+), 21 deletions(-) -- 1.7.10 ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
[OE-core] [PATCH 2/6] classes/license: check license manifest for double records
Trivial typo bugfix, avoid multiple records in license.manifest. Signed-off-by: Vladimir Zapolskiy --- meta/classes/license.bbclass |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 0335f41..021ab2e 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -93,7 +93,7 @@ license_create_manifest() { pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }' ${filename})" pkged_pv="$(sed -n 's/^PV: //p' ${filename})" # check to see if the package name exists in the manifest. if so, bail. - if ! grep -q "PACKAGE NAME: ${pkg}" ${filename}; then + if ! grep -q "^PACKAGE NAME: ${pkg}" ${LICENSE_MANIFEST}; then # exclude local recipes if [ ! "${pkged_pn}" = "*locale*" ]; then echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} -- 1.7.10 ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
[OE-core] [PATCH 3/6] classes/license: remove redundant nested if statements
Cosmetic change, which improves code perception. Also check for locale packages firstly, this shall improve performance a little. Signed-off-by: Vladimir Zapolskiy --- meta/classes/license.bbclass | 40 +++- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 021ab2e..8fb66be 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -90,26 +90,32 @@ license_create_manifest() { # not the best way to do this but licenses are not arch dependant iirc filename=`ls ${TMPDIR}/pkgdata/*/runtime-reverse/${pkg}| head -1` pkged_pn="$(sed -n 's/^PN: //p' ${filename})" + + # exclude locale recipes + if [ "${pkged_pn}" = "*locale*" ]; then + continue + fi + + # check to see if the package name exists in the manifest. if so, bail. + if grep -q "^PACKAGE NAME: ${pkg}" ${LICENSE_MANIFEST}; then + continue + fi + pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }' ${filename})" pkged_pv="$(sed -n 's/^PV: //p' ${filename})" - # check to see if the package name exists in the manifest. if so, bail. - if ! grep -q "^PACKAGE NAME: ${pkg}" ${LICENSE_MANIFEST}; then - # exclude local recipes - if [ ! "${pkged_pn}" = "*locale*" ]; then - echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} - echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST} - echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST} - echo "LICENSE: " >> ${LICENSE_MANIFEST} - for lic in ${pkged_lic}; do - if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then - echo ${lic}|sed s'/generic_//'g >> ${LICENSE_MANIFEST} - else - echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST} - fi - done - echo "" >> ${LICENSE_MANIFEST} + + echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} + echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST} + echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST} + echo "LICENSE: " >> ${LICENSE_MANIFEST} + for lic in ${pkged_lic}; do + if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then + echo ${lic}|sed s'/generic_//'g >> ${LICENSE_MANIFEST} + else + echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST} fi - fi + done + echo "" >> ${LICENSE_MANIFEST} done # Two options here: -- 1.7.10 ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
[OE-core] [PATCH 1/6] classes/license: define LICENSE_MANIFEST variable
Cosmetic change, saves space and reduces code line length. Signed-off-by: Vladimir Zapolskiy --- meta/classes/license.bbclass | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 432e580..0335f41 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -80,9 +80,10 @@ license_create_manifest() { # Get list of installed packages list_installed_packages | grep -v "locale" |sort > ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest INSTALLED_PKGS=`cat ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest` + LICENSE_MANIFEST="${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest" # remove existing license.manifest file - if [ -f ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest ]; then - rm ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest + if [ -f ${LICENSE_MANIFEST} ]; then + rm ${LICENSE_MANIFEST} fi # list of installed packages is broken for deb for pkg in ${INSTALLED_PKGS}; do @@ -95,18 +96,18 @@ license_create_manifest() { if ! grep -q "PACKAGE NAME: ${pkg}" ${filename}; then # exclude local recipes if [ ! "${pkged_pn}" = "*locale*" ]; then - echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest - echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest - echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest - echo "LICENSE: " >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest + echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} + echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST} + echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST} + echo "LICENSE: " >> ${LICENSE_MANIFEST} for lic in ${pkged_lic}; do if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then - echo ${lic}|sed s'/generic_//'g >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest + echo ${lic}|sed s'/generic_//'g >> ${LICENSE_MANIFEST} else - echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn}>> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest + echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST} fi done - echo "" >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest + echo "" >> ${LICENSE_MANIFEST} fi fi done @@ -117,7 +118,7 @@ license_create_manifest() { # With both options set we see a .5 M increase in core-image-minimal if [ -n "${COPY_LIC_MANIFEST}" ]; then mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/ - cp ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest ${IMAGE_ROOTFS}/usr/share/common-licenses/license.manifest + cp ${LICENSE_MANIFEST} ${IMAGE_ROOTFS}/usr/share/common-licenses/license.manifest if [ -n "${COPY_LIC_DIRS}" ]; then for pkg in ${INSTALLED_PKGS}; do mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg} -- 1.7.10 ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
[OE-core] [PATCH 5/6] classes/license: correct license info in lisense.manifest
Trivial change, do not cut off plus symbol from license name, otherwise information about package license is corrupted. Signed-off-by: Vladimir Zapolskiy --- meta/classes/license.bbclass |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 74a8306..4b5954d 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -103,10 +103,10 @@ license_create_manifest() { pkged_pv="$(sed -n 's/^PV: //p' ${filename})" pkged_name="$(basename $(readlink ${filename}))" - pkged_lic="$(sed -n "/^LICENSE_${pkged_name}: /{ s/^LICENSE_${pkged_name}: //; s/[+|&()*]/ /g; s/ */ /g; p }" ${filename})" + pkged_lic="$(sed -n "/^LICENSE_${pkged_name}: /{ s/^LICENSE_${pkged_name}: //; s/[|&()*]/ /g; s/ */ /g; p }" ${filename})" if [ -z ${pkged_lic} ]; then # fallback checking value of LICENSE - pkged_lic="$(sed -n "/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }" ${filename})" + pkged_lic="$(sed -n "/^LICENSE: /{ s/^LICENSE: //; s/[|&()*]/ /g; s/ */ /g; p }" ${filename})" fi echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} @@ -114,8 +114,9 @@ license_create_manifest() { echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST} echo "LICENSE: " >> ${LICENSE_MANIFEST} for lic in ${pkged_lic}; do - if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then - echo ${lic}|sed s'/generic_//'g >> ${LICENSE_MANIFEST} + # to reference a license file trim trailing + symbol + if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then + echo ${lic} >> ${LICENSE_MANIFEST} else echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST} fi -- 1.7.10 ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
[OE-core] [PATCH 4/6] classes/license: account LICENSE_${pkg} values in manifest
Trivial change, process LICENSE_${pkg} and LICENSE values. This fixes multiple cases, when license is not specified at all in license.manifest Signed-off-by: Vladimir Zapolskiy --- meta/classes/license.bbclass |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 8fb66be..74a8306 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -101,8 +101,13 @@ license_create_manifest() { continue fi - pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }' ${filename})" pkged_pv="$(sed -n 's/^PV: //p' ${filename})" + pkged_name="$(basename $(readlink ${filename}))" + pkged_lic="$(sed -n "/^LICENSE_${pkged_name}: /{ s/^LICENSE_${pkged_name}: //; s/[+|&()*]/ /g; s/ */ /g; p }" ${filename})" + if [ -z ${pkged_lic} ]; then + # fallback checking value of LICENSE + pkged_lic="$(sed -n "/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }" ${filename})" + fi echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST} -- 1.7.10 ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
[OE-core] [PATCH 6/6] classes/license: place all found licenses on one line
Cosmetic change, settle all found licenses into one line and report warning about missing licenses loudly. Signed-off-by: Vladimir Zapolskiy --- meta/classes/license.bbclass |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 4b5954d..82f4d9a 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -112,16 +112,16 @@ license_create_manifest() { echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST} echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST} - echo "LICENSE: " >> ${LICENSE_MANIFEST} + echo -n "LICENSE:" >> ${LICENSE_MANIFEST} for lic in ${pkged_lic}; do # to reference a license file trim trailing + symbol if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then - echo ${lic} >> ${LICENSE_MANIFEST} + echo -n " ${lic}" >> ${LICENSE_MANIFEST} else - echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST} + echo "WARNING: The license listed ${lic} was not in the licenses collected for ${pkged_pn}" fi done - echo "" >> ${LICENSE_MANIFEST} + echo "\n" >> ${LICENSE_MANIFEST} done # Two options here: -- 1.7.10 ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core