* [PATCH] db: disable the ARM assembler mutex code
From: Li Zhou @ 2016-11-04 9:12 UTC (permalink / raw)
To: openembedded-core
The swpb in macro MUTEX_SET will cause "undefined instruction" error
on the new arm arches which don't support this assembly instruction
any more. If use ldrex/strex to replace swpb, the old arm arches don't
support them. So to avoid this issue, just disable the ARM assembler
mutex code, and use the default pthreads mutex.
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
meta/recipes-support/db/db_6.0.30.bb | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
index 50a469b..2d08b5e 100644
--- a/meta/recipes-support/db/db_6.0.30.bb
+++ b/meta/recipes-support/db/db_6.0.30.bb
@@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
-# Override the MUTEX setting here, the POSIX library is
-# the default - "POSIX/pthreads/library".
-# Don't ignore the nice SWP instruction on the ARM:
-# These enable the ARM assembler mutex code
-ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
-MUTEX = ""
-MUTEX_arm = "${ARM_MUTEX}"
-MUTEX_armeb = "${ARM_MUTEX}"
-EXTRA_OECONF += "${MUTEX}"
EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
# Cancel the site stuff - it's set for db3 and destroys the
--
2.9.3
^ permalink raw reply related
* [PATCH] db: disable the ARM assembler mutex code
From: Li Zhou @ 2016-11-04 9:07 UTC (permalink / raw)
To: openembedded-core
The swpb in macro MUTEX_SET will cause "undefined instruction" error
on the new arm arches which don't support this assembly instruction
any more. If use ldrex/strex to replace swpb, the old arm arches don't
support them. So to avoid this issue, just disable the ARM assembler
mutex code, and use the default pthreads mutex.
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
meta/recipes-support/db/db_6.0.30.bb | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
index 50a469b..2d08b5e 100644
--- a/meta/recipes-support/db/db_6.0.30.bb
+++ b/meta/recipes-support/db/db_6.0.30.bb
@@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
-# Override the MUTEX setting here, the POSIX library is
-# the default - "POSIX/pthreads/library".
-# Don't ignore the nice SWP instruction on the ARM:
-# These enable the ARM assembler mutex code
-ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
-MUTEX = ""
-MUTEX_arm = "${ARM_MUTEX}"
-MUTEX_armeb = "${ARM_MUTEX}"
-EXTRA_OECONF += "${MUTEX}"
EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
# Cancel the site stuff - it's set for db3 and destroys the
--
2.9.3
^ permalink raw reply related
* Re: uninative binary?
From: Robert P. J. Day @ 2016-11-04 8:02 UTC (permalink / raw)
To: Gary Thomas; +Cc: OE-core
In-Reply-To: <d1522ddb-4dd2-5f1c-5dc6-558ff6aefd75@mlbassoc.com>
On Fri, 4 Nov 2016, Gary Thomas wrote:
> Some of my customers need to be able to build without any
> network connectivity, so I normally use BB_NO_NETWORK="1"
>
> Is there a way to add the uninative "binary shim" to my
> download mirror? Given that the path includes a hash as
> a directory, it's not clear to me how to put it into my
> mirror.
weirdly, i was about to ask the very same question ... you should
have waited. :-)
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply
* Re: [PATCH v2 1/1] Make yocto-spdx support spdx2.0 SPEC
From: Lei, Maohui @ 2016-11-04 7:24 UTC (permalink / raw)
To: Jan-Simon Möller; +Cc: openembedded-core@lists.openembedded.org
In-Reply-To: <1955218.jzD2Ojm6fW@elrond>
Hi Simon
> Where do we stand:
> - v1 of patch submitted
> - comment to create/use dosocs-native tp avoid the separate install (well, +1)
> - comment that "the following direct dependencies that not belong to oe-core"
Sorry, I mean it's difficult to add them all into oe-core, because as you know, oe-core only contains base layer of recipes. But I don't think these recipes are base enough.
So, I think it's easier to let user install dosocs themselves.
> @Lei: can you find where those dependencies are ?
> (https://layers.openembedded.org/layerindex/branch/morty/recipes/)
The situation of these dependences is the following:
PostgreSQL ----- meta-oe
python-psycopg2 ----- meta-openstack
jinja2 ----- meta-python/meta-openstack
docopt ----- not found
SQLAlchemy ----- meta-python
Best regards
Lei
> -----Original Message-----
> From: Jan-Simon Möller [mailto:dl9pf@gmx.de]
> Sent: Thursday, November 03, 2016 5:06 PM
> To: Lei, Maohui
> Cc: Maxin B. John; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH v2 1/1] Make yocto-spdx support spdx2.0 SPEC
>
> Hi Lei, Maxin!
>
> Where do we stand:
> - v1 of patch submitted
> - comment to create/use dosocs-native tp avoid the separate install (well, +1)
> - comment that "the following direct dependencies that not belong to oe-core"
>
> Did I summarize that correctly ?
>
> @Maxin: what would you propose, work on the dependencies or let the user
> install ?
> @Lei: can you find where those dependencies are ?
> (https://layers.openembedded.org/layerindex/branch/morty/recipes/)
>
> Best,
> Jan-Simon
>
> Am Donnerstag, 3. November 2016, 04:02:42 schrieb Lei, Maohui:
> > Ping.
> >
> >
> >
> > > -----Original Message-----
> > > From: openembedded-core-bounces@lists.openembedded.org
> > > [mailto:openembedded-
> core-bounces@lists.openembedded.org] On Behalf Of
> > > Lei, Maohui
> > > Sent: Monday, October 17, 2016 9:04 AM
> > > To: Maxin B. John; Jan-Simon Möller
> > > Cc: jsmoeller@linuxfoundation.org;
> > > openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH
> > > v2 1/1] Make yocto-spdx support spdx2.0 SPEC Hi Maxin, Simon
> > >
> > >
> > > > > Instead of requesting the user to install the DoSOCSv2 from github
> > > > > or other repos, can we make the spdx.bbclass depend on
> > > > > "dosocs-native"
> > > >
> > > > or
> > > >
> > > > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> > > >
> > > >
> > > >
> > > > That's a good idea. I will try.
> > >
> > >
> > > I tried to make DoSOCSv2 recipe to oe-core, and find that there are at
> > > least
> the following direct dependencies that not belong to oe-core.
> > >
> > > PostgreSQL
> > > python-psycopg2
> > > jinja2
> > > python-magic
> > > docopt
> > > SQLAlchemy
> > > psycopg2
> > >
> > > I think it difficult to add them all into oe-core and it's the reason that
> > > why
> the original spdx module didn't add fossology into oe-core.
> > >
> > >
> > >
> > > Best regards
> > > Lei
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: openembedded-core-bounces@lists.openembedded.org
> > > > [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> > > > Lei, Maohui
> > > > Sent: Thursday, September 22, 2016 10:19 AM
> > > > To: Maxin B. John; Jan-Simon Möller
> > > > Cc: jsmoeller@linuxfoundation.org; openembedded-
> > > > core@lists.openembedded.org
> > > > Subject: Re: [OE-core] [PATCH v2 1/1] Make yocto-spdx support spdx2.0
> > > > SPEC
> > > >
> > > >
> > > >
> > > > Hi Maxin, Simon
> > > >
> > > >
> > > >
> > > > > It would be nice to include the reason for change from fossology to
> > > > > dosocs2 in the commit message too (from cover letter)
> > > >
> > > >
> > > >
> > > > OK, I will add the reasons into the commit message in v3.
> > > >
> > > >
> > > >
> > > > > Instead of requesting the user to install the DoSOCSv2 from github
> > > > > or other repos, can we make the spdx.bbclass depend on
> > > > > "dosocs-native"
> > > >
> > > > or
> > > >
> > > > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> > > >
> > > >
> > > >
> > > > That's a good idea. I will try.
> > > >
> > > >
> > > >
> > > >
> > > > Best Regards
> > > > Lei
> > > >
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Maxin B. John [mailto:maxin.john@intel.com]
> > > > > Sent: Monday, September 19, 2016 6:58 PM
> > > > > To: Lei, Maohui
> > > > > Cc: openembedded-core@lists.openembedded.org;
> > > > > jsmoeller@linuxfoundation.org
> > > > > Subject: Re: [OE-core] [PATCH v2 1/1] Make yocto-spdx support
> > > > > spdx2.0 SPEC
> > > > >
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > >
> > > > >
> > > > > Please find my comments below:
> > > > >
> > > > >
> > > > >
> > > > > On Mon, Sep 19, 2016 at 04:39:50PM +0800, Lei Maohui wrote:
> > > > >
> > > > > > More:
> > > > > > - change spdx tool from fossology to dosocs2
> > > > >
> > > > >
> > > > >
> > > > > It would be nice to include the reason for change from fossology to
> > > > > dosocs2 in the commit message too (from cover letter)
> > > > >
> > > > >
> > > > >
> > > > > > Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> > > > > > ---
> > > > > >
> > > > > > meta/classes/spdx.bbclass | 505
> > > > > >
> > > > > > ++++++++++++++++++------------------
> > > > >
> > > > > ----------
> > > > >
> > > > > > meta/conf/licenses.conf | 67 +-----
> > > > > > 2 files changed, 198 insertions(+), 374 deletions(-)
> > > > > >
> > > > > >
> > > > > >
> > > > > > diff --git a/meta/classes/spdx.bbclass b/meta/classes/spdx.bbclass
> > > > > > index 0c92765..27c0fa0 100644
> > > > > > --- a/meta/classes/spdx.bbclass
> > > > > > +++ b/meta/classes/spdx.bbclass
> > > > > > @@ -1,365 +1,252 @@
> > > > > >
> > > > > > # This class integrates real-time license scanning, generation of
> > > > > >
> > > > > > SPDX standard # output and verifiying license info during the
> > > > >
> > > > > building process.
> > > > >
> > > > > > -# It is a combination of efforts from the OE-Core, SPDX and
> > > > >
> > > > > Fossology projects.
> > > > >
> > > > > > +# It is a combination of efforts from the OE-Core, SPDX and
> > > > > > +DoSOCSv2
> > > > >
> > > > > projects.
> > > > >
> > > > > > #
> > > > > >
> > > > > > -# For more information on FOSSology:
> > > > > > -# http://www.fossology.org
> > > > > > -#
> > > > > > -# For more information on FOSSologySPDX commandline:
> > > > > > -# https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-
> > > > >
> > > > > SPDX-Web-API
> > > > >
> > > > > > +# For more information on DoSOCSv2:
> > > > > > +# https://github.com/DoSOCSv2
> > > > >
> > > > >
> > > > >
> > > > > Instead of requesting the user to install the DoSOCSv2 from github
> > > > > or other repos, can we make the spdx.bbclass depend on
> > > > > "dosocs-native"
> > > >
> > > > or
> > > >
> > > > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> > > > >
> > > > >
> > > > >
> > > > > That might make it easy to use this class.
> > > > >
> > > > >
> > > > >
> > > > > > # For more information on SPDX:
> > > > > > # http://www.spdx.org
> > > > > > #
> > > > > >
> > > > > > +# Note:
> > > > > > +# 1) Make sure DoSOCSv2 has beed installed in your host # 2) By
> > > > > > +default,spdx files will be output to the path which is defined
> > > > >
> > > > > as[SPDX_MANIFEST_DIR]
> > > > >
> > > > > > +# in ./meta/conf/licenses.conf.
> > > > > >
> > > > > >
> > > > > >
> > > > > > -# SPDX file will be output to the path which is defined
> > > > > > as[SPDX_MANIFEST_DIR] -# in ./meta/conf/licenses.conf.
> > > > > > +SPDXOUTPUTDIR = "${WORKDIR}/spdx_output_dir"
> > > > > >
> > > > > > SPDXSSTATEDIR = "${WORKDIR}/spdx_sstate_dir"
> > > > > >
> > > > > >
> > > > > >
> > > > > > # If ${S} isn't actually the top-level source directory, set
> > > >
> > > > SPDX_S
> > > >
> > > > > > to point at # the real top-level directory.
> > > > > > +
> > > > > >
> > > > > > SPDX_S ?= "${S}"
> > > > > >
> > > > > >
> > > > > >
> > > > > > python do_spdx () {
> > > > > >
> > > > > > import os, sys
> > > > > >
> > > > > > - import json, shutil
> > > > > > -
> > > > > > - info = {}
> > > > > > - info['workdir'] = d.getVar('WORKDIR', True)
> > > > > > - info['sourcedir'] = d.getVar('SPDX_S', True)
> > > > > > - info['pn'] = d.getVar('PN', True)
> > > > > > - info['pv'] = d.getVar('PV', True)
> > > > > > - info['spdx_version'] = d.getVar('SPDX_VERSION', True)
> > > > > > - info['data_license'] = d.getVar('DATA_LICENSE', True)
> > > > > > -
> > > > > > - sstatedir = d.getVar('SPDXSSTATEDIR', True)
> > > > > > - sstatefile = os.path.join(sstatedir, info['pn'] + info['pv'] +
> > > > >
> > > > > ".spdx")
> > > > >
> > > > > > + import json
> > > > > >
> > > > > >
> > > > > >
> > > > > > - manifest_dir = d.getVar('SPDX_MANIFEST_DIR', True)
> > > > > > - info['outfile'] = os.path.join(manifest_dir, info['pn'] +
> > > > >
> > > > > ".spdx" )
> > > > >
> > > > > > + ## It's no necessary to get spdx files for *-native
> > > > > > + if d.getVar('PN', True) == d.getVar('BPN', True) + "-native":
> > > > > > + return None
> > > > > >
> > > > > >
> > > > > >
> > > > > > - info['spdx_temp_dir'] = d.getVar('SPDX_TEMP_DIR', True)
> > > > > > - info['tar_file'] = os.path.join(info['workdir'], info['pn'] +
> > > > >
> > > > > ".tar.gz" )
> > > > >
> > > > > > + ## gcc is too big to get spdx file.
> > > > > > + if 'gcc' in d.getVar('PN', True):
> > > > > > + return None
> > > > > >
> > > > > >
> > > > > >
> > > > > > - # Make sure important dirs exist
> > > > > > - try:
> > > > > > - bb.utils.mkdirhier(manifest_dir)
> > > > > > - bb.utils.mkdirhier(sstatedir)
> > > > > > - bb.utils.mkdirhier(info['spdx_temp_dir'])
> > > > > > - except OSError as e:
> > > > > > - bb.error("SPDX: Could not set up required directories: " +
> > > > >
> > > > > str(e))
> > > > >
> > > > > > - return
> > > > > > + info = {}
> > > > > > + info['workdir'] = (d.getVar('WORKDIR', True) or "")
> > > > > > + info['pn'] = (d.getVar( 'PN', True ) or "")
> > > > > > + info['pv'] = (d.getVar( 'PV', True ) or "")
> > > > > > + info['package_download_location'] = (d.getVar( 'SRC_URI',
> > > > > > + True
> > > > > > + )
> > > > >
> > > > > or "")
> > > > >
> > > > > > + if info['package_download_location'] != "":
> > > > > > + info['package_download_location'] =
> > > > >
> > > > > info['package_download_location'].split()[0]
> > > > >
> > > > > > + info['spdx_version'] = (d.getVar('SPDX_VERSION', True) or '')
> > > > > > + info['data_license'] = (d.getVar('DATA_LICENSE', True) or '')
> > > > > > + info['creator'] = {}
> > > > > > + info['creator']['Tool'] = (d.getVar('CREATOR_TOOL', True) or
> > > >
> > > > '')
> > > >
> > > > > > + info['license_list_version'] =
> > > > > > + (d.getVar('LICENSELISTVERSION',
> > > > >
> > > > > True) or '')
> > > > >
> > > > > > + info['package_homepage'] = (d.getVar('HOMEPAGE', True) or "")
> > > > > > + info['package_summary'] = (d.getVar('SUMMARY', True) or "")
> > > > > > + info['package_summary'] =
> > > > >
> > > > > info['package_summary'].replace("\n","")
> > > > >
> > > > > > + info['package_summary'] =
> > > >
> > > > info['package_summary'].replace("'","
> > > >
> > > > > > + ")
> > > > > > +
> > > > > > + spdx_sstate_dir = (d.getVar('SPDXSSTATEDIR', True) or "")
> > > > > > + manifest_dir = (d.getVar('SPDX_MANIFEST_DIR', True) or "")
> > > > > > + info['outfile'] = os.path.join(manifest_dir, info['pn'] + "-"
> > > >
> > > > +
> > > >
> > > > > info['pv'] + ".spdx" )
> > > > >
> > > > > > + sstatefile = os.path.join(spdx_sstate_dir,
> > > > > > + info['pn'] + "-" + info['pv'] + ".spdx" )
> > > > > >
> > > > > >
> > > > > >
> > > > > > ## get everything from cache. use it to decide if
> > > > > >
> > > > > > - ## something needs to be rerun
> > > > > > - cur_ver_code = get_ver_code(info['sourcedir'])
> > > > > > + ## something needs to be rerun
> > > > > > + if not os.path.exists( spdx_sstate_dir ):
> > > > > > + bb.utils.mkdirhier( spdx_sstate_dir )
> > > > > > +
> > > > > > + d.setVar('WORKDIR', d.getVar('SPDX_TEMP_DIR', True))
> > > > > > + info['sourcedir'] = (d.getVar('SPDX_S', True) or "")
> > > > > > + cur_ver_code = get_ver_code( info['sourcedir'] ).split()[0]
> > > > > >
> > > > > > cache_cur = False
> > > > > >
> > > > > > - if os.path.exists(sstatefile):
> > > > > > + if os.path.exists( sstatefile ):
> > > > > >
> > > > > > ## cache for this package exists. read it in
> > > > > >
> > > > > > - cached_spdx = get_cached_spdx(sstatefile)
> > > > > > -
> > > > > > - if cached_spdx['PackageVerificationCode'] == cur_ver_code:
> > > > > > - bb.warn("SPDX: Verification code for " + info['pn']
> > > > > > - + "is same as cache's. do nothing")
> > > > > > + cached_spdx = get_cached_spdx( sstatefile )
> > > > > > + if cached_spdx:
> > > > > > + cached_spdx = cached_spdx.split()[0]
> > > > > > + if (cached_spdx == cur_ver_code):
> > > > > > + bb.warn(info['pn'] + "'s ver code same as cache's. do
> > > > > > + nothing")
> > > > > >
> > > > > > cache_cur = True
> > > > > >
> > > > > > + create_manifest(info,sstatefile)
> > > > > > + if not cache_cur:
> > > > > > + ## setup dosocs2 command
> > > > > > + dosocs2_command = "dosocs2 oneshot %s" % info['sourcedir']
> > > > > > + ## no necessary to scan the git directory.
> > > > > > + git_path = "%s/.git" % info['sourcedir']
> > > > > > + if os.path.exists(git_path):
> > > > > > + remove_dir_tree(git_path)
> > > > > > +
> > > > > > + ## Get spdx file
> > > > > > + run_dosocs2(dosocs2_command,sstatefile)
> > > > > > + if get_cached_spdx( sstatefile ) != None:
> > > > > > + write_cached_spdx( info,sstatefile,cur_ver_code )
> > > > > > + ## CREATE MANIFEST(write to outfile )
> > > > > > + create_manifest(info,sstatefile)
> > > > > >
> > > > > > else:
> > > > > >
> > > > > > - local_file_info = setup_foss_scan(info, True,
> > > > >
> > > > > cached_spdx['Files'])
> > > > >
> > > > > > - else:
> > > > > > - local_file_info = setup_foss_scan(info, False, None)
> > > > > > -
> > > > > > - if cache_cur:
> > > > > > - spdx_file_info = cached_spdx['Files']
> > > > > > - foss_package_info = cached_spdx['Package']
> > > > > > - foss_license_info = cached_spdx['Licenses']
> > > > > > - else:
> > > > > > - ## setup fossology command
> > > > > > - foss_server = d.getVar('FOSS_SERVER', True)
> > > > > > - foss_flags = d.getVar('FOSS_WGET_FLAGS', True)
> > > > > > - foss_full_spdx = d.getVar('FOSS_FULL_SPDX', True) ==
> > > >
> > > > "true"
> > > >
> > > > > or False
> > > > >
> > > > > > - foss_command = "wget %s --post-file=%s %s"\
> > > > > > - % (foss_flags, info['tar_file'], foss_server)
> > > > > > -
> > > > > > - foss_result = run_fossology(foss_command, foss_full_spdx)
> > > > > > - if foss_result is not None:
> > > > > > - (foss_package_info, foss_file_info, foss_license_info)
> > > >
> > > > =
> > > >
> > > > > foss_result
> > > > >
> > > > > > - spdx_file_info = create_spdx_doc(local_file_info,
> > > > >
> > > > > foss_file_info)
> > > > >
> > > > > > - ## write to cache
> > > > > > - write_cached_spdx(sstatefile, cur_ver_code,
> > > > >
> > > > > foss_package_info,
> > > > >
> > > > > > - spdx_file_info, foss_license_info)
> > > > > > - else:
> > > > > > - bb.error("SPDX: Could not communicate with FOSSology
> > > > >
> > > > > server. Command was: " + foss_command)
> > > > >
> > > > > > - return
> > > > > > -
> > > > > > - ## Get document and package level information
> > > > > > - spdx_header_info = get_header_info(info, cur_ver_code,
> > > > >
> > > > > foss_package_info)
> > > > >
> > > > > > + bb.warn('Can\'t get the spdx file ' + info['pn'] + '.
> > > > >
> > > > > Please check your dosocs2.')
> > > > >
> > > > > > + d.setVar('WORKDIR', info['workdir']) } ## Get the src after
> > > > > > +do_patch.
> > > > > > +python do_get_spdx_s() {
> > > > > >
> > > > > >
> > > > > >
> > > > > > - ## CREATE MANIFEST
> > > > > > - create_manifest(info, spdx_header_info, spdx_file_info,
> > > > >
> > > > > foss_license_info)
> > > > >
> > > > > > + ## It's no necessary to get spdx files for *-native
> > > > > > + if d.getVar('PN', True) == d.getVar('BPN', True) + "-native":
> > > > > > + return None
> > > > > >
> > > > > >
> > > > > >
> > > > > > - ## clean up the temp stuff
> > > > > > - shutil.rmtree(info['spdx_temp_dir'], ignore_errors=True)
> > > > > > - if os.path.exists(info['tar_file']):
> > > > > > - remove_file(info['tar_file'])
> > > > > > + ## gcc is too big to get spdx file.
> > > > > > + if 'gcc' in d.getVar('PN', True):
> > > > > > + return None
> > > > > > +
> > > > > > + ## Change the WORKDIR to make do_unpack do_patch run in
> > > >
> > > > another
> > > >
> > > > > dir.
> > > > >
> > > > > > + d.setVar('WORKDIR', d.getVar('SPDX_TEMP_DIR', True))
> > > > > > + ## The changed 'WORKDIR' also casued 'B' changed, create dir
> > > >
> > > > 'B'
> > > >
> > > > > for the
> > > > >
> > > > > > + ## possibly requiring of the following tasks (such as some
> > > > >
> > > > > recipes's
> > > > >
> > > > > > + ## do_patch required 'B' existed).
> > > > > > + bb.utils.mkdirhier(d.getVar('B', True))
> > > > > > +
> > > > > > + ## The kernel source is ready after do_validate_branches
> > > > > > + if bb.data.inherits_class('kernel-yocto', d):
> > > > > > + bb.build.exec_func('do_unpack', d)
> > > > > > + bb.build.exec_func('do_kernel_checkout', d)
> > > > > > + bb.build.exec_func('do_validate_branches', d)
> > > > > > + else:
> > > > > > + bb.build.exec_func('do_unpack', d)
> > > > > > + ## The S of the gcc source is work-share
> > > > > > + flag = d.getVarFlag('do_unpack', 'stamp-base', True)
> > > > > > + if flag:
> > > > > > + d.setVar('S', d.getVar('WORKDIR', True) + "/gcc-" +
> > > > >
> > > > > d.getVar('PV', True))
> > > > >
> > > > > > + bb.build.exec_func('do_patch', d)
> > > > > >
> > > > > > }
> > > > > >
> > > > > > -addtask spdx after do_patch before do_configure
> > > > > > -
> > > > > > -def create_manifest(info, header, files, licenses):
> > > > > > - import codecs
> > > > > > - with codecs.open(info['outfile'], mode='w', encoding='utf-8')
> > > >
> > > > as
> > > >
> > > > > f:
> > > > >
> > > > > > - # Write header
> > > > > > - f.write(header + '\n')
> > > > > > -
> > > > > > - # Write file data
> > > > > > - for chksum, block in files.iteritems():
> > > > > > - f.write("FileName: " + block['FileName'] + '\n')
> > > > > > - for key, value in block.iteritems():
> > > > > > - if not key == 'FileName':
> > > > > > - f.write(key + ": " + value + '\n')
> > > > > > - f.write('\n')
> > > > > > -
> > > > > > - # Write license data
> > > > > > - for id, block in licenses.iteritems():
> > > > > > - f.write("LicenseID: " + id + '\n')
> > > > > > - for key, value in block.iteritems():
> > > > > > - f.write(key + ": " + value + '\n')
> > > > > > - f.write('\n')
> > > > > > -
> > > > > > -def get_cached_spdx(sstatefile):
> > > > > > - import json
> > > > > > - import codecs
> > > > > > - cached_spdx_info = {}
> > > > > > - with codecs.open(sstatefile, mode='r', encoding='utf-8') as f:
> > > > > > - try:
> > > > > > - cached_spdx_info = json.load(f)
> > > > > > - except ValueError as e:
> > > > > > - cached_spdx_info = None
> > > > > > - return cached_spdx_info
> > > > > >
> > > > > >
> > > > > >
> > > > > > -def write_cached_spdx(sstatefile, ver_code, package_info, files,
> > > > >
> > > > > license_info):
> > > > >
> > > > > > - import json
> > > > > > - import codecs
> > > > > > - spdx_doc = {}
> > > > > > - spdx_doc['PackageVerificationCode'] = ver_code
> > > > > > - spdx_doc['Files'] = {}
> > > > > > - spdx_doc['Files'] = files
> > > > > > - spdx_doc['Package'] = {}
> > > > > > - spdx_doc['Package'] = package_info
> > > > > > - spdx_doc['Licenses'] = {}
> > > > > > - spdx_doc['Licenses'] = license_info
> > > > > > - with codecs.open(sstatefile, mode='w', encoding='utf-8') as f:
> > > > > > - f.write(json.dumps(spdx_doc))
> > > > > > -
> > > > > > -def setup_foss_scan(info, cache, cached_files):
> > > > > > - import errno, shutil
> > > > > > - import tarfile
> > > > > > - file_info = {}
> > > > > > - cache_dict = {}
> > > > > > -
> > > > > > - for f_dir, f in list_files(info['sourcedir']):
> > > > > > - full_path = os.path.join(f_dir, f)
> > > > > > - abs_path = os.path.join(info['sourcedir'], full_path)
> > > > > > - dest_dir = os.path.join(info['spdx_temp_dir'], f_dir)
> > > > > > - dest_path = os.path.join(info['spdx_temp_dir'], full_path)
> > > > > > -
> > > > > > - checksum = hash_file(abs_path)
> > > > > > - if not checksum is None:
> > > > > > - file_info[checksum] = {}
> > > > > > - ## retain cache information if it exists
> > > > > > - if cache and checksum in cached_files:
> > > > > > - file_info[checksum] = cached_files[checksum]
> > > > > > - ## have the file included in what's sent to the
> > > > >
> > > > > FOSSology server
> > > > >
> > > > > > - else:
> > > > > > - file_info[checksum]['FileName'] = full_path
> > > > > > - try:
> > > > > > - bb.utils.mkdirhier(dest_dir)
> > > > > > - shutil.copyfile(abs_path, dest_path)
> > > > > > - except OSError as e:
> > > > > > - bb.warn("SPDX: mkdirhier failed: " + str(e))
> > > > > > - except shutil.Error as e:
> > > > > > - bb.warn("SPDX: copyfile failed: " + str(e))
> > > > > > - except IOError as e:
> > > > > > - bb.warn("SPDX: copyfile failed: " + str(e))
> > > > > > - else:
> > > > > > - bb.warn("SPDX: Could not get checksum for file: " + f)
> > > > > > +addtask get_spdx_s after do_patch before do_configure addtask
> > > > > > +spdx after do_get_spdx_s before do_configure
> > > > > > +
> > > > > > +def create_manifest(info,sstatefile):
> > > > > > + import shutil
> > > > > > + shutil.copyfile(sstatefile,info['outfile'])
> > > > > > +
> > > > > > +def get_cached_spdx( sstatefile ):
> > > > > > + import subprocess
> > > > > > +
> > > > > > + if not os.path.exists( sstatefile ):
> > > > > > + return None
> > > > > >
> > > > > >
> > > > > >
> > > > > > - with tarfile.open(info['tar_file'], "w:gz") as tar:
> > > > > > - tar.add(info['spdx_temp_dir'],
> > > > >
> > > > > arcname=os.path.basename(info['spdx_temp_dir']))
> > > > >
> > > > > > + try:
> > > > > > + output = subprocess.check_output(['grep',
> > > > >
> > > > > "PackageVerificationCode", sstatefile])
> > > > >
> > > > > > + except subprocess.CalledProcessError as e:
> > > > > > + bb.error("Index creation command '%s' failed with return
> > > > >
> > > > > code %d:\n%s" % (e.cmd, e.returncode, e.output))
> > > > >
> > > > > > + return None
> > > > > > + cached_spdx_info=output.decode('utf-8').split(': ')
> > > > > > + return cached_spdx_info[1]
> > > > > > +
> > > > > > +## Add necessary information into spdx file def
> > > > > > +write_cached_spdx( info,sstatefile, ver_code ):
> > > > > > + import subprocess
> > > > > > +
> > > > > > + def sed_replace(dest_sed_cmd,key_word,replace_info):
> > > > > > + dest_sed_cmd = dest_sed_cmd + "-e 's#^" + key_word + ".*#"
> > > > > > + +
> > > > >
> > > > > \
> > > > >
> > > > > > + key_word + replace_info + "#' "
> > > > > > + return dest_sed_cmd
> > > > > > +
> > > > > > + def sed_insert(dest_sed_cmd,key_word,new_line):
> > > > > > + dest_sed_cmd = dest_sed_cmd + "-e '/^" + key_word \
> > > > > > + + r"/a\\" + new_line + "' "
> > > > > > + return dest_sed_cmd
> > > > > > +
> > > > > > + ## Document level information
> > > > > > + sed_cmd = r"sed -i -e 's#\r$##g' "
> > > > > > + spdx_DocumentComment = "<text>SPDX for " + info['pn'] + "
> > > > >
> > > > > version " \
> > > > >
> > > > > > + + info['pv'] + "</text>"
> > > > > > + sed_cmd =
> > > > > > + sed_replace(sed_cmd,"DocumentComment",spdx_DocumentComment)
> > > > > >
> > > > > >
> > > > > >
> > > > > > - return file_info
> > > > > > + ## Creator information
> > > > > > + sed_cmd = sed_insert(sed_cmd,"CreatorComment:
> > > > > > + ","LicenseListVersion: " + info['license_list_version'])
> > > > > > +
> > > > > > + ## Package level information
> > > > > > + sed_cmd = sed_replace(sed_cmd,"PackageName: ",info['pn'])
> > > > > > + sed_cmd = sed_replace(sed_cmd,"PackageVersion: ",info['pv'])
> > > > > > + sed_cmd = sed_replace(sed_cmd,"PackageDownloadLocation:
> > > > >
> > > > > ",info['package_download_location'])
> > > > >
> > > > > > + sed_cmd = sed_insert(sed_cmd,"PackageChecksum:
> > > > >
> > > > > ","PackageHomePage: " + info['package_homepage'])
> > > > >
> > > > > > + sed_cmd = sed_replace(sed_cmd,"PackageSummary: ","<text>" +
> > > > >
> > > > > info['package_summary'] + "</text>")
> > > > >
> > > > > > + sed_cmd = sed_replace(sed_cmd,"PackageVerificationCode:
> > > > >
> > > > > ",ver_code)
> > > > >
> > > > > > + sed_cmd = sed_replace(sed_cmd,"PackageDescription: ",
> > > > > > + "<text>" + info['pn'] + " version " + info['pv'] +
> > > >
> > > > "</text>")
> > > >
> > > > > > + sed_cmd = sed_cmd + sstatefile
> > > > > > +
> > > > > > + subprocess.call("%s" % sed_cmd, shell=True)
> > > > > > +
> > > > > > +def remove_dir_tree( dir_name ):
> > > > > > + import shutil
> > > > > > + try:
> > > > > > + shutil.rmtree( dir_name )
> > > > > > + except:
> > > > > > + pass
> > > > > >
> > > > > >
> > > > > >
> > > > > > -def remove_file(file_name):
> > > > > > +def remove_file( file_name ):
> > > > > >
> > > > > > try:
> > > > > >
> > > > > > - os.remove(file_name)
> > > > > > + os.remove( file_name )
> > > > > >
> > > > > > except OSError as e:
> > > > > >
> > > > > > pass
> > > > > >
> > > > > >
> > > > > >
> > > > > > -def list_files(dir):
> > > > > > - for root, subFolders, files in os.walk(dir):
> > > > > > +def list_files( dir ):
> > > > > > + for root, subFolders, files in os.walk( dir ):
> > > > > >
> > > > > > for f in files:
> > > > > >
> > > > > > - rel_root = os.path.relpath(root, dir)
> > > > > > + rel_root = os.path.relpath( root, dir )
> > > > > >
> > > > > > yield rel_root, f
> > > > > >
> > > > > > return
> > > > > >
> > > > > >
> > > > > >
> > > > > > -def hash_file(file_name):
> > > > > > +def hash_file( file_name ):
> > > > > > + """
> > > > > > + Return the hex string representation of the SHA1 checksum of
> > > > > > +the
> > > > >
> > > > > filename
> > > > >
> > > > > > + """
> > > > > >
> > > > > > try:
> > > > > >
> > > > > > - with open(file_name, 'rb') as f:
> > > > > > - data_string = f.read()
> > > > > > - sha1 = hash_string(data_string)
> > > > > > - return sha1
> > > > > > - except:
> > > > > > + import hashlib
> > > > > > + except ImportError:
> > > > > >
> > > > > > return None
> > > > > >
> > > > > > +
> > > > > > + sha1 = hashlib.sha1()
> > > > > > + with open( file_name, "rb" ) as f:
> > > > > > + for line in f:
> > > > > > + sha1.update(line)
> > > > > > + return sha1.hexdigest()
> > > > > >
> > > > > >
> > > > > >
> > > > > > -def hash_string(data):
> > > > > > +def hash_string( data ):
> > > > > >
> > > > > > import hashlib
> > > > > > sha1 = hashlib.sha1()
> > > > > >
> > > > > > - sha1.update(data)
> > > > > > + sha1.update( data.encode('utf-8') )
> > > > > >
> > > > > > return sha1.hexdigest()
> > > > > >
> > > > > >
> > > > > >
> > > > > > -def run_fossology(foss_command, full_spdx):
> > > > > > +def run_dosocs2( dosocs2_command, spdx_file ):
> > > > > > + import subprocess, codecs
> > > > > >
> > > > > > import string, re
> > > > > >
> > > > > > - import subprocess
> > > > > > -
> > > > > > - p = subprocess.Popen(foss_command.split(),
> > > > > > +
> > > > > > + p = subprocess.Popen(dosocs2_command.split(),
> > > > > >
> > > > > > stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> > > > > >
> > > > > > - foss_output, foss_error = p.communicate()
> > > > > > + dosocs2_output, dosocs2_error = p.communicate()
> > > > > >
> > > > > > if p.returncode != 0:
> > > > > >
> > > > > > return None
> > > > > >
> > > > > >
> > > > > >
> > > > > > - foss_output = unicode(foss_output, "utf-8")
> > > > > > - foss_output = string.replace(foss_output, '\r', '')
> > > > > > -
> > > > > > - # Package info
> > > > > > - package_info = {}
> > > > > > - if full_spdx:
> > > > > > - # All mandatory, only one occurrence
> > > > > > - package_info['PackageCopyrightText'] =
> > > > >
> > > > > re.findall('PackageCopyrightText: (.*?</text>)', foss_output,
> > > > > re.S)[0]
> > > > >
> > > > > > - package_info['PackageLicenseDeclared'] =
> > > > >
> > > > > re.findall('PackageLicenseDeclared: (.*)', foss_output)[0]
> > > > >
> > > > > > - package_info['PackageLicenseConcluded'] =
> > > > >
> > > > > re.findall('PackageLicenseConcluded: (.*)', foss_output)[0]
> > > > >
> > > > > > - # These may be more than one
> > > > > > - package_info['PackageLicenseInfoFromFiles'] =
> > > > >
> > > > > re.findall('PackageLicenseInfoFromFiles: (.*)', foss_output)
> > > > >
> > > > > > - else:
> > > > > > - DEFAULT = "NOASSERTION"
> > > > > > - package_info['PackageCopyrightText'] = "<text>" + DEFAULT
> > > >
> > > > +
> > > >
> > > > > "</text>"
> > > > >
> > > > > > - package_info['PackageLicenseDeclared'] = DEFAULT
> > > > > > - package_info['PackageLicenseConcluded'] = DEFAULT
> > > > > > - package_info['PackageLicenseInfoFromFiles'] = []
> > > > > > -
> > > > > > - # File info
> > > > > > - file_info = {}
> > > > > > - records = []
> > > > > > - # FileName is also in PackageFileName, so we match on FileType
> > > > >
> > > > > as well.
> > > > >
> > > > > > - records = re.findall('FileName:.*?FileType:.*?</text>',
> > > > >
> > > > > foss_output, re.S)
> > > > >
> > > > > > - for rec in records:
> > > > > > - chksum = re.findall('FileChecksum: SHA1: (.*)\n', rec)[0]
> > > > > > - file_info[chksum] = {}
> > > > > > - file_info[chksum]['FileCopyrightText'] =
> > > > >
> > > > > re.findall('FileCopyrightText: '
> > > > >
> > > > > > - + '(.*?</text>)', rec, re.S )[0]
> > > > > > - fields = ['FileName', 'FileType', 'LicenseConcluded',
> > > > >
> > > > > 'LicenseInfoInFile']
> > > > >
> > > > > > - for field in fields:
> > > > > > - file_info[chksum][field] = re.findall(field + ':
> > > > > > (.*)',
> > > > >
> > > > > rec)[0]
> > > > >
> > > > > > -
> > > > > > - # Licenses
> > > > > > - license_info = {}
> > > > > > - licenses = []
> > > > > > - licenses = re.findall('LicenseID:.*?LicenseName:.*?\n',
> > > > >
> > > > > foss_output, re.S)
> > > > >
> > > > > > - for lic in licenses:
> > > > > > - license_id = re.findall('LicenseID: (.*)\n', lic)[0]
> > > > > > - license_info[license_id] = {}
> > > > > > - license_info[license_id]['ExtractedText'] =
> > > > >
> > > > > re.findall('ExtractedText: (.*?</text>)', lic, re.S)[0]
> > > > >
> > > > > > - license_info[license_id]['LicenseName'] =
> > > > >
> > > > > re.findall('LicenseName: (.*)', lic)[0]
> > > > >
> > > > > > -
> > > > > > - return (package_info, file_info, license_info)
> > > > > > -
> > > > > > -def create_spdx_doc(file_info, scanned_files):
> > > > > > - import json
> > > > > > - ## push foss changes back into cache
> > > > > > - for chksum, lic_info in scanned_files.iteritems():
> > > > > > - if chksum in file_info:
> > > > > > - file_info[chksum]['FileType'] = lic_info['FileType']
> > > > > > - file_info[chksum]['FileChecksum: SHA1'] = chksum
> > > > > > - file_info[chksum]['LicenseInfoInFile'] =
> > > > >
> > > > > lic_info['LicenseInfoInFile']
> > > > >
> > > > > > - file_info[chksum]['LicenseConcluded'] =
> > > > >
> > > > > lic_info['LicenseConcluded']
> > > > >
> > > > > > - file_info[chksum]['FileCopyrightText'] =
> > > > >
> > > > > lic_info['FileCopyrightText']
> > > > >
> > > > > > - else:
> > > > > > - bb.warn("SPDX: " + lic_info['FileName'] + " : " +
> > > >
> > > > chksum
> > > >
> > > > > > - + " : is not in the local file info: "
> > > > > > - + json.dumps(lic_info, indent=1))
> > > > > > - return file_info
> > > > > > + dosocs2_output = dosocs2_output.decode('utf-8')
> > > > > > +
> > > > > > + f = codecs.open(spdx_file,'w','utf-8')
> > > > > > + f.write(dosocs2_output)
> > > > > >
> > > > > >
> > > > > >
> > > > > > -def get_ver_code(dirname):
> > > > > > +def get_ver_code( dirname ):
> > > > > >
> > > > > > chksums = []
> > > > > >
> > > > > > - for f_dir, f in list_files(dirname):
> > > > > > - hash = hash_file(os.path.join(dirname, f_dir, f))
> > > > > > - if not hash is None:
> > > > > > - chksums.append(hash)
> > > > > > - else:
> > > > > > - bb.warn("SPDX: Could not hash file: " + path)
> > > > > > - ver_code_string = ''.join(chksums).lower()
> > > > > > - ver_code = hash_string(ver_code_string)
> > > > > > + for f_dir, f in list_files( dirname ):
> > > > > > + try:
> > > > > > + stats = os.stat(os.path.join(dirname,f_dir,f))
> > > > > > + except OSError as e:
> > > > > > + bb.warn( "Stat failed" + str(e) + "\n")
> > > > > > + continue
> > > > > > + chksums.append(hash_file(os.path.join(dirname,f_dir,f)))
> > > > > > + ver_code_string = ''.join( chksums ).lower()
> > > > > > + ver_code = hash_string( ver_code_string )
> > > > > >
> > > > > > return ver_code
> > > > > >
> > > > > >
> > > > > >
> > > > > > -def get_header_info(info, spdx_verification_code, package_info):
> > > > > > - """
> > > > > > - Put together the header SPDX information.
> > > > > > - Eventually this needs to become a lot less
> > > > > > - of a hardcoded thing.
> > > > > > - """
> > > > > > - from datetime import datetime
> > > > > > - import os
> > > > > > - head = []
> > > > > > - DEFAULT = "NOASSERTION"
> > > > > > -
> > > > > > - package_checksum = hash_file(info['tar_file'])
> > > > > > - if package_checksum is None:
> > > > > > - package_checksum = DEFAULT
> > > > > > -
> > > > > > - ## document level information
> > > > > > - head.append("## SPDX Document Information")
> > > > > > - head.append("SPDXVersion: " + info['spdx_version'])
> > > > > > - head.append("DataLicense: " + info['data_license'])
> > > > > > - head.append("DocumentComment: <text>SPDX for "
> > > > > > - + info['pn'] + " version " + info['pv'] + "</text>")
> > > > > > - head.append("")
> > > > > > -
> > > > > > - ## Creator information
> > > > > > - ## Note that this does not give time in UTC.
> > > > > > - now = datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
> > > > > > - head.append("## Creation Information")
> > > > > > - ## Tools are supposed to have a version, but FOSSology+SPDX
> > > > >
> > > > > provides none.
> > > > >
> > > > > > - head.append("Creator: Tool: FOSSology+SPDX")
> > > > > > - head.append("Created: " + now)
> > > > > > - head.append("CreatorComment: <text>UNO</text>")
> > > > > > - head.append("")
> > > > > > -
> > > > > > - ## package level information
> > > > > > - head.append("## Package Information")
> > > > > > - head.append("PackageName: " + info['pn'])
> > > > > > - head.append("PackageVersion: " + info['pv'])
> > > > > > - head.append("PackageFileName: " +
> > > > >
> > > > > os.path.basename(info['tar_file']))
> > > > >
> > > > > > - head.append("PackageSupplier: Person:" + DEFAULT)
> > > > > > - head.append("PackageDownloadLocation: " + DEFAULT)
> > > > > > - head.append("PackageSummary: <text></text>")
> > > > > > - head.append("PackageOriginator: Person:" + DEFAULT)
> > > > > > - head.append("PackageChecksum: SHA1: " + package_checksum)
> > > > > > - head.append("PackageVerificationCode: " +
> > > >
> > > > spdx_verification_code)
> > > >
> > > > > > - head.append("PackageDescription: <text>" + info['pn']
> > > > > > - + " version " + info['pv'] + "</text>")
> > > > > > - head.append("")
> > > > > > - head.append("PackageCopyrightText: "
> > > > > > - + package_info['PackageCopyrightText'])
> > > > > > - head.append("")
> > > > > > - head.append("PackageLicenseDeclared: "
> > > > > > - + package_info['PackageLicenseDeclared'])
> > > > > > - head.append("PackageLicenseConcluded: "
> > > > > > - + package_info['PackageLicenseConcluded'])
> > > > > > -
> > > > > > - for licref in package_info['PackageLicenseInfoFromFiles']:
> > > > > > - head.append("PackageLicenseInfoFromFiles: " + licref)
> > > > > > - head.append("")
> > > > > > -
> > > > > > - ## header for file level
> > > > > > - head.append("## File Information")
> > > > > > - head.append("")
> > > > > > -
> > > > > > - return '\n'.join(head)
> > > > > > diff --git a/meta/conf/licenses.conf b/meta/conf/licenses.conf
> > > >
> > > > index
> > > >
> > > > > > 9917c40..5963e2f 100644
> > > > > > --- a/meta/conf/licenses.conf
> > > > > > +++ b/meta/conf/licenses.conf
> > > > > > @@ -122,68 +122,5 @@ SPDXLICENSEMAP[SGIv1] = "SGI-1"
> > > > > >
> > > > > > #COPY_LIC_DIRS = "1"
> > > > > >
> > > > > >
> > > > > >
> > > > > > ## SPDX temporary directory
> > > > > >
> > > > > > -SPDX_TEMP_DIR = "${WORKDIR}/spdx_temp"
> > > > > > -SPDX_MANIFEST_DIR = "/home/yocto/fossology_scans"
> > > > > > -
> > > > > > -## SPDX Format info
> > > > > > -SPDX_VERSION = "SPDX-1.1"
> > > > > > -DATA_LICENSE = "CC0-1.0"
> > > > > > -
> > > > > > -## Fossology scan information
> > > > > > -# You can set option to control if the copyright information will
> > > > > > be skipped -# during the identification process.
> > > > > > -#
> > > > > > -# It is defined as [FOSS_COPYRIGHT] in ./meta/conf/licenses.conf.
> > > > > > -# FOSS_COPYRIGHT = "true"
> > > > > > -# NO copyright will be processed. That means only license
> > > > >
> > > > > information will be
> > > > >
> > > > > > -# identified and output to SPDX file
> > > > > > -# FOSS_COPYRIGHT = "false"
> > > > > > -# Copyright will be identified and output to SPDX file along
> > > >
> > > > with
> > > >
> > > > > license
> > > > >
> > > > > > -# information. The process will take more time than not
> > > >
> > > > processing
> > > >
> > > > > copyright
> > > > >
> > > > > > -# information.
> > > > > > -#
> > > > > > -
> > > > > > -FOSS_NO_COPYRIGHT = "true"
> > > > > > -
> > > > > > -# A option defined as[FOSS_RECURSIVE_UNPACK] in
> > > > > > ./meta/conf/licenses.conf. is -# used to control if FOSSology
> > > >
> > > > server
> > > >
> > > > > > need recursively unpack tar.gz file which -# is sent from do_spdx
> > > > >
> > > > > task.
> > > > >
> > > > > > -#
> > > > > > -# FOSS_RECURSIVE_UNPACK = "false":
> > > > > > -# FOSSology server does NOT recursively unpack. In the current
> > > > >
> > > > > release, this
> > > > >
> > > > > > -# is the default choice because recursively unpack will not
> > > > >
> > > > > necessarily break
> > > > >
> > > > > > -# down original compressed files.
> > > > > > -# FOSS_RECURSIVE_UNPACK = "true":
> > > > > > -# FOSSology server recursively unpack components.
> > > > > > -#
> > > > > > -
> > > > > > -FOSS_RECURSIVE_UNPACK = "false"
> > > > > > -
> > > > > > -# An option defined as [FOSS_FULL_SPDX] in
> > > > > > ./meta/conf/licenses.conf is used to -# control what kind of SPDX
> > > > > > output to get from the
> > > > >
> > > > > FOSSology server.
> > > > >
> > > > > > -#
> > > > > > -# FOSS_FULL_SPDX = "true":
> > > > > > -# Tell FOSSology server to return full SPDX output, like if the
> > > > >
> > > > > program was
> > > > >
> > > > > > -# run from the command line. This is needed in order to get
> > > > >
> > > > > license refs for
> > > > >
> > > > > > -# the full package rather than individual files only.
> > > > > > -#
> > > > > > -# FOSS_FULL_SPDX = "false":
> > > > > > -# Tell FOSSology to only process license information for files.
> > > > >
> > > > > All package
> > > > >
> > > > > > -# license tags in the report will be "NOASSERTION"
> > > > > > -#
> > > > > > -
> > > > > > -FOSS_FULL_SPDX = "true"
> > > > > > -
> > > > > > -# FOSSologySPDX instance server. http://localhost/repo is the
> > > > >
> > > > > default
> > > > >
> > > > > > -# installation location for FOSSology.
> > > > > > -#
> > > > > > -# For more information on FOSSologySPDX commandline:
> > > > > > -# https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-
> > > > >
> > > > > SPDX-Web-API
> > > > >
> > > > > > -#
> > > > > > -
> > > > > > -FOSS_BASE_URL = "http://localhost/repo/?mod=spdx_license_once"
> > > > > > -FOSS_SERVER =
> > > > >
> > > > >
> > > >
> > > > "${FOSS_BASE_URL}&fullSPDXFlag=${FOSS_FULL_SPDX}&noCopyright=${FOSS_NO
> > > >
> > > > > _ COPYRIGHT}&recursiveUnpack=${FOSS_RECURSIVE_UNPACK}"
> > > > >
> > > > > > -
> > > > > > -FOSS_WGET_FLAGS = "-qO - --no-check-certificate --timeout=0"
> > > > > > -
> > > > > > -
> > > > > > +SPDX_TEMP_DIR ?= "${WORKDIR}/spdx_temp"
> > > > > > +SPDX_MANIFEST_DIR ?= "/home/yocto/spdx_scans"
> > > > >
> > > > >
> > > > >
> > > > > Best Regards,
> > > > > Maxin
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > _______________________________________________
> > > > Openembedded-core mailing list
> > > > Openembedded-core@lists.openembedded.org
> > > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > >
> > >
> > >
> > > --
> > > _______________________________________________
> > > Openembedded-core mailing list
> > > Openembedded-core@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
> --
> --
> Jan-Simon Möller
> dl9pf@gmx.de
>
^ permalink raw reply
* uninative binary?
From: Gary Thomas @ 2016-11-04 7:16 UTC (permalink / raw)
To: OE-core
Some of my customers need to be able to build without any
network connectivity, so I normally use BB_NO_NETWORK="1"
Is there a way to add the uninative "binary shim" to my
download mirror? Given that the path includes a hash as
a directory, it's not clear to me how to put it into my
mirror.
Thanks for any ideas
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
^ permalink raw reply
* [PATCH 1/1] tcf-agent: fix systemd service file
From: Chen Qi @ 2016-11-04 6:44 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1478241842.git.Qi.Chen@windriver.com>
Fix tcf-agent service file so that `systemctl stop tcf-agent' doesn't
fail.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
index fd9a6c4..dd3a79b 100644
--- a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
@@ -3,8 +3,7 @@ Description=Target Communication Framework agent
After=network.target
[Service]
-Type=forking
-ExecStart=@SBINDIR@/tcf-agent -d -L- -l0
+ExecStart=@SBINDIR@/tcf-agent -L- -l0
[Install]
WantedBy=multi-user.target
--
1.9.1
^ permalink raw reply related
* [PATCH 0/1] tcf-agent: fix systemd service file
From: Chen Qi @ 2016-11-04 6:44 UTC (permalink / raw)
To: openembedded-core
The following changes since commit 98c6ebf1e05158c689e01b785d32757847cdb10c:
oeqa/selftest/kernel.py: Add new file destined for kernel related tests (2016-11-01 10:05:40 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib ChenQi/tcf-agent
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/tcf-agent
Chen Qi (1):
tcf-agent: fix systemd service file
meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--
1.9.1
^ permalink raw reply
* [master][morty][PATCH v2] bitbake.conf: skip file-rdeps check for license packages
From: Jagadeesh Krishnanjanappa @ 2016-11-04 6:11 UTC (permalink / raw)
To: openembedded-core
The license files containing hashbash, print out below
warning messages; if the explicit RDEPENDS is not
specified on bash package. Adding "file-rdeps" to INSANE_SKIP
in global config file, silence these warnings occuring in
other recipes. Moreover the RDEPENDS package will be automatically
pulled in during creation of rootfs image, even explicit RDEPENDS
is missing.
-- snip --
WARNING: hdparm-9.48-r0 do_package_qa: QA Issue: /usr/share/licenses/hdparm/wiper.sh contained in package hdparm-lic requires /bin/bash, but no providers found in RDEPENDS_hdparm-lic? [file-rdeps]
WARNING: ltp-20160126-r0 do_package_qa: QA Issue: /opt/ltp/share/licenses/ltp/run_freezer.sh contained in package ltp-lic requires /bin/bash, but no providers found in RDEPENDS_ltp-lic? [file-rdeps]
-- snip --
Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
---
meta/conf/bitbake.conf | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 54a587f..5ccaafa 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -830,3 +830,7 @@ BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
MLPREFIX ??= ""
MULTILIB_VARIANTS ??= ""
+
+# Add file-rdeps to INSANE_SKIP, to solve QA WARNING as some of the
+# license files contain hashbang.
+INSANE_SKIP_${PN}-lic = "file-rdeps"
--
2.7.4
^ permalink raw reply related
* [PATCH 2/2] tzdata: update to 2016i
From: Armin Kuster @ 2016-11-04 5:53 UTC (permalink / raw)
To: akuster808, openembedded-core
In-Reply-To: <1478238808-28688-1-git-send-email-akuster808@gmail.com>
Briefly: Cyprus split into two time zones on 2016-10-30, and Tonga
reintroduces DST on 2016-11-06.
Changes to future time stamps
Pacific/Tongatapu begins DST on 2016-11-06 at 02:00, ending on
2017-01-15 at 03:00. Assume future observances in Tonga will be
from the first Sunday in November through the third Sunday in
January, like Fiji. (Thanks to Pulu ʻAnau.) Switch to numeric
time zone abbreviations for this zone.
Changes to past and future time stamps
Northern Cyprus is now +03 year round, causing a split in Cyprus
time zones starting 2016-10-30 at 04:00. This creates a zone
Asia/Famagusta. (Thanks to Even Scharning and Matt Johnson.)
Antarctica/Casey switched from +08 to +11 on 2016-10-22.
(Thanks to Steffen Thorsen.)
Changes to past time stamps
Several corrections were made for pre-1975 time stamps in Italy.
These affect Europe/Malta, Europe/Rome, Europe/San_Marino, and
Europe/Vatican.
First, the 1893-11-01 00:00 transition in Italy used the new UT
offset (+01), not the old (+00:49:56). (Thanks to Michael
Deckers.)
Second, rules for daylight saving in Italy were changed to agree
with Italy's National Institute of Metrological Research (INRiM)
except for 1944, as follows (thanks to Pierpaolo Bernardi, Brian
Inglis, and Michael Deckers):
The 1916-06-03 transition was at 24:00, not 00:00.
The 1916-10-01, 1919-10-05, and 1920-09-19 transitions were at
00:00, not 01:00.
The 1917-09-30 and 1918-10-06 transitions were at 24:00, not
01:00.
The 1944-09-17 transition was at 03:00, not 01:00. This
particular change is taken from Italian law as INRiM's table,
(which says 02:00) appears to have a typo here. Also, keep the
1944-04-03 transition for Europe/Rome, as Rome was controlled by
Germany then.
The 1967-1970 and 1972-1974 fallback transitions were at 01:00,
not 00:00.
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
meta/recipes-extended/tzdata/{tzdata_2016h.bb => tzdata_2016i.bb} | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename meta/recipes-extended/tzdata/{tzdata_2016h.bb => tzdata_2016i.bb} (98%)
diff --git a/meta/recipes-extended/tzdata/tzdata_2016h.bb b/meta/recipes-extended/tzdata/tzdata_2016i.bb
similarity index 98%
rename from meta/recipes-extended/tzdata/tzdata_2016h.bb
rename to meta/recipes-extended/tzdata/tzdata_2016i.bb
index 00b0f5f..3801a3f 100644
--- a/meta/recipes-extended/tzdata/tzdata_2016h.bb
+++ b/meta/recipes-extended/tzdata/tzdata_2016i.bb
@@ -9,8 +9,8 @@ DEPENDS = "tzcode-native"
SRC_URI = "http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
-SRC_URI[tzdata.md5sum] = "878f0ec3fd9e4026ea11dd1b649a315a"
-SRC_URI[tzdata.sha256sum] = "da1b74fc2dec2ce8b64948dafb0bfc2f923c830d421a7ae4d016226135697a64"
+SRC_URI[tzdata.md5sum] = "73912ecfa6a9a8048ddf2e719d9bc39d"
+SRC_URI[tzdata.sha256sum] = "b6966ec982ef64fe48cebec437096b4f57f4287519ed32dde59c86d3a1853845"
inherit allarch
--
2.7.4
^ permalink raw reply related
* [PATCH 1/2] tzcode: update to 2016i
From: Armin Kuster @ 2016-11-04 5:53 UTC (permalink / raw)
To: akuster808, openembedded-core
In-Reply-To: <1478238808-28688-1-git-send-email-akuster808@gmail.com>
Changes to code
The code should now be buildable on AmigaOS merely by setting the
appropriate Makefile variables. (From a patch by Carsten Larsen.)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
.../tzcode/{tzcode-native_2016h.bb => tzcode-native_2016i.bb} | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
rename meta/recipes-extended/tzcode/{tzcode-native_2016h.bb => tzcode-native_2016i.bb} (69%)
diff --git a/meta/recipes-extended/tzcode/tzcode-native_2016h.bb b/meta/recipes-extended/tzcode/tzcode-native_2016i.bb
similarity index 69%
rename from meta/recipes-extended/tzcode/tzcode-native_2016h.bb
rename to meta/recipes-extended/tzcode/tzcode-native_2016i.bb
index de7d88d..9d3d5a1 100644
--- a/meta/recipes-extended/tzcode/tzcode-native_2016h.bb
+++ b/meta/recipes-extended/tzcode/tzcode-native_2016i.bb
@@ -9,10 +9,10 @@ SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz
http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
-SRC_URI[tzcode.md5sum] = "00c20689d996dea4cf5b45504724ce8f"
-SRC_URI[tzcode.sha256sum] = "30e62f0b86a78fb020d378b950930da023ca31b1a58f08d8fb2066627c4d6566"
-SRC_URI[tzdata.md5sum] = "878f0ec3fd9e4026ea11dd1b649a315a"
-SRC_URI[tzdata.sha256sum] = "da1b74fc2dec2ce8b64948dafb0bfc2f923c830d421a7ae4d016226135697a64"
+SRC_URI[tzcode.md5sum] = "8fae14cba9396462955b7859cf04ba48"
+SRC_URI[tzcode.sha256sum] = "411e8adcb6288b17d6c2624fde65e7d82654ca69b813ae121504ff66f0cfba7b"
+SRC_URI[tzdata.md5sum] = "73912ecfa6a9a8048ddf2e719d9bc39d"
+SRC_URI[tzdata.sha256sum] = "b6966ec982ef64fe48cebec437096b4f57f4287519ed32dde59c86d3a1853845"
S = "${WORKDIR}"
--
2.7.4
^ permalink raw reply related
* [PATCH 0/2] Time zone update to 2016i
From: Armin Kuster @ 2016-11-04 5:53 UTC (permalink / raw)
To: akuster808, openembedded-core
These applied on top of 2016h I sent on 10-23
Armin Kuster (2):
tzcode: update to 2016i
tzdata: update to 2016i
.../tzcode/{tzcode-native_2016h.bb => tzcode-native_2016i.bb} | 8 ++++----
meta/recipes-extended/tzdata/{tzdata_2016h.bb => tzdata_2016i.bb} | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
rename meta/recipes-extended/tzcode/{tzcode-native_2016h.bb => tzcode-native_2016i.bb} (69%)
rename meta/recipes-extended/tzdata/{tzdata_2016h.bb => tzdata_2016i.bb} (98%)
--
2.7.4
^ permalink raw reply
* Re: [master][morty][PATCH 1/2] ltp: Fix QA warning
From: Jagadeesh Krishnanjanappa @ 2016-11-04 5:46 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
In-Reply-To: <CAJTo0LbvVLrkAJuF3uEMm-_DPmJQLsX2=rT0a4hvKUi9k79MYQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 730 bytes --]
>
>
> On 3 November 2016 at 18:04, Jagadeesh Krishnanjanappa <
> jkrishnanjanappa@mvista.com> wrote:
>
>> WARNING: ltp-20160126-r0 do_package_qa: QA Issue:
>> /opt/ltp/share/licenses/ltp/run_freezer.sh contained in package ltp-lic
>> requires /bin/bash, but no providers found in RDEPENDS_ltp-lic? [file-rdeps]
>>
>
> So the common problem "if PN-lic contains a license statement embedded in
> a file with a hashbang, file-rdeps is triggered", so I'd say file-rdeps
> should be added to INSANE_SKIP_${PN}-lic in bitbake.conf instead of dealing
> with this per recipe.
>
> Thanks for the review. I will send v2 adding INSANE_SKIP_${PN}-lic =
"file-rdeps" in bitbake.conf file.
Regards,
Jagadeesh
Ross
>
[-- Attachment #2: Type: text/html, Size: 2015 bytes --]
^ permalink raw reply
* Re: [PATCH] mkefidisk.sh: add deprecation warning to the output
From: Christopher Larson @ 2016-11-04 2:23 UTC (permalink / raw)
To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <CD1ACFFA-619F-4C36-99AC-76D6A6068E74@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]
On Thu, Nov 3, 2016 at 2:42 PM, Khem Raj <raj.khem@gmail.com> wrote:
> > On Oct 31, 2016, at 3:46 AM, Ed Bartosh <ed.bartosh@linux.intel.com>
> wrote:
> >
> > mkefidisk.sh will soon be deprecated in favor of .wic images.
> >
> > Added deprecation warning to the script to inform users that
> > this script will soon be removed from the codebase.
> >
> > Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
> > ---
> > scripts/contrib/mkefidisk.sh | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
> > index d8db3c0..a175895 100755
> > --- a/scripts/contrib/mkefidisk.sh
> > +++ b/scripts/contrib/mkefidisk.sh
> > @@ -20,6 +20,11 @@
> >
> > LANG=C
> >
> > +echo
> > +echo "WARNING: This script is deprecated and will be removed soon."
> > +echo "Please consider using wic EFI images instead."
> > +echo
> > +
>
> is .wic image dd’able directly ?
>
Yes, that’s the point :) Though I prefer bmaptool w/ IMAGE_FSTYPES +=
“wic.bmap” personally, don’t have to rely on the file keeping its
sparseness when scp’ing it around and whatnot.
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 1979 bytes --]
^ permalink raw reply
* [PATCH v2 1/1] initrdscripts: add support for NVME target install
From: Joe Konno @ 2016-11-03 23:46 UTC (permalink / raw)
To: openembedded-core
From: Joe Konno <joe.konno@intel.com>
Add awareness of /dev/nvme* block devices to install scripts. As presently
written, installer knows only of /dev/sd* and /dev/mmcblk* block devices.
Building upon scaffolding put in place by Awais in...
80ec9f627915 ("initrdscripts: handle mmc device as installer medium")
Signed-off-by: Joe Konno <joe.konno@intel.com>
---
meta/recipes-core/initrdscripts/files/init-install-efi.sh | 5 ++++-
meta/recipes-core/initrdscripts/files/init-install.sh | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index 441e25238d24..ffb709c1ce6a 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -22,6 +22,8 @@ live_dev_name=${live_dev_name#\/dev/}
case $live_dev_name in
mmcblk*)
;;
+ nvme*)
+ ;;
*)
live_dev_name=${live_dev_name%%[0-9]*}
;;
@@ -146,7 +148,8 @@ swap_start=$((rootfs_end))
# 2) they are detected asynchronously (need rootwait)
rootwait=""
part_prefix=""
-if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+ [ ! "${device#/dev/nvme}" = "${device}" ]; then
part_prefix="p"
rootwait="rootwait"
fi
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 04ce5fb4b5d5..572613ecd4cd 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -21,6 +21,8 @@ live_dev_name=${live_dev_name#\/dev/}
case $live_dev_name in
mmcblk*)
;;
+ nvme*)
+ ;;
*)
live_dev_name=${live_dev_name%%[0-9]*}
;;
@@ -153,7 +155,8 @@ swap_start=$((rootfs_end))
# 2) they are detected asynchronously (need rootwait)
rootwait=""
part_prefix=""
-if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+ [ ! "${device#/dev/nvme}" = "${device}" ]; then
part_prefix="p"
rootwait="rootwait"
fi
--
2.7.4
^ permalink raw reply related
* [PATCH v1 1/1] initrdscripts: add support for NVME target install
From: Joe Konno @ 2016-11-03 23:17 UTC (permalink / raw)
To: openembedded-core
From: Joe Konno <joe.konno@intel.com>
Add awareness of /dev/nvme* block devices to install scripts. As presently
written, installer knows only of /dev/sd* and /dev/mmcblk* block devices.
Building upon scaffolding put in place by Awais in...
80ec9f627915 ("initrdscripts: handle mmc device as installer medium")
Signed-off-by: Joe Konno <joe.konno@intel.com>
---
meta/recipes-core/initrdscripts/files/init-install.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 04ce5fb4b5d5..572613ecd4cd 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -21,6 +21,8 @@ live_dev_name=${live_dev_name#\/dev/}
case $live_dev_name in
mmcblk*)
;;
+ nvme*)
+ ;;
*)
live_dev_name=${live_dev_name%%[0-9]*}
;;
@@ -153,7 +155,8 @@ swap_start=$((rootfs_end))
# 2) they are detected asynchronously (need rootwait)
rootwait=""
part_prefix=""
-if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+ [ ! "${device#/dev/nvme}" = "${device}" ]; then
part_prefix="p"
rootwait="rootwait"
fi
--
2.7.4
^ permalink raw reply related
* Re: [PATCH] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests
From: Benjamin Esquivel @ 2016-11-03 23:12 UTC (permalink / raw)
To: jose.perez.carranza, openembedded-core; +Cc: paul.eggleton
In-Reply-To: <1478213194-16951-1-git-send-email-jose.perez.carranza@linux.intel.com>
Hello José, a couple of comments below.
On Thu, 2016-11-03 at 17:46 -0500, jose.perez.carranza@linux.intel.com
wrote:
> From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
>
> Currently the unittests for scripts on meta/lib/oe are not being
> executed by any suite hence the best option is migrate them to
> meta/lib/oeqa/selftest to be executed along with the selftest suite.
>
How much more time do these tests add to a selftest execution?
> [YOCTO #7376]
>
> Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.c
> om>
> ---
> meta/lib/oe/tests/__init__.py | 0
> meta/lib/oe/tests/test_elf.py | 21 -------
> meta/lib/oe/tests/test_license.py | 68 -----------------
> -----
> meta/lib/oe/tests/test_path.py | 89 -----------------
> -----------
> meta/lib/oe/tests/test_types.py | 62 -----------------
> ---
> meta/lib/oe/tests/test_utils.py | 51 ----------------
> meta/lib/oeqa/selftest/oe_tests/__init__.py | 0
> meta/lib/oeqa/selftest/oe_tests/elf.py | 22 +++++++
> meta/lib/oeqa/selftest/oe_tests/license.py | 69
> ++++++++++++++++++++++
> meta/lib/oeqa/selftest/oe_tests/path.py | 90
> +++++++++++++++++++++++++++++
> meta/lib/oeqa/selftest/oe_tests/types.py | 61 +++++++++++++++++++
> meta/lib/oeqa/selftest/oe_tests/utils.py | 52 +++++++++++++++++
> 12 files changed, 294 insertions(+), 291 deletions(-)
> delete mode 100644 meta/lib/oe/tests/__init__.py
> delete mode 100644 meta/lib/oe/tests/test_elf.py
> delete mode 100644 meta/lib/oe/tests/test_license.py
> delete mode 100644 meta/lib/oe/tests/test_path.py
> delete mode 100644 meta/lib/oe/tests/test_types.py
> delete mode 100644 meta/lib/oe/tests/test_utils.py
> create mode 100644 meta/lib/oeqa/selftest/oe_tests/__init__.py
selftest has no other dir in it and this dir name of oe_test makes
little sense if you see it in the context of oeqa/selftest/oe_test. I
suggest using a dir name that brings some additional info as to what is
inside of it or try and see how to integrate these tests into the
selftest/ plain structure.
> create mode 100644 meta/lib/oeqa/selftest/oe_tests/elf.py
> create mode 100644 meta/lib/oeqa/selftest/oe_tests/license.py
> create mode 100644 meta/lib/oeqa/selftest/oe_tests/path.py
> create mode 100644 meta/lib/oeqa/selftest/oe_tests/types.py
> create mode 100644 meta/lib/oeqa/selftest/oe_tests/utils.py
>
> diff --git a/meta/lib/oe/tests/__init__.py
> b/meta/lib/oe/tests/__init__.py
> deleted file mode 100644
> index e69de29..0000000
> diff --git a/meta/lib/oe/tests/test_elf.py
> b/meta/lib/oe/tests/test_elf.py
> deleted file mode 100644
> index 1f59037..0000000
> --- a/meta/lib/oe/tests/test_elf.py
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -import unittest
> -import oe.qa
> -
> -class TestElf(unittest.TestCase):
> - def test_machine_name(self):
> - """
> - Test elf_machine_to_string()
> - """
> - self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
> - self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
> - self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
> - self.assertEqual(oe.qa.elf_machine_to_string(0x14),
> "PowerPC")
> - self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
> - self.assertEqual(oe.qa.elf_machine_to_string(0x2A),
> "SuperH")
> - self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
> - self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-
> 64")
> - self.assertEqual(oe.qa.elf_machine_to_string(0xB7),
> "AArch64")
> -
> - self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown
> (0)")
> - self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF),
> "Unknown (3735928559)")
> - self.assertEqual(oe.qa.elf_machine_to_string("foobar"),
> "Unknown ('foobar')")
> diff --git a/meta/lib/oe/tests/test_license.py
> b/meta/lib/oe/tests/test_license.py
> deleted file mode 100644
> index c388886..0000000
> --- a/meta/lib/oe/tests/test_license.py
> +++ /dev/null
> @@ -1,68 +0,0 @@
> -import unittest
> -import oe.license
> -
> -class SeenVisitor(oe.license.LicenseVisitor):
> - def __init__(self):
> - self.seen = []
> - oe.license.LicenseVisitor.__init__(self)
> -
> - def visit_Str(self, node):
> - self.seen.append(node.s)
> -
> -class TestSingleLicense(unittest.TestCase):
> - licenses = [
> - "GPLv2",
> - "LGPL-2.0",
> - "Artistic",
> - "MIT",
> - "GPLv3+",
> - "FOO_BAR",
> - ]
> - invalid_licenses = ["GPL/BSD"]
> -
> - @staticmethod
> - def parse(licensestr):
> - visitor = SeenVisitor()
> - visitor.visit_string(licensestr)
> - return visitor.seen
> -
> - def test_single_licenses(self):
> - for license in self.licenses:
> - licenses = self.parse(license)
> - self.assertListEqual(licenses, [license])
> -
> - def test_invalid_licenses(self):
> - for license in self.invalid_licenses:
> - with self.assertRaises(oe.license.InvalidLicense) as cm:
> - self.parse(license)
> - self.assertEqual(cm.exception.license, license)
> -
> -class TestSimpleCombinations(unittest.TestCase):
> - tests = {
> - "FOO&BAR": ["FOO", "BAR"],
> - "BAZ & MOO": ["BAZ", "MOO"],
> - "ALPHA|BETA": ["ALPHA"],
> - "BAZ&MOO|FOO": ["FOO"],
> - "FOO&BAR|BAZ": ["FOO", "BAR"],
> - }
> - preferred = ["ALPHA", "FOO", "BAR"]
> -
> - def test_tests(self):
> - def choose(a, b):
> - if all(lic in self.preferred for lic in b):
> - return b
> - else:
> - return a
> -
> - for license, expected in self.tests.items():
> - licenses = oe.license.flattened_licenses(license,
> choose)
> - self.assertListEqual(licenses, expected)
> -
> -class TestComplexCombinations(TestSimpleCombinations):
> - tests = {
> - "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
> - "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
> - "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
> - "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-
> 4-clause", "MIT"],
> - }
> - preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
> diff --git a/meta/lib/oe/tests/test_path.py
> b/meta/lib/oe/tests/test_path.py
> deleted file mode 100644
> index 44d0681..0000000
> --- a/meta/lib/oe/tests/test_path.py
> +++ /dev/null
> @@ -1,89 +0,0 @@
> -import unittest
> -import oe, oe.path
> -import tempfile
> -import os
> -import errno
> -import shutil
> -
> -class TestRealPath(unittest.TestCase):
> - DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX",
> "usr/sbin", "usr/include", "usr/include/gdbm" ]
> - FILES = [ "etc/passwd", "b/file" ]
> - LINKS = [
> - ( "bin", "/usr/bin", "/usr/bin" ),
> - ( "binX", "usr/binX", "/usr/binX" ),
> - ( "c", "broken", "/broken" ),
> - ( "etc/passwd-1", "passwd", "/etc/passwd"
> ),
> - ( "etc/passwd-2", "passwd-1", "/etc/passwd"
> ),
> - ( "etc/passwd-3", "/etc/passwd-1", "/etc/passwd"
> ),
> - ( "etc/shadow-1", "/etc/shadow", "/etc/shadow"
> ),
> - ( "etc/shadow-2", "/etc/shadow-1", "/etc/shadow"
> ),
> - ( "prog-A", "bin/prog-A", "/usr/bin/prog-
> A" ),
> - ( "prog-B", "/bin/prog-B", "/usr/bin/prog-
> B" ),
> - ( "usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C"
> ),
> - ( "usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D"
> ),
> - ( "usr/binX/prog-E", "../sbin/prog-E", None ),
> - ( "usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F"
> ),
> - ( "loop", "a/loop", None ),
> - ( "a/loop", "../loop", None ),
> - ( "b/test", "file/foo", "/b/file/foo"
> ),
> - ]
> -
> - LINKS_PHYS = [
> - ( "./", "/", "" ),
> - ( "binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E" ),
> - ]
> -
> - EXCEPTIONS = [
> - ( "loop", errno.ELOOP ),
> - ( "b/test", errno.ENOENT ),
> - ]
> -
> - def __del__(self):
> - try:
> - #os.system("tree -F %s" % self.tmpdir)
> - shutil.rmtree(self.tmpdir)
> - except:
> - pass
> -
> - def setUp(self):
> - self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path")
> - self.root = os.path.join(self.tmpdir, "R")
> -
> - os.mkdir(os.path.join(self.tmpdir, "_real"))
> - os.symlink("_real", self.root)
> -
> - for d in self.DIRS:
> - os.mkdir(os.path.join(self.root, d))
> - for f in self.FILES:
> - open(os.path.join(self.root, f), "w")
> - for l in self.LINKS:
> - os.symlink(l[1], os.path.join(self.root, l[0]))
> -
> - def __realpath(self, file, use_physdir, assume_dir = True):
> - return oe.path.realpath(os.path.join(self.root, file),
> self.root,
> - use_physdir, assume_dir =
> assume_dir)
> -
> - def test_norm(self):
> - for l in self.LINKS:
> - if l[2] == None:
> - continue
> -
> - target_p = self.__realpath(l[0], True)
> - target_l = self.__realpath(l[0], False)
> -
> - if l[2] != False:
> - self.assertEqual(target_p, target_l)
> - self.assertEqual(l[2], target_p[len(self.root):])
> -
> - def test_phys(self):
> - for l in self.LINKS_PHYS:
> - target_p = self.__realpath(l[0], True)
> - target_l = self.__realpath(l[0], False)
> -
> - self.assertEqual(l[1], target_p[len(self.root):])
> - self.assertEqual(l[2], target_l[len(self.root):])
> -
> - def test_loop(self):
> - for e in self.EXCEPTIONS:
> - self.assertRaisesRegex(OSError, r'\[Errno %u\]' % e[1],
> - self.__realpath, e[0], False,
> False)
> diff --git a/meta/lib/oe/tests/test_types.py
> b/meta/lib/oe/tests/test_types.py
> deleted file mode 100644
> index 367cc30..0000000
> --- a/meta/lib/oe/tests/test_types.py
> +++ /dev/null
> @@ -1,62 +0,0 @@
> -import unittest
> -from oe.maketype import create, factory
> -
> -class TestTypes(unittest.TestCase):
> - def assertIsInstance(self, obj, cls):
> - return self.assertTrue(isinstance(obj, cls))
> -
> - def assertIsNot(self, obj, other):
> - return self.assertFalse(obj is other)
> -
> - def assertFactoryCreated(self, value, type, **flags):
> - cls = factory(type)
> - self.assertIsNot(cls, None)
> - self.assertIsInstance(create(value, type, **flags), cls)
> -
> -class TestBooleanType(TestTypes):
> - def test_invalid(self):
> - self.assertRaises(ValueError, create, '', 'boolean')
> - self.assertRaises(ValueError, create, 'foo', 'boolean')
> - self.assertRaises(TypeError, create, object(), 'boolean')
> -
> - def test_true(self):
> - self.assertTrue(create('y', 'boolean'))
> - self.assertTrue(create('yes', 'boolean'))
> - self.assertTrue(create('1', 'boolean'))
> - self.assertTrue(create('t', 'boolean'))
> - self.assertTrue(create('true', 'boolean'))
> - self.assertTrue(create('TRUE', 'boolean'))
> - self.assertTrue(create('truE', 'boolean'))
> -
> - def test_false(self):
> - self.assertFalse(create('n', 'boolean'))
> - self.assertFalse(create('no', 'boolean'))
> - self.assertFalse(create('0', 'boolean'))
> - self.assertFalse(create('f', 'boolean'))
> - self.assertFalse(create('false', 'boolean'))
> - self.assertFalse(create('FALSE', 'boolean'))
> - self.assertFalse(create('faLse', 'boolean'))
> -
> - def test_bool_equality(self):
> - self.assertEqual(create('n', 'boolean'), False)
> - self.assertNotEqual(create('n', 'boolean'), True)
> - self.assertEqual(create('y', 'boolean'), True)
> - self.assertNotEqual(create('y', 'boolean'), False)
> -
> -class TestList(TestTypes):
> - def assertListEqual(self, value, valid, sep=None):
> - obj = create(value, 'list', separator=sep)
> - self.assertEqual(obj, valid)
> - if sep is not None:
> - self.assertEqual(obj.separator, sep)
> - self.assertEqual(str(obj), obj.separator.join(obj))
> -
> - def test_list_nosep(self):
> - testlist = ['alpha', 'beta', 'theta']
> - self.assertListEqual('alpha beta theta', testlist)
> - self.assertListEqual('alpha beta\ttheta', testlist)
> - self.assertListEqual('alpha', ['alpha'])
> -
> - def test_list_usersep(self):
> - self.assertListEqual('foo:bar', ['foo', 'bar'], ':')
> - self.assertListEqual('foo:bar:baz', ['foo', 'bar', 'baz'],
> ':')
> diff --git a/meta/lib/oe/tests/test_utils.py
> b/meta/lib/oe/tests/test_utils.py
> deleted file mode 100644
> index 5d9ac52..0000000
> --- a/meta/lib/oe/tests/test_utils.py
> +++ /dev/null
> @@ -1,51 +0,0 @@
> -import unittest
> -from oe.utils import packages_filter_out_system
> -
> -class TestPackagesFilterOutSystem(unittest.TestCase):
> - def test_filter(self):
> - """
> - Test that oe.utils.packages_filter_out_system works.
> - """
> - try:
> - import bb
> - except ImportError:
> - self.skipTest("Cannot import bb")
> -
> - d = bb.data_smart.DataSmart()
> - d.setVar("PN", "foo")
> -
> - d.setVar("PACKAGES", "foo foo-doc foo-dev")
> - pkgs = packages_filter_out_system(d)
> - self.assertEqual(pkgs, [])
> -
> - d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
> - pkgs = packages_filter_out_system(d)
> - self.assertEqual(pkgs, ["foo-data"])
> -
> - d.setVar("PACKAGES", "foo foo-locale-en-gb")
> - pkgs = packages_filter_out_system(d)
> - self.assertEqual(pkgs, [])
> -
> - d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
> - pkgs = packages_filter_out_system(d)
> - self.assertEqual(pkgs, ["foo-data"])
> -
> -
> -class TestTrimVersion(unittest.TestCase):
> - def test_version_exception(self):
> - with self.assertRaises(TypeError):
> - trim_version(None, 2)
> - with self.assertRaises(TypeError):
> - trim_version((1, 2, 3), 2)
> -
> - def test_num_exception(self):
> - with self.assertRaises(ValueError):
> - trim_version("1.2.3", 0)
> - with self.assertRaises(ValueError):
> - trim_version("1.2.3", -1)
> -
> - def test_valid(self):
> - self.assertEqual(trim_version("1.2.3", 1), "1")
> - self.assertEqual(trim_version("1.2.3", 2), "1.2")
> - self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
> - self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
> diff --git a/meta/lib/oeqa/selftest/oe_tests/__init__.py
> b/meta/lib/oeqa/selftest/oe_tests/__init__.py
> new file mode 100644
> index 0000000..e69de29
> diff --git a/meta/lib/oeqa/selftest/oe_tests/elf.py
> b/meta/lib/oeqa/selftest/oe_tests/elf.py
> new file mode 100644
> index 0000000..582d772
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/oe_tests/elf.py
> @@ -0,0 +1,22 @@
> +from oeqa.selftest.base import oeSelfTest
> +from oeqa.utils.decorators import testcase
> +import oe.qa
> +
> +class TestElf(oeSelfTest):
> + def test_machine_name(self):
> + """
> + Test elf_machine_to_string()
> + """
> + self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
> + self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
> + self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
> + self.assertEqual(oe.qa.elf_machine_to_string(0x14),
> "PowerPC")
> + self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
> + self.assertEqual(oe.qa.elf_machine_to_string(0x2A),
> "SuperH")
> + self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
> + self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-
> 64")
> + self.assertEqual(oe.qa.elf_machine_to_string(0xB7),
> "AArch64")
> +
> + self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown
> (0)")
> + self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF),
> "Unknown (3735928559)")
> + self.assertEqual(oe.qa.elf_machine_to_string("foobar"),
> "Unknown ('foobar')")
> diff --git a/meta/lib/oeqa/selftest/oe_tests/license.py
> b/meta/lib/oeqa/selftest/oe_tests/license.py
> new file mode 100644
> index 0000000..90bdf51
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/oe_tests/license.py
> @@ -0,0 +1,69 @@
> +import oe.license
> +from oeqa.selftest.base import oeSelfTest
> +from oeqa.utils.decorators import testcase
> +
> +class SeenVisitor(oe.license.LicenseVisitor):
> + def __init__(self):
> + self.seen = []
> + oe.license.LicenseVisitor.__init__(self)
> +
> + def visit_Str(self, node):
> + self.seen.append(node.s)
> +
> +class TestSingleLicense(oeSelfTest):
> + licenses = [
> + "GPLv2",
> + "LGPL-2.0",
> + "Artistic",
> + "MIT",
> + "GPLv3+",
> + "FOO_BAR",
> + ]
> + invalid_licenses = ["GPL/BSD"]
> +
> + @staticmethod
> + def parse(licensestr):
> + visitor = SeenVisitor()
> + visitor.visit_string(licensestr)
> + return visitor.seen
> +
> + def test_single_licenses(self):
> + for license in self.licenses:
> + licenses = self.parse(license)
> + self.assertListEqual(licenses, [license])
> +
> + def test_invalid_licenses(self):
> + for license in self.invalid_licenses:
> + with self.assertRaises(oe.license.InvalidLicense) as cm:
> + self.parse(license)
> + self.assertEqual(cm.exception.license, license)
> +
> +class TestSimpleCombinations(oeSelfTest):
> + tests = {
> + "FOO&BAR": ["FOO", "BAR"],
> + "BAZ & MOO": ["BAZ", "MOO"],
> + "ALPHA|BETA": ["ALPHA"],
> + "BAZ&MOO|FOO": ["FOO"],
> + "FOO&BAR|BAZ": ["FOO", "BAR"],
> + }
> + preferred = ["ALPHA", "FOO", "BAR"]
> +
> + def test_tests(self):
> + def choose(a, b):
> + if all(lic in self.preferred for lic in b):
> + return b
> + else:
> + return a
> +
> + for license, expected in self.tests.items():
> + licenses = oe.license.flattened_licenses(license,
> choose)
> + self.assertListEqual(licenses, expected)
> +
> +class TestComplexCombinations(TestSimpleCombinations):
> + tests = {
> + "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
> + "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
> + "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
> + "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-
> 4-clause", "MIT"],
> + }
> + preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
> diff --git a/meta/lib/oeqa/selftest/oe_tests/path.py
> b/meta/lib/oeqa/selftest/oe_tests/path.py
> new file mode 100644
> index 0000000..09b56cb
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/oe_tests/path.py
> @@ -0,0 +1,90 @@
> +from oeqa.selftest.base import oeSelfTest
> +from oeqa.utils.decorators import testcase
> +import oe, oe.path
> +import tempfile
> +import os
> +import errno
> +import shutil
> +
> +class TestRealPath(oeSelfTest):
> + DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX",
> "usr/sbin", "usr/include", "usr/include/gdbm" ]
> + FILES = [ "etc/passwd", "b/file" ]
> + LINKS = [
> + ( "bin", "/usr/bin", "/usr/bin" ),
> + ( "binX", "usr/binX", "/usr/binX" ),
> + ( "c", "broken", "/broken" ),
> + ( "etc/passwd-1", "passwd", "/etc/passwd"
> ),
> + ( "etc/passwd-2", "passwd-1", "/etc/passwd"
> ),
> + ( "etc/passwd-3", "/etc/passwd-1", "/etc/passwd"
> ),
> + ( "etc/shadow-1", "/etc/shadow", "/etc/shadow"
> ),
> + ( "etc/shadow-2", "/etc/shadow-1", "/etc/shadow"
> ),
> + ( "prog-A", "bin/prog-A", "/usr/bin/prog-
> A" ),
> + ( "prog-B", "/bin/prog-B", "/usr/bin/prog-
> B" ),
> + ( "usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C"
> ),
> + ( "usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D"
> ),
> + ( "usr/binX/prog-E", "../sbin/prog-E", None ),
> + ( "usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F"
> ),
> + ( "loop", "a/loop", None ),
> + ( "a/loop", "../loop", None ),
> + ( "b/test", "file/foo", "/b/file/foo"
> ),
> + ]
> +
> + LINKS_PHYS = [
> + ( "./", "/", "" ),
> + ( "binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E" ),
> + ]
> +
> + EXCEPTIONS = [
> + ( "loop", errno.ELOOP ),
> + ( "b/test", errno.ENOENT ),
> + ]
> +
> + def __del__(self):
> + try:
> + #os.system("tree -F %s" % self.tmpdir)
> + shutil.rmtree(self.tmpdir)
> + except:
> + pass
> +
> + def setUp(self):
> + self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path")
> + self.root = os.path.join(self.tmpdir, "R")
> +
> + os.mkdir(os.path.join(self.tmpdir, "_real"))
> + os.symlink("_real", self.root)
> +
> + for d in self.DIRS:
> + os.mkdir(os.path.join(self.root, d))
> + for f in self.FILES:
> + open(os.path.join(self.root, f), "w")
> + for l in self.LINKS:
> + os.symlink(l[1], os.path.join(self.root, l[0]))
> +
> + def __realpath(self, file, use_physdir, assume_dir = True):
> + return oe.path.realpath(os.path.join(self.root, file),
> self.root,
> + use_physdir, assume_dir =
> assume_dir)
> +
> + def test_norm(self):
> + for l in self.LINKS:
> + if l[2] == None:
> + continue
> +
> + target_p = self.__realpath(l[0], True)
> + target_l = self.__realpath(l[0], False)
> +
> + if l[2] != False:
> + self.assertEqual(target_p, target_l)
> + self.assertEqual(l[2], target_p[len(self.root):])
> +
> + def test_phys(self):
> + for l in self.LINKS_PHYS:
> + target_p = self.__realpath(l[0], True)
> + target_l = self.__realpath(l[0], False)
> +
> + self.assertEqual(l[1], target_p[len(self.root):])
> + self.assertEqual(l[2], target_l[len(self.root):])
> +
> + def test_loop(self):
> + for e in self.EXCEPTIONS:
> + self.assertRaisesRegex(OSError, r'\[Errno %u\]' % e[1],
> + self.__realpath, e[0], False,
> False)
> diff --git a/meta/lib/oeqa/selftest/oe_tests/types.py
> b/meta/lib/oeqa/selftest/oe_tests/types.py
> new file mode 100644
> index 0000000..2613da9
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/oe_tests/types.py
> @@ -0,0 +1,61 @@
> +from oeqa.selftest.base import oeSelfTest
> +from oeqa.utils.decorators import testcase
> +from oe.maketype import create, factory
> +
> +class TestTypes(oeSelfTest):
> + def assertIsInstance(self, obj, cls):
> + return self.assertTrue(isinstance(obj, cls))
> +
> + def assertIsNot(self, obj, other):
> + return self.assertFalse(obj is other)
> +
> + def assertFactoryCreated(self, value, type, **flags):
> + cls = factory(type)
> + self.assertIsNot(cls, None)
> + self.assertIsInstance(create(value, type, **flags), cls)
> +
> + def assertListIsEqual(self, value, valid, sep=None):
> + obj = create(value, 'list', separator=sep)
> + self.assertListEqual(obj, valid)
> +
> +class TestBooleanType(TestTypes):
> + def test_invalid(self):
> + self.assertRaises(ValueError, create, '', 'boolean')
> + self.assertRaises(ValueError, create, 'foo', 'boolean')
> + self.assertRaises(TypeError, create, object(), 'boolean')
> +
> + def test_true(self):
> + self.assertTrue(create('y', 'boolean'))
> + self.assertTrue(create('yes', 'boolean'))
> + self.assertTrue(create('1', 'boolean'))
> + self.assertTrue(create('t', 'boolean'))
> + self.assertTrue(create('true', 'boolean'))
> + self.assertTrue(create('TRUE', 'boolean'))
> + self.assertTrue(create('truE', 'boolean'))
> +
> + def test_false(self):
> + self.assertFalse(create('n', 'boolean'))
> + self.assertFalse(create('no', 'boolean'))
> + self.assertFalse(create('0', 'boolean'))
> + self.assertFalse(create('f', 'boolean'))
> + self.assertFalse(create('false', 'boolean'))
> + self.assertFalse(create('FALSE', 'boolean'))
> + self.assertFalse(create('faLse', 'boolean'))
> +
> + def test_bool_equality(self):
> + self.assertEqual(create('n', 'boolean'), False)
> + self.assertNotEqual(create('n', 'boolean'), True)
> + self.assertEqual(create('y', 'boolean'), True)
> + self.assertNotEqual(create('y', 'boolean'), False)
> +
> +class TestList(TestTypes):
> +
> + def test_list_nosep(self):
> + testlist = ['alpha', 'beta', 'theta']
> + self.assertListIsEqual('alpha beta theta', testlist)
> + self.assertListIsEqual('alpha beta\ttheta', testlist)
> + self.assertListIsEqual('alpha', ['alpha'])
> +
> + def test_list_usersep(self):
> + self.assertListIsEqual('foo:bar', ['foo', 'bar'], ':')
> + self.assertListIsEqual('foo:bar:baz', ['foo', 'bar', 'baz'],
> ':')
> diff --git a/meta/lib/oeqa/selftest/oe_tests/utils.py
> b/meta/lib/oeqa/selftest/oe_tests/utils.py
> new file mode 100644
> index 0000000..25c60e1
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/oe_tests/utils.py
> @@ -0,0 +1,52 @@
> +from oeqa.selftest.base import oeSelfTest
> +from oeqa.utils.decorators import testcase
> +from oe.utils import packages_filter_out_system, trim_version
> +
> +class TestPackagesFilterOutSystem(oeSelfTest):
> + def test_filter(self):
> + """
> + Test that oe.utils.packages_filter_out_system works.
> + """
> + try:
> + import bb
> + except ImportError:
> + self.skipTest("Cannot import bb")
> +
> + d = bb.data_smart.DataSmart()
> + d.setVar("PN", "foo")
> +
> + d.setVar("PACKAGES", "foo foo-doc foo-dev")
> + pkgs = packages_filter_out_system(d)
> + self.assertEqual(pkgs, [])
> +
> + d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
> + pkgs = packages_filter_out_system(d)
> + self.assertEqual(pkgs, ["foo-data"])
> +
> + d.setVar("PACKAGES", "foo foo-locale-en-gb")
> + pkgs = packages_filter_out_system(d)
> + self.assertEqual(pkgs, [])
> +
> + d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
> + pkgs = packages_filter_out_system(d)
> + self.assertEqual(pkgs, ["foo-data"])
> +
> +
> +class TestTrimVersion(oeSelfTest):
> + def test_version_exception(self):
> + with self.assertRaises(TypeError):
> + trim_version(None, 2)
> + with self.assertRaises(TypeError):
> + trim_version((1, 2, 3), 2)
> +
> + def test_num_exception(self):
> + with self.assertRaises(ValueError):
> + trim_version("1.2.3", 0)
> + with self.assertRaises(ValueError):
> + trim_version("1.2.3", -1)
> +
> + def test_valid(self):
> + self.assertEqual(trim_version("1.2.3", 1), "1")
> + self.assertEqual(trim_version("1.2.3", 2), "1.2")
> + self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
> + self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
> --
> 2.1.4
>
^ permalink raw reply
* [PATCH] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests
From: jose.perez.carranza @ 2016-11-03 22:46 UTC (permalink / raw)
To: openembedded-core; +Cc: paul.eggleton
From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
Currently the unittests for scripts on meta/lib/oe are not being
executed by any suite hence the best option is migrate them to
meta/lib/oeqa/selftest to be executed along with the selftest suite.
[YOCTO #7376]
Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
---
meta/lib/oe/tests/__init__.py | 0
meta/lib/oe/tests/test_elf.py | 21 -------
meta/lib/oe/tests/test_license.py | 68 ----------------------
meta/lib/oe/tests/test_path.py | 89 ----------------------------
meta/lib/oe/tests/test_types.py | 62 --------------------
meta/lib/oe/tests/test_utils.py | 51 ----------------
meta/lib/oeqa/selftest/oe_tests/__init__.py | 0
meta/lib/oeqa/selftest/oe_tests/elf.py | 22 +++++++
meta/lib/oeqa/selftest/oe_tests/license.py | 69 ++++++++++++++++++++++
meta/lib/oeqa/selftest/oe_tests/path.py | 90 +++++++++++++++++++++++++++++
meta/lib/oeqa/selftest/oe_tests/types.py | 61 +++++++++++++++++++
meta/lib/oeqa/selftest/oe_tests/utils.py | 52 +++++++++++++++++
12 files changed, 294 insertions(+), 291 deletions(-)
delete mode 100644 meta/lib/oe/tests/__init__.py
delete mode 100644 meta/lib/oe/tests/test_elf.py
delete mode 100644 meta/lib/oe/tests/test_license.py
delete mode 100644 meta/lib/oe/tests/test_path.py
delete mode 100644 meta/lib/oe/tests/test_types.py
delete mode 100644 meta/lib/oe/tests/test_utils.py
create mode 100644 meta/lib/oeqa/selftest/oe_tests/__init__.py
create mode 100644 meta/lib/oeqa/selftest/oe_tests/elf.py
create mode 100644 meta/lib/oeqa/selftest/oe_tests/license.py
create mode 100644 meta/lib/oeqa/selftest/oe_tests/path.py
create mode 100644 meta/lib/oeqa/selftest/oe_tests/types.py
create mode 100644 meta/lib/oeqa/selftest/oe_tests/utils.py
diff --git a/meta/lib/oe/tests/__init__.py b/meta/lib/oe/tests/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/meta/lib/oe/tests/test_elf.py b/meta/lib/oe/tests/test_elf.py
deleted file mode 100644
index 1f59037..0000000
--- a/meta/lib/oe/tests/test_elf.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import unittest
-import oe.qa
-
-class TestElf(unittest.TestCase):
- def test_machine_name(self):
- """
- Test elf_machine_to_string()
- """
- self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
- self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
- self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
- self.assertEqual(oe.qa.elf_machine_to_string(0x14), "PowerPC")
- self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
- self.assertEqual(oe.qa.elf_machine_to_string(0x2A), "SuperH")
- self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
- self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64")
- self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64")
-
- self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)")
- self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)")
- self.assertEqual(oe.qa.elf_machine_to_string("foobar"), "Unknown ('foobar')")
diff --git a/meta/lib/oe/tests/test_license.py b/meta/lib/oe/tests/test_license.py
deleted file mode 100644
index c388886..0000000
--- a/meta/lib/oe/tests/test_license.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import unittest
-import oe.license
-
-class SeenVisitor(oe.license.LicenseVisitor):
- def __init__(self):
- self.seen = []
- oe.license.LicenseVisitor.__init__(self)
-
- def visit_Str(self, node):
- self.seen.append(node.s)
-
-class TestSingleLicense(unittest.TestCase):
- licenses = [
- "GPLv2",
- "LGPL-2.0",
- "Artistic",
- "MIT",
- "GPLv3+",
- "FOO_BAR",
- ]
- invalid_licenses = ["GPL/BSD"]
-
- @staticmethod
- def parse(licensestr):
- visitor = SeenVisitor()
- visitor.visit_string(licensestr)
- return visitor.seen
-
- def test_single_licenses(self):
- for license in self.licenses:
- licenses = self.parse(license)
- self.assertListEqual(licenses, [license])
-
- def test_invalid_licenses(self):
- for license in self.invalid_licenses:
- with self.assertRaises(oe.license.InvalidLicense) as cm:
- self.parse(license)
- self.assertEqual(cm.exception.license, license)
-
-class TestSimpleCombinations(unittest.TestCase):
- tests = {
- "FOO&BAR": ["FOO", "BAR"],
- "BAZ & MOO": ["BAZ", "MOO"],
- "ALPHA|BETA": ["ALPHA"],
- "BAZ&MOO|FOO": ["FOO"],
- "FOO&BAR|BAZ": ["FOO", "BAR"],
- }
- preferred = ["ALPHA", "FOO", "BAR"]
-
- def test_tests(self):
- def choose(a, b):
- if all(lic in self.preferred for lic in b):
- return b
- else:
- return a
-
- for license, expected in self.tests.items():
- licenses = oe.license.flattened_licenses(license, choose)
- self.assertListEqual(licenses, expected)
-
-class TestComplexCombinations(TestSimpleCombinations):
- tests = {
- "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
- "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
- "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
- "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-4-clause", "MIT"],
- }
- preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
diff --git a/meta/lib/oe/tests/test_path.py b/meta/lib/oe/tests/test_path.py
deleted file mode 100644
index 44d0681..0000000
--- a/meta/lib/oe/tests/test_path.py
+++ /dev/null
@@ -1,89 +0,0 @@
-import unittest
-import oe, oe.path
-import tempfile
-import os
-import errno
-import shutil
-
-class TestRealPath(unittest.TestCase):
- DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX", "usr/sbin", "usr/include", "usr/include/gdbm" ]
- FILES = [ "etc/passwd", "b/file" ]
- LINKS = [
- ( "bin", "/usr/bin", "/usr/bin" ),
- ( "binX", "usr/binX", "/usr/binX" ),
- ( "c", "broken", "/broken" ),
- ( "etc/passwd-1", "passwd", "/etc/passwd" ),
- ( "etc/passwd-2", "passwd-1", "/etc/passwd" ),
- ( "etc/passwd-3", "/etc/passwd-1", "/etc/passwd" ),
- ( "etc/shadow-1", "/etc/shadow", "/etc/shadow" ),
- ( "etc/shadow-2", "/etc/shadow-1", "/etc/shadow" ),
- ( "prog-A", "bin/prog-A", "/usr/bin/prog-A" ),
- ( "prog-B", "/bin/prog-B", "/usr/bin/prog-B" ),
- ( "usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C" ),
- ( "usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D" ),
- ( "usr/binX/prog-E", "../sbin/prog-E", None ),
- ( "usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F" ),
- ( "loop", "a/loop", None ),
- ( "a/loop", "../loop", None ),
- ( "b/test", "file/foo", "/b/file/foo" ),
- ]
-
- LINKS_PHYS = [
- ( "./", "/", "" ),
- ( "binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E" ),
- ]
-
- EXCEPTIONS = [
- ( "loop", errno.ELOOP ),
- ( "b/test", errno.ENOENT ),
- ]
-
- def __del__(self):
- try:
- #os.system("tree -F %s" % self.tmpdir)
- shutil.rmtree(self.tmpdir)
- except:
- pass
-
- def setUp(self):
- self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path")
- self.root = os.path.join(self.tmpdir, "R")
-
- os.mkdir(os.path.join(self.tmpdir, "_real"))
- os.symlink("_real", self.root)
-
- for d in self.DIRS:
- os.mkdir(os.path.join(self.root, d))
- for f in self.FILES:
- open(os.path.join(self.root, f), "w")
- for l in self.LINKS:
- os.symlink(l[1], os.path.join(self.root, l[0]))
-
- def __realpath(self, file, use_physdir, assume_dir = True):
- return oe.path.realpath(os.path.join(self.root, file), self.root,
- use_physdir, assume_dir = assume_dir)
-
- def test_norm(self):
- for l in self.LINKS:
- if l[2] == None:
- continue
-
- target_p = self.__realpath(l[0], True)
- target_l = self.__realpath(l[0], False)
-
- if l[2] != False:
- self.assertEqual(target_p, target_l)
- self.assertEqual(l[2], target_p[len(self.root):])
-
- def test_phys(self):
- for l in self.LINKS_PHYS:
- target_p = self.__realpath(l[0], True)
- target_l = self.__realpath(l[0], False)
-
- self.assertEqual(l[1], target_p[len(self.root):])
- self.assertEqual(l[2], target_l[len(self.root):])
-
- def test_loop(self):
- for e in self.EXCEPTIONS:
- self.assertRaisesRegex(OSError, r'\[Errno %u\]' % e[1],
- self.__realpath, e[0], False, False)
diff --git a/meta/lib/oe/tests/test_types.py b/meta/lib/oe/tests/test_types.py
deleted file mode 100644
index 367cc30..0000000
--- a/meta/lib/oe/tests/test_types.py
+++ /dev/null
@@ -1,62 +0,0 @@
-import unittest
-from oe.maketype import create, factory
-
-class TestTypes(unittest.TestCase):
- def assertIsInstance(self, obj, cls):
- return self.assertTrue(isinstance(obj, cls))
-
- def assertIsNot(self, obj, other):
- return self.assertFalse(obj is other)
-
- def assertFactoryCreated(self, value, type, **flags):
- cls = factory(type)
- self.assertIsNot(cls, None)
- self.assertIsInstance(create(value, type, **flags), cls)
-
-class TestBooleanType(TestTypes):
- def test_invalid(self):
- self.assertRaises(ValueError, create, '', 'boolean')
- self.assertRaises(ValueError, create, 'foo', 'boolean')
- self.assertRaises(TypeError, create, object(), 'boolean')
-
- def test_true(self):
- self.assertTrue(create('y', 'boolean'))
- self.assertTrue(create('yes', 'boolean'))
- self.assertTrue(create('1', 'boolean'))
- self.assertTrue(create('t', 'boolean'))
- self.assertTrue(create('true', 'boolean'))
- self.assertTrue(create('TRUE', 'boolean'))
- self.assertTrue(create('truE', 'boolean'))
-
- def test_false(self):
- self.assertFalse(create('n', 'boolean'))
- self.assertFalse(create('no', 'boolean'))
- self.assertFalse(create('0', 'boolean'))
- self.assertFalse(create('f', 'boolean'))
- self.assertFalse(create('false', 'boolean'))
- self.assertFalse(create('FALSE', 'boolean'))
- self.assertFalse(create('faLse', 'boolean'))
-
- def test_bool_equality(self):
- self.assertEqual(create('n', 'boolean'), False)
- self.assertNotEqual(create('n', 'boolean'), True)
- self.assertEqual(create('y', 'boolean'), True)
- self.assertNotEqual(create('y', 'boolean'), False)
-
-class TestList(TestTypes):
- def assertListEqual(self, value, valid, sep=None):
- obj = create(value, 'list', separator=sep)
- self.assertEqual(obj, valid)
- if sep is not None:
- self.assertEqual(obj.separator, sep)
- self.assertEqual(str(obj), obj.separator.join(obj))
-
- def test_list_nosep(self):
- testlist = ['alpha', 'beta', 'theta']
- self.assertListEqual('alpha beta theta', testlist)
- self.assertListEqual('alpha beta\ttheta', testlist)
- self.assertListEqual('alpha', ['alpha'])
-
- def test_list_usersep(self):
- self.assertListEqual('foo:bar', ['foo', 'bar'], ':')
- self.assertListEqual('foo:bar:baz', ['foo', 'bar', 'baz'], ':')
diff --git a/meta/lib/oe/tests/test_utils.py b/meta/lib/oe/tests/test_utils.py
deleted file mode 100644
index 5d9ac52..0000000
--- a/meta/lib/oe/tests/test_utils.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import unittest
-from oe.utils import packages_filter_out_system
-
-class TestPackagesFilterOutSystem(unittest.TestCase):
- def test_filter(self):
- """
- Test that oe.utils.packages_filter_out_system works.
- """
- try:
- import bb
- except ImportError:
- self.skipTest("Cannot import bb")
-
- d = bb.data_smart.DataSmart()
- d.setVar("PN", "foo")
-
- d.setVar("PACKAGES", "foo foo-doc foo-dev")
- pkgs = packages_filter_out_system(d)
- self.assertEqual(pkgs, [])
-
- d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
- pkgs = packages_filter_out_system(d)
- self.assertEqual(pkgs, ["foo-data"])
-
- d.setVar("PACKAGES", "foo foo-locale-en-gb")
- pkgs = packages_filter_out_system(d)
- self.assertEqual(pkgs, [])
-
- d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
- pkgs = packages_filter_out_system(d)
- self.assertEqual(pkgs, ["foo-data"])
-
-
-class TestTrimVersion(unittest.TestCase):
- def test_version_exception(self):
- with self.assertRaises(TypeError):
- trim_version(None, 2)
- with self.assertRaises(TypeError):
- trim_version((1, 2, 3), 2)
-
- def test_num_exception(self):
- with self.assertRaises(ValueError):
- trim_version("1.2.3", 0)
- with self.assertRaises(ValueError):
- trim_version("1.2.3", -1)
-
- def test_valid(self):
- self.assertEqual(trim_version("1.2.3", 1), "1")
- self.assertEqual(trim_version("1.2.3", 2), "1.2")
- self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
- self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
diff --git a/meta/lib/oeqa/selftest/oe_tests/__init__.py b/meta/lib/oeqa/selftest/oe_tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/meta/lib/oeqa/selftest/oe_tests/elf.py b/meta/lib/oeqa/selftest/oe_tests/elf.py
new file mode 100644
index 0000000..582d772
--- /dev/null
+++ b/meta/lib/oeqa/selftest/oe_tests/elf.py
@@ -0,0 +1,22 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.decorators import testcase
+import oe.qa
+
+class TestElf(oeSelfTest):
+ def test_machine_name(self):
+ """
+ Test elf_machine_to_string()
+ """
+ self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x14), "PowerPC")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x2A), "SuperH")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64")
+ self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64")
+
+ self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)")
+ self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)")
+ self.assertEqual(oe.qa.elf_machine_to_string("foobar"), "Unknown ('foobar')")
diff --git a/meta/lib/oeqa/selftest/oe_tests/license.py b/meta/lib/oeqa/selftest/oe_tests/license.py
new file mode 100644
index 0000000..90bdf51
--- /dev/null
+++ b/meta/lib/oeqa/selftest/oe_tests/license.py
@@ -0,0 +1,69 @@
+import oe.license
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.decorators import testcase
+
+class SeenVisitor(oe.license.LicenseVisitor):
+ def __init__(self):
+ self.seen = []
+ oe.license.LicenseVisitor.__init__(self)
+
+ def visit_Str(self, node):
+ self.seen.append(node.s)
+
+class TestSingleLicense(oeSelfTest):
+ licenses = [
+ "GPLv2",
+ "LGPL-2.0",
+ "Artistic",
+ "MIT",
+ "GPLv3+",
+ "FOO_BAR",
+ ]
+ invalid_licenses = ["GPL/BSD"]
+
+ @staticmethod
+ def parse(licensestr):
+ visitor = SeenVisitor()
+ visitor.visit_string(licensestr)
+ return visitor.seen
+
+ def test_single_licenses(self):
+ for license in self.licenses:
+ licenses = self.parse(license)
+ self.assertListEqual(licenses, [license])
+
+ def test_invalid_licenses(self):
+ for license in self.invalid_licenses:
+ with self.assertRaises(oe.license.InvalidLicense) as cm:
+ self.parse(license)
+ self.assertEqual(cm.exception.license, license)
+
+class TestSimpleCombinations(oeSelfTest):
+ tests = {
+ "FOO&BAR": ["FOO", "BAR"],
+ "BAZ & MOO": ["BAZ", "MOO"],
+ "ALPHA|BETA": ["ALPHA"],
+ "BAZ&MOO|FOO": ["FOO"],
+ "FOO&BAR|BAZ": ["FOO", "BAR"],
+ }
+ preferred = ["ALPHA", "FOO", "BAR"]
+
+ def test_tests(self):
+ def choose(a, b):
+ if all(lic in self.preferred for lic in b):
+ return b
+ else:
+ return a
+
+ for license, expected in self.tests.items():
+ licenses = oe.license.flattened_licenses(license, choose)
+ self.assertListEqual(licenses, expected)
+
+class TestComplexCombinations(TestSimpleCombinations):
+ tests = {
+ "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
+ "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
+ "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
+ "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-4-clause", "MIT"],
+ }
+ preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
diff --git a/meta/lib/oeqa/selftest/oe_tests/path.py b/meta/lib/oeqa/selftest/oe_tests/path.py
new file mode 100644
index 0000000..09b56cb
--- /dev/null
+++ b/meta/lib/oeqa/selftest/oe_tests/path.py
@@ -0,0 +1,90 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.decorators import testcase
+import oe, oe.path
+import tempfile
+import os
+import errno
+import shutil
+
+class TestRealPath(oeSelfTest):
+ DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX", "usr/sbin", "usr/include", "usr/include/gdbm" ]
+ FILES = [ "etc/passwd", "b/file" ]
+ LINKS = [
+ ( "bin", "/usr/bin", "/usr/bin" ),
+ ( "binX", "usr/binX", "/usr/binX" ),
+ ( "c", "broken", "/broken" ),
+ ( "etc/passwd-1", "passwd", "/etc/passwd" ),
+ ( "etc/passwd-2", "passwd-1", "/etc/passwd" ),
+ ( "etc/passwd-3", "/etc/passwd-1", "/etc/passwd" ),
+ ( "etc/shadow-1", "/etc/shadow", "/etc/shadow" ),
+ ( "etc/shadow-2", "/etc/shadow-1", "/etc/shadow" ),
+ ( "prog-A", "bin/prog-A", "/usr/bin/prog-A" ),
+ ( "prog-B", "/bin/prog-B", "/usr/bin/prog-B" ),
+ ( "usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C" ),
+ ( "usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D" ),
+ ( "usr/binX/prog-E", "../sbin/prog-E", None ),
+ ( "usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F" ),
+ ( "loop", "a/loop", None ),
+ ( "a/loop", "../loop", None ),
+ ( "b/test", "file/foo", "/b/file/foo" ),
+ ]
+
+ LINKS_PHYS = [
+ ( "./", "/", "" ),
+ ( "binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E" ),
+ ]
+
+ EXCEPTIONS = [
+ ( "loop", errno.ELOOP ),
+ ( "b/test", errno.ENOENT ),
+ ]
+
+ def __del__(self):
+ try:
+ #os.system("tree -F %s" % self.tmpdir)
+ shutil.rmtree(self.tmpdir)
+ except:
+ pass
+
+ def setUp(self):
+ self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path")
+ self.root = os.path.join(self.tmpdir, "R")
+
+ os.mkdir(os.path.join(self.tmpdir, "_real"))
+ os.symlink("_real", self.root)
+
+ for d in self.DIRS:
+ os.mkdir(os.path.join(self.root, d))
+ for f in self.FILES:
+ open(os.path.join(self.root, f), "w")
+ for l in self.LINKS:
+ os.symlink(l[1], os.path.join(self.root, l[0]))
+
+ def __realpath(self, file, use_physdir, assume_dir = True):
+ return oe.path.realpath(os.path.join(self.root, file), self.root,
+ use_physdir, assume_dir = assume_dir)
+
+ def test_norm(self):
+ for l in self.LINKS:
+ if l[2] == None:
+ continue
+
+ target_p = self.__realpath(l[0], True)
+ target_l = self.__realpath(l[0], False)
+
+ if l[2] != False:
+ self.assertEqual(target_p, target_l)
+ self.assertEqual(l[2], target_p[len(self.root):])
+
+ def test_phys(self):
+ for l in self.LINKS_PHYS:
+ target_p = self.__realpath(l[0], True)
+ target_l = self.__realpath(l[0], False)
+
+ self.assertEqual(l[1], target_p[len(self.root):])
+ self.assertEqual(l[2], target_l[len(self.root):])
+
+ def test_loop(self):
+ for e in self.EXCEPTIONS:
+ self.assertRaisesRegex(OSError, r'\[Errno %u\]' % e[1],
+ self.__realpath, e[0], False, False)
diff --git a/meta/lib/oeqa/selftest/oe_tests/types.py b/meta/lib/oeqa/selftest/oe_tests/types.py
new file mode 100644
index 0000000..2613da9
--- /dev/null
+++ b/meta/lib/oeqa/selftest/oe_tests/types.py
@@ -0,0 +1,61 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.decorators import testcase
+from oe.maketype import create, factory
+
+class TestTypes(oeSelfTest):
+ def assertIsInstance(self, obj, cls):
+ return self.assertTrue(isinstance(obj, cls))
+
+ def assertIsNot(self, obj, other):
+ return self.assertFalse(obj is other)
+
+ def assertFactoryCreated(self, value, type, **flags):
+ cls = factory(type)
+ self.assertIsNot(cls, None)
+ self.assertIsInstance(create(value, type, **flags), cls)
+
+ def assertListIsEqual(self, value, valid, sep=None):
+ obj = create(value, 'list', separator=sep)
+ self.assertListEqual(obj, valid)
+
+class TestBooleanType(TestTypes):
+ def test_invalid(self):
+ self.assertRaises(ValueError, create, '', 'boolean')
+ self.assertRaises(ValueError, create, 'foo', 'boolean')
+ self.assertRaises(TypeError, create, object(), 'boolean')
+
+ def test_true(self):
+ self.assertTrue(create('y', 'boolean'))
+ self.assertTrue(create('yes', 'boolean'))
+ self.assertTrue(create('1', 'boolean'))
+ self.assertTrue(create('t', 'boolean'))
+ self.assertTrue(create('true', 'boolean'))
+ self.assertTrue(create('TRUE', 'boolean'))
+ self.assertTrue(create('truE', 'boolean'))
+
+ def test_false(self):
+ self.assertFalse(create('n', 'boolean'))
+ self.assertFalse(create('no', 'boolean'))
+ self.assertFalse(create('0', 'boolean'))
+ self.assertFalse(create('f', 'boolean'))
+ self.assertFalse(create('false', 'boolean'))
+ self.assertFalse(create('FALSE', 'boolean'))
+ self.assertFalse(create('faLse', 'boolean'))
+
+ def test_bool_equality(self):
+ self.assertEqual(create('n', 'boolean'), False)
+ self.assertNotEqual(create('n', 'boolean'), True)
+ self.assertEqual(create('y', 'boolean'), True)
+ self.assertNotEqual(create('y', 'boolean'), False)
+
+class TestList(TestTypes):
+
+ def test_list_nosep(self):
+ testlist = ['alpha', 'beta', 'theta']
+ self.assertListIsEqual('alpha beta theta', testlist)
+ self.assertListIsEqual('alpha beta\ttheta', testlist)
+ self.assertListIsEqual('alpha', ['alpha'])
+
+ def test_list_usersep(self):
+ self.assertListIsEqual('foo:bar', ['foo', 'bar'], ':')
+ self.assertListIsEqual('foo:bar:baz', ['foo', 'bar', 'baz'], ':')
diff --git a/meta/lib/oeqa/selftest/oe_tests/utils.py b/meta/lib/oeqa/selftest/oe_tests/utils.py
new file mode 100644
index 0000000..25c60e1
--- /dev/null
+++ b/meta/lib/oeqa/selftest/oe_tests/utils.py
@@ -0,0 +1,52 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.decorators import testcase
+from oe.utils import packages_filter_out_system, trim_version
+
+class TestPackagesFilterOutSystem(oeSelfTest):
+ def test_filter(self):
+ """
+ Test that oe.utils.packages_filter_out_system works.
+ """
+ try:
+ import bb
+ except ImportError:
+ self.skipTest("Cannot import bb")
+
+ d = bb.data_smart.DataSmart()
+ d.setVar("PN", "foo")
+
+ d.setVar("PACKAGES", "foo foo-doc foo-dev")
+ pkgs = packages_filter_out_system(d)
+ self.assertEqual(pkgs, [])
+
+ d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
+ pkgs = packages_filter_out_system(d)
+ self.assertEqual(pkgs, ["foo-data"])
+
+ d.setVar("PACKAGES", "foo foo-locale-en-gb")
+ pkgs = packages_filter_out_system(d)
+ self.assertEqual(pkgs, [])
+
+ d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
+ pkgs = packages_filter_out_system(d)
+ self.assertEqual(pkgs, ["foo-data"])
+
+
+class TestTrimVersion(oeSelfTest):
+ def test_version_exception(self):
+ with self.assertRaises(TypeError):
+ trim_version(None, 2)
+ with self.assertRaises(TypeError):
+ trim_version((1, 2, 3), 2)
+
+ def test_num_exception(self):
+ with self.assertRaises(ValueError):
+ trim_version("1.2.3", 0)
+ with self.assertRaises(ValueError):
+ trim_version("1.2.3", -1)
+
+ def test_valid(self):
+ self.assertEqual(trim_version("1.2.3", 1), "1")
+ self.assertEqual(trim_version("1.2.3", 2), "1.2")
+ self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
+ self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
--
2.1.4
^ permalink raw reply related
* Re: [PATCH] mkefidisk.sh: add deprecation warning to the output
From: Khem Raj @ 2016-11-03 21:42 UTC (permalink / raw)
To: Ed Bartosh; +Cc: openembedded-core
In-Reply-To: <1477910801-9169-1-git-send-email-ed.bartosh@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]
> On Oct 31, 2016, at 3:46 AM, Ed Bartosh <ed.bartosh@linux.intel.com> wrote:
>
> mkefidisk.sh will soon be deprecated in favor of .wic images.
>
> Added deprecation warning to the script to inform users that
> this script will soon be removed from the codebase.
>
> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
> ---
> scripts/contrib/mkefidisk.sh | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
> index d8db3c0..a175895 100755
> --- a/scripts/contrib/mkefidisk.sh
> +++ b/scripts/contrib/mkefidisk.sh
> @@ -20,6 +20,11 @@
>
> LANG=C
>
> +echo
> +echo "WARNING: This script is deprecated and will be removed soon."
> +echo "Please consider using wic EFI images instead."
> +echo
> +
is .wic image dd’able directly ?
We should also document, the wic steps in wiki pages e.g. http://wiki.minnowboard.org/Yocto_Project
> # Set to 1 to enable additional output
> DEBUG=0
> OUT="/dev/null"
> --
> 2.1.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply
* [PATCH] 3/3] readline: Update to version 7.0
From: Fabio Berton @ 2016-11-03 20:41 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1478205719-28589-1-git-send-email-fabio.berton@ossystems.com.br>
Remove readline 6.3 patches and config-dirent-symbols.patch already
apply on upstream.
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
---
.../configure-fix.patch | 0
.../{readline-6.3 => readline-7.0}/norpath.patch | 0
meta/recipes-core/readline/readline_6.3.bb | 34 ----------------------
meta/recipes-core/readline/readline_7.0.bb | 7 +++++
4 files changed, 7 insertions(+), 34 deletions(-)
rename meta/recipes-core/readline/{readline-6.3 => readline-7.0}/configure-fix.patch (100%)
rename meta/recipes-core/readline/{readline-6.3 => readline-7.0}/norpath.patch (100%)
delete mode 100644 meta/recipes-core/readline/readline_6.3.bb
create mode 100644 meta/recipes-core/readline/readline_7.0.bb
diff --git a/meta/recipes-core/readline/readline-6.3/configure-fix.patch b/meta/recipes-core/readline/readline-7.0/configure-fix.patch
similarity index 100%
rename from meta/recipes-core/readline/readline-6.3/configure-fix.patch
rename to meta/recipes-core/readline/readline-7.0/configure-fix.patch
diff --git a/meta/recipes-core/readline/readline-6.3/norpath.patch b/meta/recipes-core/readline/readline-7.0/norpath.patch
similarity index 100%
rename from meta/recipes-core/readline/readline-6.3/norpath.patch
rename to meta/recipes-core/readline/readline-7.0/norpath.patch
diff --git a/meta/recipes-core/readline/readline_6.3.bb b/meta/recipes-core/readline/readline_6.3.bb
deleted file mode 100644
index 8ec7c4a..0000000
--- a/meta/recipes-core/readline/readline_6.3.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-require readline.inc
-
-SRC_URI += "${GNU_MIRROR}/readline/readline-6.3-patches/readline63-001;name=patch1;apply=yes;striplevel=0 \
- ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-002;name=patch2;apply=yes;striplevel=0 \
- ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-003;name=patch3;apply=yes;striplevel=0 \
- ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-004;name=patch4;apply=yes;striplevel=0 \
- ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-005;name=patch5;apply=yes;striplevel=0 \
- ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-006;name=patch6;apply=yes;striplevel=0 \
- ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-007;name=patch7;apply=yes;striplevel=0 \
- ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-008;name=patch8;apply=yes;striplevel=0 \
- file://configure-fix.patch \
- file://config-dirent-symbols.patch \
- file://norpath.patch"
-
-SRC_URI[archive.md5sum] = "33c8fb279e981274f485fd91da77e94a"
-SRC_URI[archive.sha256sum] = "56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43"
-
-SRC_URI[patch1.md5sum] = "4343f5ea9b0f42447f102fb61576b398"
-SRC_URI[patch1.sha256sum] = "1a79bbb6eaee750e0d6f7f3d059b30a45fc54e8e388a8e05e9c3ae598590146f"
-SRC_URI[patch2.md5sum] = "700295212f7e2978577feaee584afddb"
-SRC_URI[patch2.sha256sum] = "39e304c7a526888f9e112e733848215736fb7b9d540729b9e31f3347b7a1e0a5"
-SRC_URI[patch3.md5sum] = "af4963862f5156fbf9111c2c6fa86ed7"
-SRC_URI[patch3.sha256sum] = "ec41bdd8b00fd884e847708513df41d51b1243cecb680189e31b7173d01ca52f"
-SRC_URI[patch4.md5sum] = "11f9def89803a5052db3ba72394ce14f"
-SRC_URI[patch4.sha256sum] = "4547b906fb2570866c21887807de5dee19838a60a1afb66385b272155e4355cc"
-SRC_URI[patch5.md5sum] = "93721c31cd225393f80cb3aadb165544"
-SRC_URI[patch5.sha256sum] = "877788f9228d1a9907a4bcfe3d6dd0439c08d728949458b41208d9bf9060274b"
-SRC_URI[patch6.md5sum] = "71dc6ecce66d1489b96595f55d142a52"
-SRC_URI[patch6.sha256sum] = "5c237ab3c6c97c23cf52b2a118adc265b7fb411b57c93a5f7c221d50fafbe556"
-SRC_URI[patch7.md5sum] = "062a08ed60679d3c4878710b3d595b65"
-SRC_URI[patch7.sha256sum] = "4d79b5a2adec3c2e8114cbd3d63c1771f7c6cf64035368624903d257014f5bea"
-SRC_URI[patch8.md5sum] = "ee1c04072154826870848d8b218d7b04"
-SRC_URI[patch8.sha256sum] = "3bc093cf526ceac23eb80256b0ec87fa1735540d659742107b6284d635c43787"
-
diff --git a/meta/recipes-core/readline/readline_7.0.bb b/meta/recipes-core/readline/readline_7.0.bb
new file mode 100644
index 0000000..85dfaa6
--- /dev/null
+++ b/meta/recipes-core/readline/readline_7.0.bb
@@ -0,0 +1,7 @@
+require readline.inc
+
+SRC_URI += "file://configure-fix.patch \
+ file://norpath.patch"
+
+SRC_URI[archive.md5sum] = "205b03a87fc83dab653b628c59b9fc91"
+SRC_URI[archive.sha256sum] = "750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334"
--
2.1.4
^ permalink raw reply related
* [PATCH] 2/3] curl: Update to version 7.51.0
From: Fabio Berton @ 2016-11-03 20:41 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1478205719-28589-1-git-send-email-fabio.berton@ossystems.com.br>
CVE fixed in 7.51.0:
CVE-2016-8615: cookie injection for other servers
CVE-2016-8616: case insensitive password comparison
CVE-2016-8617: OOB write via unchecked multiplication
CVE-2016-8618: double-free in curl_maprintf
CVE-2016-8619: double-free in krb5 code
CVE-2016-8620: glob parser write/read out of bounds
CVE-2016-8621: curl_getdate read out of bounds
CVE-2016-8622: URL unescape heap overflow via integer truncation
CVE-2016-8623: Use-after-free via shared cookies
CVE-2016-8624: invalid URL parsing with '#'
CVE-2016-8625: IDNA 2003 makes curl use wrong host
To see complete log access link bellow:
https://curl.haxx.se/changes.html#7_51_0
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
---
meta/recipes-support/curl/{curl_7.50.1.bb => curl_7.51.0.bb} | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename meta/recipes-support/curl/{curl_7.50.1.bb => curl_7.51.0.bb} (94%)
diff --git a/meta/recipes-support/curl/curl_7.50.1.bb b/meta/recipes-support/curl/curl_7.51.0.bb
similarity index 94%
rename from meta/recipes-support/curl/curl_7.50.1.bb
rename to meta/recipes-support/curl/curl_7.51.0.bb
index a21419a..e1a996b 100644
--- a/meta/recipes-support/curl/curl_7.50.1.bb
+++ b/meta/recipes-support/curl/curl_7.51.0.bb
@@ -14,8 +14,8 @@ SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
#
SRC_URI += " file://configure_ac.patch"
-SRC_URI[md5sum] = "015f6a0217ca6f2c5442ca406476920b"
-SRC_URI[sha256sum] = "3c12c5f54ccaa1d40abc65d672107dcc75d3e1fcb38c267484334280096e5156"
+SRC_URI[md5sum] = "09a7c5769a7eae676d5e2c86d51f167e"
+SRC_URI[sha256sum] = "7f8240048907e5030f67be0a6129bc4b333783b9cca1391026d700835a788dde"
inherit autotools pkgconfig binconfig multilib_header
--
2.1.4
^ permalink raw reply related
* [PATCH] 1/3] grep: Update to version 2.26
From: Fabio Berton @ 2016-11-03 20:41 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
---
meta/recipes-extended/grep/{grep_2.25.bb => grep_2.26.bb} | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename meta/recipes-extended/grep/{grep_2.25.bb => grep_2.26.bb} (88%)
diff --git a/meta/recipes-extended/grep/grep_2.25.bb b/meta/recipes-extended/grep/grep_2.26.bb
similarity index 88%
rename from meta/recipes-extended/grep/grep_2.25.bb
rename to meta/recipes-extended/grep/grep_2.26.bb
index 9720d9f..9e6f05e 100644
--- a/meta/recipes-extended/grep/grep_2.25.bb
+++ b/meta/recipes-extended/grep/grep_2.26.bb
@@ -9,8 +9,8 @@ SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
"
-SRC_URI[md5sum] = "04e96b0e6f0fe6a180ae62c88fcd0af6"
-SRC_URI[sha256sum] = "e21e83bac50450e0d0d61a42c154ee0dceaacdbf4f604ef6e79071cb8e596830"
+SRC_URI[md5sum] = "afdd61c7221434722671baf002ac9267"
+SRC_URI[sha256sum] = "246a8fb37e82aa33d495b07c22fdab994c039ab0f818538eac81b01e78636870"
inherit autotools gettext texinfo
--
2.1.4
^ permalink raw reply related
* Re: [PATCH v2] serf: Update to version 1.3.9
From: Fabio Berton @ 2016-11-03 20:37 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
In-Reply-To: <CAJTo0Lb7KFypggDwyWF5_7KutJ-Tq9k2+8E69696CirEWrcpRQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 634 bytes --]
Hi Ross,
I removed UPSTREAM_CHECK_URI and checked with bitbake serf -c checkpkg and
I got the same output. So, I'll remove UPSTREAM_CHECK_URI and send a v3.
Thanks
Fabio
On Thu, Nov 3, 2016 at 5:40 PM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 3 November 2016 at 15:34, Fabio Berton <fabio.berton@ossystems.com.br>
> wrote:
>
>> -UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/s/serf/"
>> +UPSTREAM_CHECK_URI = "${APACHE_MIRROR}/${BPN}/"
>>
>
> As all the tarballs are in a single directory you can probably just delete
> this line (though please do check with bitbake serf -c checkpkg).
>
> Ross
>
[-- Attachment #2: Type: text/html, Size: 1799 bytes --]
^ permalink raw reply
* [PATCH v3]] serf: Update to version 1.3.9
From: Fabio Berton @ 2016-11-03 20:35 UTC (permalink / raw)
To: openembedded-core
Change SRC_URI to use APACHE_MIRROR to download serf from apache
project page and remove UPSTREAM_CHECK_URI.
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
---
meta/recipes-support/serf/{serf_1.3.8.bb => serf_1.3.9.bb} | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
rename meta/recipes-support/serf/{serf_1.3.8.bb => serf_1.3.9.bb} (67%)
diff --git a/meta/recipes-support/serf/serf_1.3.8.bb b/meta/recipes-support/serf/serf_1.3.9.bb
similarity index 67%
rename from meta/recipes-support/serf/serf_1.3.8.bb
rename to meta/recipes-support/serf/serf_1.3.9.bb
index c498d90..2be5a06 100644
--- a/meta/recipes-support/serf/serf_1.3.8.bb
+++ b/meta/recipes-support/serf/serf_1.3.9.bb
@@ -1,12 +1,10 @@
SUMMARY = "High-Performance Asynchronous HTTP Client Library"
-SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/s/${BPN}/${BPN}_${PV}.orig.tar.gz \
+SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
file://norpath.patch \
file://env.patch"
-SRC_URI[md5sum] = "713beaf05d7f3329de121e218e2fcb93"
-SRC_URI[sha256sum] = "77134cd5010664ca023585bce50978bd4005906ed280ff889f591f86df7c59e4"
-
-UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/s/serf/"
+SRC_URI[md5sum] = "370a6340ff20366ab088012cd13f2b57"
+SRC_URI[sha256sum] = "549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
--
2.1.4
^ permalink raw reply related
* Re: [krogoth][PATCH 1/2] qemu: Security fix CVE-2016-4439
From: Leonardo Sandoval @ 2016-11-03 20:27 UTC (permalink / raw)
To: Adrian Dudau, openembedded-core
In-Reply-To: <1478179081-34596-1-git-send-email-adrian.dudau@enea.com>
Adrian,
On 11/03/2016 07:18 AM, Adrian Dudau wrote:
> affects qemu < 2.7.0
>
> Quick Emulator(Qemu) built with the ESP/NCR53C9x controller emulation
> support is vulnerable to an OOB write access issue. The controller uses
> 16-byte FIFO buffer for command and data transfer. The OOB write occurs
> while writing to this command buffer in routine get_cmd().
>
> A privileged user inside guest could use this flaw to crash the Qemu
> process resulting in DoS.
>
> References:
> ----------
> http://www.openwall.com/lists/oss-security/2016/05/19/4
> https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2016-4441
>
> Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
> ---
> .../recipes-devtools/qemu/qemu/CVE-2016-4441.patch | 78 ++++++++++++++++++++++
> meta/recipes-devtools/qemu/qemu_2.5.0.bb | 1 +
> 2 files changed, 79 insertions(+)
> create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2016-4441.patch
>
> diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2016-4441.patch b/meta/recipes-devtools/qemu/qemu/CVE-2016-4441.patch
> new file mode 100644
> index 0000000..3cbe394
> --- /dev/null
> +++ b/meta/recipes-devtools/qemu/qemu/CVE-2016-4441.patch
> @@ -0,0 +1,78 @@
> +From 6c1fef6b59563cc415f21e03f81539ed4b33ad90 Mon Sep 17 00:00:00 2001
> +From: Prasad J Pandit <pjp@fedoraproject.org>
> +Date: Thu, 19 May 2016 16:09:31 +0530
> +Subject: [PATCH] esp: check dma length before reading scsi command(CVE-2016-4441)
> +
> +The 53C9X Fast SCSI Controller(FSC) comes with an internal 16-byte
> +FIFO buffer. It is used to handle command and data transfer.
> +Routine get_cmd() uses DMA to read scsi commands into this buffer.
> +Add check to validate DMA length against buffer size to avoid any
> +overrun.
> +
> +Fixes CVE-2016-4441.
> +
Correct or include the CVE tag on cve patch with format:'CVE: CVE-YYYY-XXXX'
^ permalink raw reply
* Re: Sanity check fails with 'ccache'
From: Andre McCurdy @ 2016-11-03 19:44 UTC (permalink / raw)
To: Enrico Scholz, jeremy.rosen; +Cc: OE Core mailing list
In-Reply-To: <lywpgnv3f4.fsf@ensc-virt.intern.sigma-chemnitz.de>
On Tue, Nov 1, 2016 at 4:35 AM, Enrico Scholz
<enrico.scholz@sigma-chemnitz.de> wrote:
> Hi,
>
> with 'morty', sanity check fails with
>
> | Please install the following missing utilities: C Compiler (ccache gcc ),C++ Compiler (ccache g++ )
>
> I think, parts of 89f55bf8e9d633cfb508a0885a462afb561c7cee should be
> reverted.
+1
The sanity check changes cause problems when ccache is enabled:
http://git.openembedded.org/openembedded-core/commit/?id=89f55bf8e9d633cfb508a0885a462afb561c7cee
>
> Enrico
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox