Commit Graph

38 Commits

Author SHA1 Message Date
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
Constantin Musca ada2c27f75 patch.bbclass: increase security
- Use mkdtemp for generating temp dir names
- Use bb.utils.remove for removing temp dirs
- Add comment for explaining the "patch" workaround

[YOCTO #3070]

(From OE-Core rev: fbe9fc4d5ece1e66b03b4c4bce9b7ffad3b5b138)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-14 17:12:43 +01:00
Constantin Musca 2a0d7aded8 patch.bbclass: Use one TMPDIR per patching process
We must use one TMPDIR per process (/tmp/${PID}) so that the patching
processes don't generate the same temp file name (the "patch" program
uses the TMPDIR environment variable for deciding where to create the
temp files).

[YOCTO #3070]

(From OE-Core rev: 16dbf505c4fdd9fe1820d950ab05c8ea99ad7505)

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-14 09:50:24 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Saul Wold b4d6cedcc3 quilt: move empty quiltrc to native sysconfdir
patch.bbclass orignally pointed at /usr/bin/quiltrc for an empty
version to ensure that no user setting were picked up, change this
to /etc/quiltrc in the Native sysroot since we now have a native
sysconfdir.

Make sure that the quiltrc is actually installed in the Native
sysconfdir, not the target, so fix this after the recipe split.

(From OE-Core rev: 1af73900cea82e63fb0f94e6f057144f723146ec)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-26 10:05:11 +01:00
Bruce Ashfield 3b1ad76c87 classes/patch: optionally return non-patch sources
commit:

  patch.bbclass: abstract out logic that determines patches to apply

gives the ability for other clases to emit series files for use outside
of a build system, or even within the build system. There are sometimes
elements on the SRC_URI that while not directly applicable to patching,
can be related to patching the package. For example, the yocto kernel
class would like to know about these other source items on the SRC_URI
to locate out of tree kernel features.

This change keeps the default behaviour of returning patches, but adds the
ability to request that non-patch results be returned.  Additional filtering
within the non-patch category, is left up to the caller of the routine.

(From OE-Core rev: 41e92923a0b2fe047ecaa9f9ffb564d6069f784f)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-03 17:22:12 +00:00
Paul Eggleton 11e5d7bc81 classes/patch: avoid backtrace when patch does not apply
We don't need to see a Python stack backtrace when a patch does not
apply, just the error output from patch, so trap these kinds of errors
and ensure that we display the message and fail the task and nothing
else.

Fixes [YOCTO #1143]

(From OE-Core rev: ce6c80a1e68c2af0b4b5fa27582ad9c9f119e5c1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-19 14:34:34 +00:00
Richard Purdie 8a98af2bb5 patch.bbclass: Ensure the DATE and SRCDATE variable exclusions apply to the correct function
People have noticed that sstate is now getting invalidated very readily. The
issue is that the code using these variables was factored into a new function
but the variable exclusion was not. This patch moves the variable exclusion
to the correct place allowing the sstate checksums to work correctly.

(From OE-Core rev: bd047935305c872b565f30b46c94b7077e5fb3a2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-13 16:56:36 +00:00
Christopher Larson 5b337aecde patch.bbclass: abstract out logic that determines patches to apply
This is needed by the copyleft_compliance class, so it can emit series files
for the patches, which greatly increases their usefulness to a user trying to
reconstruct the sources outside of OE.

(From OE-Core rev: 290c7239c21e477bb78b88d92a5b8a7de9142310)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-03 12:14:25 +00:00
Matthew McClintock 6c7108fc91 patch.bbclass: Add PATCHRESOLVE to excluded vars for generating sstate-cache
The method of resolving the patch should not effect the sstate-cache
signature.

(From OE-Core rev: b64cbe0b511de8d8943ce34cbb4901239d9f0cb0)

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-24 22:12:04 +00:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Richard Purdie 9d1f10ed01 patch: Convert to use oe_terminal
Unfortunately we can't access oe_terminal directly from patch.py
so we have to pass in the correct terminal function pointer.

[YOCTO #1587]

(From OE-Core rev: 9e0a21dda24f285a1c4878488e887485a749f3f2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-04 17:05:32 +00:00
Tom Rini 4febd376ed patch.bbclass: allow importing patches into other dirs
This is taken from openembedded.master:
commit 9d0d70da60ca8ef278916f442125d41161846f38
Author: Chris Larson <chris_larson@mentor.com>
Date:   Mon Aug 23 13:03:55 2010 -0400

    patch: allow importing patches into other dirs

    Use the 'patchdir' flag.  If relative, it's assumed to be relative to ${S}.
    It creates a patchset class per patch directory, so for quilt this results i
    multiple .pc/patches directories to manage each of the patchsets.

    (From OE-Core rev: 01e4609ee8441c8212725fd062782313caae0708)

Signed-off-by: Chris Larson <chris_larson@mentor.com>

Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-04 14:09:59 +01:00
Richard Purdie 984e90f4d7 meta/classes: Update classes to use new fetcher API
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Richard Purdie a270c0e5fa patch.bbclass: Move vardepsexclude flag to be along side the function using the variable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-30 12:22:52 +00:00
Joshua Lock 09536a7592 patch.bbclass: Merge patch enhancements from OE by Chris Larson
Chris made some interesting changes to the patch handling in OE. Firstly the
patch and pnum parameters have been renamed, to better reflect their function,
to apply and striplevel. The apply parameter now takes either yes or no as its
value.

Therefore a patch line would be changed from:
file://some.patch;patch=1;pnum=2
to:
file://some.patch;apply=yes;striplevel=2

Secondly the apply parameter is inferred if not defined. Entries in SRC_URI
with diff or patch filename extensions will be automatically applied as patches
if the apply parameter is not set to no (or an unknown value).

Note: We have disabled the warnings when using the old style parameters for now

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-01 15:17:12 +01:00
Joshua Lock e7fa3529f3 Update classes to use lib/oe
Adapt modifications from upstream to make Poky classes use lib/oe for the
common Python functionality.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-06 12:53:16 +01:00
Richard Purdie b772c8cde5 bitbake.conf/base.bbclass: Rename the staging directory to sysroots and the populate_staging task to populate_sysroot
This change makes the purpose of the staging directory more obvious and
the taskname more true to what it now actually does.

The layout version number is increased due to the change in layout
but code to convert existing directories and insert a symlink for
backwards compatibility is included.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:42 +00:00
Richard Purdie c54117458a classes: Remove and sanitise import statements
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Richard Purdie 43fa53c9f3 patch.bbclass: Merge in git resolver changes from OE.dev. Catch all exceptions rather than print horrid backtraces
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-09-03 22:22:10 +01:00
Richard Purdie e2580df891 patch.bbclass: Fix up the environment for the patch resolution code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-07-02 14:36:56 +01:00
Richard Purdie b93a3d1d91 patch.bbclass: Sync with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-07-02 12:38:35 +01:00
Richard Purdie 96f56b2603 patch.bbclass: Allow a patch to be applied or not applied against a specific srcrev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-06-22 16:00:28 +01:00
Richard Purdie 9909e989d9 patch.bbclass: Make it possibe to override the patch dependency
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4489 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-18 16:22:21 +00:00
Richard Purdie 4df629aa49 patch.bbclass: Add support for maxrev and minrev
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2350 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-03 14:29:07 +00:00
Richard Purdie 5d2fcf3a2f patch.bbclass: Set default patch resolver to noop
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1711 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-05-11 11:17:32 +00:00
Richard Purdie 0443d80b50 patch.bbclass: Specify a quiltrc file so users settings don't interfere with correct operation
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1509 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-04-14 11:07:33 +00:00
Richard Purdie 409335beae classes: Rework core dependencies to work properly at the task level
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1427 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-04-03 11:31:02 +00:00
Richard Purdie 3a8695033f patch.bbclass: Fix force options for recent quilt versions
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1122 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-01-08 21:04:27 +00:00
Chris Larson 002f491523 patch.bbclass: fix bug where it failed to detect that the user did not modify the patches at all, add note about pressing ctrl+d to exit the resolver shell.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@822 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-10-25 18:19:39 +00:00
Chris Larson 81971a2766 patch.bbclass: sync with upstream oe.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@713 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-09-15 07:54:58 +00:00
Chris Larson 5027d8f8f2 patch.bbclass: updates from upstream oe.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@691 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-09-01 08:36:17 +00:00
Chris Larson 874a642961 Patch.bbclass: add NOOPResolver class for use in unattended builds, which does no actual patch resolution, simply passing the failure on up. Set PATCHRESOLVE='noop' to make use of it. Also pulls in the workaround for quilt's upward searching for a 'patches' dir from upstream oe.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@680 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-30 07:25:59 +00:00
Chris Larson ecb32bdee7 Patch failure handling updates, added a 'patch' concrete class, so we can apply patches to quilt-native itself.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@670 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-28 20:36:36 +00:00
Chris Larson d717d4f196 Patch.bbclass: fix bug resulting in a failure to md5 the local path.. it broke when localpath() included variable references.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@662 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-27 22:29:46 +00:00
Chris Larson 056b43353e Fix the patch.bbclass error handling in a couple of the error paths by changing the semantics of the PatchError exception.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@627 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-23 08:50:26 +00:00
Chris Larson 7aa52d7fd9 Clean up the way patch.bbclass's runcmd handles the directory not existing.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@624 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-22 08:58:02 +00:00
Chris Larson fe7c8c26ed Changes for ticket:8, with fixes for the bugs reported by Richard.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@622 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-21 00:50:19 +00:00