aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/patch.bbclass
AgeCommit message (Collapse)Author
2017-02-07classes/patch: switch to new bb.build.tasksbetween() functionPaul Eggleton
A generic version of the code to work out the tasks between two tasks (based on the code here) has been added to bb.build, so use that instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVarFlag callsJoshua Lock
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\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16meta: remove True option to getVar callsJoshua Lock
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\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14classes/patch: move several functions to oe.patchPaul Eggleton
Move patch_path(), src_patches() and should_apply() to oe.patch, making them easier to call from elsewhere (particularly across the UI/server boundary). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14classes/patch: move in logic to commit for additional tasksPaul Eggleton
If PATCHTOOL is "git", and PATCH_COMMIT_FUNCTIONS is set to "1", for additional tasks between do_unpack and do_patch, make a git commit. This logic was previously implemented in devtool itself, but it makes more sense for it to be implemented in the patch class since that's where the rest of the logic is for this (or in lib/oe/patch.py). It also makes it possible for this to work with tinfoil2. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-23devtool: update-recipe: fix handling of compressed local patchesPaul Eggleton
It is possible to use gzip or bzip2 to compress patches and still refer to them in compressed form in the SRC_URI value within a recipe. If you run "devtool modify" on such a recipe, make changes to the commit for the patch and then run devtool update-recipe, we need to correctly associate the commit back to the compressed patch file and re-compress the patch, neither of which we were doing previously. Additionally, add an oe-selftest test to ensure this doesn't regress in future. Fixes [YOCTO #8278]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-03lib/oe/patch: commit with a dummy user/email when PATCHTOOL=gitPaul Eggleton
When using PATCHTOOL = "git", the user of the system is not really the committer - it's the build system itself. Thus, specify "dummy" values for username and email instead of using the user's configured values. Various parts of the devtool code that need to make commits have also been updated to use the same logic. This allows PATCHTOOL = "git" and devtool to be used on systems where git user.name / user.email has not been set (on versions of git where it doesn't default a value under this circumstance). If you want to return to the old behaviour where the externally configured user name / email are used, set the following in your local.conf: PATCH_GIT_USER_NAME = "" PATCH_GIT_USER_EMAIL = "" Fixes [YOCTO #8703]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05patch.bbclass: remove useless path assignmentAlex Franco
A path variable is assigned the value of PATH from the environment, before the PATH is set on the environemnt from the value of PATH in the bb datastore. This seems to be an unnecessary leftover. [YOCTO #8543] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-29patch.bbclass: unset TMPDIR after useRoss Burton
GNU Patch < 2.6.1 has a race condition so we create a per-instance TMPDIR to avoid this. This was implemented by setting os.environ[TMPDIR] but at the end of do_patch the temporary directory is deleted but TMPDIR is not unset. In general this doesn't cause a problem but if do_patch is embedded in a larger function then TMPDIR is set to a directory that doesn't exist. Avoid this by removing TMPDIR from os.environ when the directory is deleted. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01meta: Don't use deprecated bitbake APIRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-14patch.bbclass: increase securityConstantin Musca
- Use mkdtemp for generating temp dir names - Use bb.utils.remove for removing temp dirs - Add comment for explaining the "patch" workaround [YOCTO #3070] Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-14patch.bbclass: Use one TMPDIR per patching processConstantin Musca
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] Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-24quilt: move empty quiltrc to native sysconfdirSaul Wold
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. Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-02-03classes/patch: optionally return non-patch sourcesBruce Ashfield
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. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-19classes/patch: avoid backtrace when patch does not applyPaul Eggleton
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] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-13patch.bbclass: Ensure the DATE and SRCDATE variable exclusions apply to the ↵Richard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-02patch.bbclass: abstract out logic that determines patches to applyChristopher Larson
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. Signed-off-by: Christopher Larson <chris_larson@mentor.com>
2011-11-24patch.bbclass: Add PATCHRESOLVE to excluded vars for generating sstate-cacheMatthew McClintock
The method of resolving the patch should not effect the sstate-cache signature. Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-11-10Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie
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 *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-04patch: Convert to use oe_terminalRichard Purdie
Unfortunately we can't access oe_terminal directly from patch.py so we have to pass in the correct terminal function pointer. [YOCTO #1587] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-04patch.bbclass: allow importing patches into other dirsTom Rini
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. Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Tom Rini <tom_rini@mentor.com>
2011-02-07meta/classes: Update classes to use new fetcher APIRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-12-30patch.bbclass: Move vardepsexclude flag to be along side the function using ↵Richard Purdie
the variable Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-01patch.bbclass: Merge patch enhancements from OE by Chris LarsonJoshua Lock
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-05-06Update classes to use lib/oeJoshua Lock
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>
2009-11-13bitbake.conf/base.bbclass: Rename the staging directory to sysroots and the ↵Richard Purdie
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-13classes: Remove and sanitise import statementsRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-09-03patch.bbclass: Merge in git resolver changes from OE.dev. Catch all ↵Richard Purdie
exceptions rather than print horrid backtraces Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-07-02patch.bbclass: Fix up the environment for the patch resolution codeRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-07-02patch.bbclass: Sync with OE.devRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-06-22patch.bbclass: Allow a patch to be applied or not applied against a specific ↵Richard Purdie
srcrev Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2008-05-18patch.bbclass: Make it possibe to override the patch dependencyRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4489 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-03patch.bbclass: Add support for maxrev and minrevRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2350 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-05-11patch.bbclass: Set default patch resolver to noopRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1711 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-04-14patch.bbclass: Specify a quiltrc file so users settings don't interfere with ↵Richard Purdie
correct operation git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1509 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-04-03classes: Rework core dependencies to work properly at the task levelRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1427 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-01-08patch.bbclass: Fix force options for recent quilt versionsRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1122 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-10-25patch.bbclass: fix bug where it failed to detect that the user did not ↵Chris Larson
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-09-15patch.bbclass: sync with upstream oe.Chris Larson
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@713 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-09-01patch.bbclass: updates from upstream oe.Chris Larson
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@691 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-30Patch.bbclass: add NOOPResolver class for use in unattended builds, which ↵Chris Larson
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-28Patch failure handling updates, added a 'patch' concrete class, so we can ↵Chris Larson
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-27Patch.bbclass: fix bug resulting in a failure to md5 the local path.. it ↵Chris Larson
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-23Fix the patch.bbclass error handling in a couple of the error paths by ↵Chris Larson
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-22Clean up the way patch.bbclass's runcmd handles the directory not existing.Chris Larson
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@624 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-21Changes for ticket:8, with fixes for the bugs reported by Richard.Chris Larson
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@622 311d38ba-8fff-0310-9ca6-ca027cbcb966