Commit Graph

55 Commits

Author SHA1 Message Date
Joshua Lock cc2744267f meta: replace uses of bb.data.expand(VARNAME, d) with d.expand(VARNAME)
bb.data.expand(x, d) is deprecated API.

[YOCTO #10678]

(From OE-Core rev: a361babe443da635aed83be46679067457fd6a58)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:19 +00:00
Joshua Lock 3c59b1bf93 meta: remove True option to getVarFlag calls
getVarFlag() now defaults to expanding by default, thus remove the
True option from getVarFlag() calls with a regex search and
replace.

Search made with the following regex:
getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\)

(From OE-Core rev: 2dea9e490a98377010b3d4118d054814c317a735)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Ross Burton 113828ff86 archiver: don't change directory when generating tarball
There's no need to chdir() as tarfile.add() can be told what name to use in the
archive.

(From OE-Core rev: d0b282bce34db44dde4dd7f53a64dfaafe6789de)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:20 +00:00
Saul Wold 45f7221915 archiver: fix gcc-source handling
The source archiver was not handling the gcc-source target correctly, since it uses the
work-shared directory, we don't want to unpack and patch it twice, just as the comments
say, but the code was not there to check for the gcc-source target.

[YOCTO #10265]

(From OE-Core rev: bbac0699ceadb7a25a60643fb23dffce8b4d23d0)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 08:31:41 +01:00
Patrick Ohly b5a00339d9 archive.bbclass: fix do_ar_original archiving of multiple source repos
When a recipe uses more than one source which isn't a plain file (for
example, multiple git repos), then do_ar_original created the source
archives using the same filename and thus only archived one source.

The "name" parameter is used as file suffix to create unique names for
each source, leading to archives following this pattern:
deploy/${TARGET_SYS}/${PF}/${PF}[-<name>].tar.gz.

The ${PF} part is a bit redundant, which may or may not be
desirable. The patch is more localized this way (no need to modify
create_tarball()).

For example, meta-oic's iotivity_1.1.1.bb uses:

   url_iotivity = "git://github.com/iotivity/iotivity.git"
   branch_iotivity = "1.1-rel"
   SRC_URI = "${url_iotivity};destsuffix=${S};branch=${branch_iotivity};protocol=http;"

   url_tinycbor = "git://github.com/01org/tinycbor.git"
   SRC_URI += "${url_tinycbor};name=tinycbor;destsuffix=${S}/extlibs/tinycbor/tinycbor;protocol=http"

   url_hippomocks = "git://github.com/dascandy/hippomocks.git"
   SRC_URI += "${url_hippomocks};name=hippomocks;destsuffix=${S}/extlibs/hippomocks-master;protocol=http"
   SRC_URI += "file://hippomocks_mips_patch"

   url_gtest = "http://pkgs.fedoraproject.org/repo/pkgs/gtest/gtest-1.7.0.zip/2d6ec8ccdf5c46b05ba54a9fd1d130d7/gtest-1.7.0.zip"
   SRC_URI += "${url_gtest};name=gtest;subdir=${BP}/extlibs/gtest"

   url_sqlite = "http://www.sqlite.org/2015/sqlite-amalgamation-3081101.zip"
   SRC_URI += "${url_sqlite};name=sqlite3;subdir=${BP}/extlibs/sqlite3;unpack=false"

These now get archived in deploy/sources/*/iotivity-1.1.1-r2/ as:

gtest-1.7.0.zip                      iotivity-1.1.1-r2-recipe.tar.gz    sqlite-amalgamation-3081101.zip
hippomocks_mips_patch                iotivity-1.1.1-r2.tar.gz
iotivity-1.1.1-r2-hippomocks.tar.gz  iotivity-1.1.1-r2-tinycbor.tar.gz

(From OE-Core rev: 5c63ffc706c0fff8cfb797a238f4f0e73ee2813d)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Patrick Ohly 58866d6e9a archiver.bbclass: ignore unpack sub-directories in do_ar_original
Support for absolute paths in the "subdir" parameter was recently
added (bitbake rev: c3873346c6fa). The git fetcher has supported
absolute paths in "destsuffix" already before.

When the path is absolute as in destsuffix=${S}/foobar, the tmpdir
used by do_ar_original gets ignored, which breaks:
- source code archiving (tmpdir is empty)
- compilation due to race conditions (for example, ${S} getting
  modified by do_ar_original while do_compile runs)

To solve this, these parameters get removed from URLs before
instantiating the fetcher for them.

This is done unconditionally also for relative paths, because these
paths are not useful when archiving the original source (upstream
source does not have them, they only get used by the recipe during
compilation).

(From OE-Core rev: c27c464e267db3f4b08cbd966412d19b0e756d28)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Richard Purdie 5c8124df2e archiver: Improve debug output
Make the output from the task more informative about which directories
are being referenced.

(From OE-Core rev: 0e306a53c460302ec20192fc35930983781b7a2e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-13 20:58:41 +01:00
Richard Purdie 380004b855 archiver: Ensure sstate-inputdir directory is created
Without this, do_archive_sources will fail for the gcc tasks where there is
common source and the other tasks are not added as dependencies. The failure
happens when trying to restore these tasks from sstate.

To fix this ensure the sources directory is created as expected by the
sstate code.

[YOCTO #9433]

(From OE-Core rev: b3afe7d9bd25a943e947de3ec064ea245173c5a8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-12 22:50:21 +01:00
Richard Purdie 5602f64ab8 archiver: Fix ASSUME_PROVIDED issues
Currently the dependencies injected by this class for recipes in ASSUME_PROVIDED
e.g. tar-native or chrpath-native are ignored. We need to use their "replacement"
names, e.g. tar-replacement-native.

This avoids broken archives and sstate failures with these recipes.

(From OE-Core rev: 2279c6d20c2a33283ce9a8d1ef91a8acdad0a20e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-11 09:03:58 +01:00
Robert Yang 71db079bc5 archiver.bbclass: addtask do_deploy_archives_setscene
There was a do_deploy_archives_setscene, but no addtask.

(From OE-Core rev: 81db27c208468dc460e9d8f0063ad24b2b37dc97)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-30 21:24:02 +01:00
Mariano Lopez 9ee403b310 archiver.bbclass: Just archive gcc-source for all gcc recipes
It is pointless to archive several times the gcc source.
This change will archive gcc source once, for the gcc-source-{PV}
recipe.

[YOCTO #9327]

(From OE-Core rev: 2f53fb2ae561e2eb599682ba95ce83ad1b4b7ada)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28 15:55:50 +01:00
Mariano Lopez d7cf2c3230 archiver.bbclass: Fix tar name for git repositories
When archiving the original source, the git repositories have the name as
they are in the $DL_DIR plus the source revision; i.e.
"git.yoctoproject.org.linux-yocto-4.4.git.89419d8b90_dadb436904.tar.gz".
This change set the tar name to $PF.tar.gz instead, to have consistency with
the others archives created by the class.

(From OE-Core rev: 3f903cb767150e316337929d72559cad6931039a)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:17 +00:00
Mariano Lopez 2cb4cb7a6c archiver.bbclass: Fix gcc-source corner case
Bitbake couldn't add the task ar_configured when
trying to archive the configured source for
gcc-source-${PV} recipes. This is because the task
depended in the do_configure and this task doesn't
exist for gcc-source.

This fix allows to archive configured gcc-source recipe.

(From OE-Core rev: 5be5eae2e1630a151a9f5866d60325d439150ced)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:17 +00:00
Mariano Lopez c29eea0df8 archiver.bbclass: Fix use of ARCHIVER_WORKDIR and ARCHIVER_OUTDIR
Currently do_unpack_and_patch() and do_ar_configured() are using
the ARCHIVER_OUTDIR as the ARCHIVER_WORKDIR, this lead to have
duplicated files inside the tars when using the archiver class
for patched and configured source.

(From OE-Core rev: 09dfc99a813090043262529beb6d900900e983dc)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:17 +00:00
Mariano Lopez 8b7ee6ebeb archiver.bbclass: Don't expand python functions in dumpdata
Currently the dumpdata task expands python data in the datastore, in
some functions this causes a silent error and the task will fail.

The change also rewrite the function to make a bit clearer.

(From OE-Core rev: e3239ade430ff48e00dce47066abe8fcb990af61)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:17 +00:00
Maxin B. John a205c4ce1d bbclass: fix spelling mistakes
Fix some spelling mistakes in bbclass files

(From OE-Core rev: ed484c06f436eea62c5d0b1a2964f219f3e5cb61)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:27 +00:00
Jian Liu 4415dc5cdd archiver.bbclass: add bbappend when do_ar_recipe kernel and gcc packages
bbappend files are not included in the archiver during do_ar_recipe.
Find and put them into the tarball.

(From OE-Core rev: 5c84057de5b31c5d6d9abfcca3078bf766a21d88)

Signed-off-by: Jian Liu <jian.liu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:26 +00:00
Alejandro Hernandez 2f0ff3abb4 archiver.bbclass: fix previous issue regarding work-shared for linux-yocto
A previous patch intended to fix and improve the archiver class, and while it
did for gcc packages, with it some issues ended up being hidden, the kernel
tasks taken from kernel.bbclass and kernel-yocto.bbclass specifically expect the
kernel to use work-shared, which either ended up causing issues or wasting time
doing unnecessary work, this patch fixes these issues by performing the right
tasks within the archiver in the right order

[YOCTO #8378]

(From OE-Core rev: d643e43622eb3e43fbb2e21fa33580e2fcdf42be)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:26 +00:00
Alejandro Hernandez 92b26ad938 archiver.bbclass: Fixes and improves archiver class for kernel and gcc packages
gcc packages use a shared source directory, this causes an issue since the archiver will
try to patch the same source several times (one for each gcc package), producing an error,
the archiver class used stamp-base to check this, nonetheless our gcc packages no longer
use stamp-base, they use gcc-shared instead, which is what broke this functionality.
This patch adds a check to see whether or not the source should be patched,
avoiding patching the source when it shouldn't.

Also, we dont need to create multiple identical tarballs for all gcc packages,
this patch fixes this and creates a single source tarball for gcc.

When requesting patched sources, a race condition is created for linux-yocto tasks,
unpack_and_patch is executed along with kernel_configme, which most of the time
causes errors during configure, since kernel_configme task is specific to the kernel,
simply modifying the tasks order by creating a dependency to kernel_configme was impossible,
causing errors on all other packages that didnt use kernel_configme, this is fixed by
creating a special case for the kernel, adding tasks with correct dependencies,
avoiding the race condition and behaving the way it should for all other packages as well.

[YOCTO #8378]

(From OE-Core rev: aecaa0e8739db1c228a6db78225a717d9f348a5b)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-21 22:59:27 +01:00
Richard Purdie 99fc78653a archiver: stamp-base is dead, remove it
stamp-base was only ever used by the shared workdir code in gcc. This
turned out to be problematic and has been replaced by other approaches
which don't need specialist bitbake knowledge.

stamp-base will likely get removed from bitbake but for now, remove it
from archiver to simplfy the code since gcc no longer uses it.

This stops people getting confused by the obsolete code paths which I'm
getting a lot of questions about.

(From OE-Core rev: 4b9f70f03cbefe9db758500e3ad89f7a8ff8226e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:31 +01:00
Clemens Lang 76d7e8e9c9 archiver.bbclass: Run deploy_archives in $WORKDIR
In recipes that are exempt from source code archiving due to
COPYLEFT_LICENSE_EXCLUDE, do_deploy_archives does not have a transitive
dependency on do_unpack. Given enough parallelism, this means
do_deploy_archives can run at the same time or before do_unpack.

Because do_deploy_archives did not specify a working directory, its
working directory was ${B}, which defaults to ${S}, which may be set by
a recipe to a directory that is created by do_unpack.

In this case, do_deploy_archives can fail because do_unpack deletes and
re-creates the directory and do_deploy_archives cannot change into the
non-existent directory. Avoid this problem by explicitly specifying
a working directory for do_deploy_archives (and for
do_deploy_all_archives as well for good measure).

(From OE-Core rev: e22685ff11af6d54c939aa8f327a0aaa1557fbbc)

Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:36 +01:00
Patrick Ohly 95083b2699 archiver.bbclass: add do_deploy_all_archives
When working specifically on source archiving, it is useful
to trigger that for all recipes required by something like an
image recipe, without actually having to build that.

"bitbake -c deploy_all_archives <target>" does that now.

(From OE-Core rev: 30b109729a81097cc6cfa65148e0e9ae1a564d2c)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:41 +01:00
Mariano Lopez ae9102bda3 copyleft_filter.bbclass: Allow to filter on name
The archiver uses a license based filter to provide the source code.
This patch allows to search on name based on two new variables (COPYLEFT_PN_INCLUDE,
COPYLEFT_PN_EXCLUDE). Both variables are empty by default.
The filter by name has higher priority than the license filter.

[YOCTO # 6929]

(From OE-Core rev: 04066239e9cd6a8461fb2c18e826289469ac1240)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:46:57 +01:00
Joe Slater 1a0485040c archiver: fix truncation of src_rev
In trying to eliminate AUTOINC+ from revision strings,
we accidently truncated the strings to almost guarantee
information from SRCREV_FORMAT, when supplied, would be
lost.  So, we now only delete any AUTOINC+'s from the string.

(From OE-Core rev: 83c6930cdfac5a7759c4786172a5c70226e6adc4)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-24 17:36:15 +01:00
Joe Slater a9b080405e archiver.bbclass: add revision to git tarfile name
When archiving original source, insert the first 10
characters of srcrev, after stripping off any
AUTOINC+, into the filename for tarfiles created
from directories.

(From OE-Core rev: 36726049a6a452f85d7cc849d57ad6af05d6d3ea)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:30 +01:00
Jian Liu 181bcbe2c7 archiver: delete the tail slash in directory name
If directory names in SRC_URI ended with "/", function
do_ar_original() in layers/oe-core/meta/classes/archiver.bbclass
will generate a tar file whose name is ".tar.gz".
So delete the "/" at the tail of the directory names before use the names.

(From OE-Core rev: a539e823d002fefe129e3045f893d1237fadb87f)

Signed-off-by: Jian Liu <jian.liu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23 09:31:41 +01:00
Hongxu Jia f2a104d777 archiver: create dir 'B' explicitly while WORKDIR changed
In the do_unpack_and_patch task of archiver, the changed 'WORKDIR' also
casued 'B' changed, create dir 'B' for the possibly requiring of the
tasks which executed in do_unpack_and_patch task.

Such as cut-ecgl's do_patch required 'B' existed:
...
| cp: target 'tmp/work/x86_64-wrs-linux/cut-ecgl/1.0-r0/archiver-work
/cut-ecgl-1.0' is not a directory
...
| ERROR: Function failed: do_patch (log file is located at tmp/work/
x86_64-wrs-linux/cut-ecgl/1.0-r0/temp/do_unpack_and_patch/
log.do_unpack_and_patch.11886)
...

The 'B' dir is implicitly created at the task executing time while the
task tag 'dirs' is not assigned. In the above cut-ecgl example, the 'B'
was created at the wrl_buildlink executing time which is the prefuncs of
task do_unpack. So the following do_patch could use 'B' correctly. But
wrl_buildlink is unnecessary and not invoked in the do_unpack_and_patch
task.

(From OE-Core rev: 8baefb49d0bf9d3dd757d9b2359e0a9f4f33dd60)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-17 08:59:04 +01:00
Robert Yang 21169c3042 archiver.bbclass: emit patch series files for original src
Emit patch series files for original src so that the user knows how to
apply the patch orderly.

[YOCTO #5113]

(From OE-Core rev: 053631bc3cf7c7c2d090decaa3b5e5690963e64a)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-25 09:55:35 +00:00
Robert Yang 4a91e1449b archiver.bbclass: make it can filter the license
* Filter the license (default: no), the recipe whose license in
  COPYLEFT_LICENSE_INCLUDE will be included, and in
  COPYLEFT_LICENSE_EXCLUDE will be excluded.

* The user can set the recipe type that would be archived (native,
  target, and so on), deafult to all.

The copyleft_filter.bbclass is come from copyleft_compliance.bbclass,
which is used by both copyleft_compliance.bbclass and archiver.bbclass.

[YOCTO #5740]

(From OE-Core rev: 0e798d5cbcf585535e19633828dc540a282261fc)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-25 09:55:35 +00:00
Robert Yang 1f44904dae archiver.bbclass: move a few code to copyleft_compliance.bbclass
Move the code which is only used by copyleft_compliance.bbclass from
archiver.bbclassc, and remove the "inherit archiver" from
copyleft_compliance.bbclass.

The archiver.bbclass is used for archiving various types of sources, but
the copyleft_compliance.bbclass is used for analysing the license, they
don't have much relationships.

[YOCTO #4986]
[YOCTO #5113]

(From OE-Core rev: 578830fe2ff279ea620916ea711b80dc1b29a275)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 17:15:27 +00:00
Robert Yang cbcf5b2198 archiver.bbclass: refactor it
The archiver didn't work, and there were a few problems, for example:
1) There was no src_dir.org (or orig), but the diff command still use it
2) There were a few duplicated code
3) It didn't archive the source for the native or gcc
4) The work flow is not very well
5) The "subprocess.call('fakeroot cp xxxx'" should be removed
6) And others ...

So that we have to refactor it, the benefits are:
1) Fix the problems and make it work well.
2) Reduce more than 300 lines
3) Make it easy to use.

Hre are the explanation about the bbclass:
This bbclass is used for creating archive for:
1) original (or unpacked) source: ARCHIVER_MODE[src] = "original"
2) patched source: ARCHIVER_MODE[src] = "patched" (default)
3) configured source: ARCHIVER_MODE[src] = "configured"
4) The patches between do_unpack and do_patch:
   ARCHIVER_MODE[diff] = "1"
   And you can set the one that you'd like to exclude from the diff:
   ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
5) The environment data, similar to 'bitbake -e recipe':
   ARCHIVER_MODE[dumpdata] = "1"
6) The recipe (.bb and .inc): ARCHIVER_MODE[recipe] = "1"

All of the above can be packed into a .src.rpm package: (when PACKAGES
!= "")
ARCHIVER_MODE[srpm] = "1"

[YOCTO #4986]
[YOCTO #5113]

(From OE-Core rev: e5b20199ddddfa2146dc112c0a81f3fd292258e5)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 17:15:26 +00:00
Robert Yang f0714d1128 classes/archive*.bbclass: remove archive-*-source.bbclass
Nearly all of the codes in the following 3 files are the same, we can
move the code to archiver.bbclass and remove them:

  archive-configured-source.bbclass
  archive-original-source.bbclass
  archive-patched-source.bbclass

[YOCTO #5113]

(From OE-Core rev: d2d3428a0fc746e56c0a0046bd12a393dedb4dda)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 17:15:26 +00:00
Richard Purdie 554c892ccf meta: Don't use deprecated bitbake API
These have been deprecated for a long time, convert the remaining
references to the correct modules and prepare for removal of the
compatibility support from bitbake.

(From OE-Core rev: 6a39835af2b2b3c7797fe05479341d71a3f3aaf6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01 15:51:42 +01:00
Richard Purdie 93ec1e347c classes: Remove references to _remove in function names since this may become a bitbake keyword
There is a good chance we might want to support a bitbake operator
"_remove" which works in a similar way to _append and _prepend. As
such, we can't use those keywords in function or variable names.

(From OE-Core rev: 491fde8cd3fd493f9fec2fd434fe1be547f66148)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:45 +01:00
Kevin Strasser e1baa0de28 archiver.bbclass: check if package contains a copyleft license
The copyleft filter is only excluding packages that contain a
closed source license. This is because oe.license.is_included()
returns a boolean value that indicates if the license is excluded,
and a string that contains the matched included licenses. If the
string is empty it indicates that no licenses were matched.

Reject packages that do not contain a copyleft license.

[YOCTO 4630]

(From OE-Core rev: 3d0f9ee3d2fcce331d35467d5965ff44b825427f)

Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-17 16:45:35 +01:00
Kevin Strasser 3e4655d951 archiver: fix srpm archiving build errors
srpm archiving doesn't need to be handled as a different case
when deciding what archive tasks to add.

When srpm is selected as the archiving type, the scripts and logs
archive staging directory ${WORKDIR}/script-logs is cleaned, and
its contents moved out to ${WORKDIR}.

Now that we are including ${WORKDIR}/script-logs in sstate-inputdirs,
the directory must be preserved.

[YOCTO #4032]

(From OE-Core rev: 0c80286a3383b436a0a63a0b00eb357dd9dea4fb)

Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-03 17:01:13 +01:00
Kevin Strasser 52026492c6 archiver: fix archive filtering behavior
With the addition of sstate, ensure that archiving tasks are only
added to the build if they produce output in the directory specified
by the 'sstate-inputdirs' flag.

Move calls to 'tar_filter' and 'not_tarball' out to
archive-*-source.bbclass in order to filter out packages before their
archiving tasks are added to the build.

Additionally, negate the return value of copyleft_should_include in
tar_filter, so that packages that do not pass are in turn filtered out.

(From OE-Core rev: 392562a21d9f2deb6fe6f8bb5378b09f4c5918d4)

Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18 13:18:21 +00:00
Muhammad Shakeel 2b1afa10bc archiver class: Use tasks with sstate instead of pre/post funcs
* Add tasks to move sources, script/logs and diff/env files in
  deploy directory.
* Enable SSTATE for 'do_archive_scripts_logs' task
* Enable SSTATE for 'do_dumpdata_create_diff_gz' task
* SSTATE is not used for sources/patches archiver task because source
  archive package can result into a very large file. It will be an
  unnecessary overhead to keep sources in DL_DIR and cached-binaries.
* If 'SOURCE_ARCHIVE_PACKAGE_TYPE' is 'srpm' then use pre/post functions
  because in this case we do not want to use tasks to move sources/logs
  in DEPLOY_DIR. 'do_package_write_rpm' is responsible for handling
  archiver packages.

[YOCTO #3449]

(From OE-Core rev: 959e2ae23ccbc6955a28996d4538e457cd8cfa5e)

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-28 23:15:45 +00:00
Marcin Juszkiewicz bc5bf6f0a0 archiver.bbclass: DISTRO is not required variable so deal with it
(From OE-Core rev: 3e7f411e6eb428f6d49a6f1a396e70a2bd1ceadc)

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-24 15:12:37 +00:00
Paul Eggleton 272cb74d70 Rename task to packagegroup
"Package group" is a much more appropriate name for these than task,
since we use the word task to describe units of work executed by
BitBake.

(From OE-Core rev: 424dcf7046e4ad09dcc664eb1992201195247fcf)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-04 12:52:55 +01:00
Robert Yang 44b8c1bb30 archiver.bbclass: fix the remove error
* The "tar-package" is used for saving the "Source" list for rpmbuild,
  there is no such a file when "ARCHIVER_MODE[type] ?= srpm", and there
  would be errors, it hadn't happen before was becuase that the remove
  function didn't work. Let the "rpmbuild --rmsource" to remove the
  Sources, and the remove function will just remove the tar-package file.

* Remove several unwanted "try ... exception" sentences, let the error
  raise rather than ignore them when the error happens.

* Remove several un-needed code.

[YOCTO #2619]

(From OE-Core rev: 6ac3e8be0307ecaea5e92f8bda94f1cd2193a47a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-29 16:02:09 -07:00
Robert Yang 436211f052 archiver.bbclass: remove the "upper()" function
The configuration value from the conf file is lower case, e.g. srpm,
tar, so there is no reason to use the upper case which makes things
complicated.

[YOCTO #2619]

(From OE-Core rev: 036a2502689092bb278b929f6e8ef2a119c1cf35)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-29 16:02:08 -07:00
Robert Yang 3883f82926 archiver.bbclass: fix the fakeroot and other issues
* Fix the fakeroot issue
  The archiver.bbclass is used for archiving sources, patches, and logs,
  it uses the "rpmbuild -bs" from the package_rpm.bbclass to generate the
  .src.rpm, but it didn't work (it's not easy to explain it clearly):

  Reason:
  - It directly used the "fakeroot" command, we don't have such a
    command in native tools, so it would use the fakeroot from the host,
    and it would fail when there is no fakeroot on the host.

  - The "rpmbuild -bs" doesn't need to work under root, but it is in the
    function do_package_write_rpm which is running under fakeroot, and
    "rpmbuild" needs to know the source file's user/group name, the source
    file is the tarball which is created by the postfuncs of do_unpack
    or do_patch which doesn't use the fakeroot, so the created file's
    owner would be the real user, e.g.: robert, but there is no such a
    user under our native tools' fakeroot(pseudo), then the rpmbuild would
    fail. It worked when use the host's fakeroot in the past was because
    that the host's fakeroot knows the users on the host.

  Fix:
  - Remove the incorrect "fakeroot".

  - Change the source file's owner to root.root under fakeroot will fix the
    problem.

* Other fixes:
  - The typo: "do_remove_taball -> do_remove_tarball" which will cause the
    tarball is not removed.

  - Add the _sourcedir defination to the rpmbuild command since the the
    SOURCES would be added to the specfile when archiver.bbclass is
    inherited, otherwise there would be errors when "rpmbuild -bb", though
    the build is OK. It only added the defination to "rpmbuild -bs",
    didn't add to "rpmbuild -bb".

[YOCTO #2619]

(From OE-Core rev: ac152f277fdff256def01af4268215a05685a0f7)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-29 16:02:08 -07:00
Robert Yang 2ba95cc79e archiver.bbclass: fix the coding style
* Make the comment line under 80 characters.
* Use the triple double quotes for the docstring.
* Add a whitespace behind the comma (,).
* Other minor fixes.

[YOCTO #2619]

(From OE-Core rev: 885a95992abe11ebef7a8e4363e6002ee80403bf)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-29 16:02:07 -07:00
Robert Yang c96f6ee659 archiver.bbclass: indent fixes
Several fixes:
* It uses mixed tab and whitespace as the indent in one function,
  Fix them to use "4 spaces" as the indent.

* Remove the unwanted blank, for example, more than one blank lines
  appeared together.

* Remove the tail whitespace.

[YOCTO #2619]

(From OE-Core rev: 5eacbcdf306d9e743164a1563559cd24eb5fffe0)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-29 16:02:07 -07:00
Richard Purdie 73cf0335c4 Remove a number of unneeded import os/bb calls
The bb and os modules are always imported so having these extra import calls
are a waste of space/execution time. They also set a bad example for people
copy and pasting code so clean them up.

(From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 12:24:50 +01:00
Xiaofeng Yan c3d8b100a2 archiver.bbclass: Add the function of filtering packages
This function can miss packages whose license is in
"COPYLEFT_LICENSE_EXCLUDE" and tarball packages with license in
"COPYLEFT_LICENSE_INCLUDE".

[YOCTO #2473]

(From OE-Core rev: 4800bed394ebd7fb50552a96d6a5f83d98fe790f)

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:26:44 +01:00
Xiaofeng Yan 9a519998f4 archiver.bbclass: Reduce some duplication for function get_licenses
The content to modify this bbclass is as follow:
- Use the existing functions to get license as a directory instead of
  rewriting it for avoiding code duplication.
- Use SPDXLICENSEMAP to map licenses

[YOCTO #2473]

(From OE-Core rev: 31bee6e7b0a23efc1555ab739ef10041803d5bb1)

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-08 11:43:22 +01:00
Xiaofeng Yan 34f819e22e archiver.bbclass: Improve the usability for the archiver classes
The usability of the archiver classes can be improved, beyond the
simple addition of default values for the variables. A user could
well inherit just archiver rather than the individual useful classes,
and not realize it will do nothing.

[YOCTO #2472]

(From OE-Core rev: ce91f495e0c4ef3bf53ee8b2ea570061da38e14f)

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-05 22:56:32 +01:00