poky/meta/lib/oe
Alexander Kanavin cc97bc0812 lib/oe/patch.py: add a warning if patch context was ignored
Ignoring patch context increases the chances of patches being
applied incorrectly. Depending on what code is being patched, this can go
completely unnoticed and create subtle bugs, sometimes with security implications.

Please see here for a specific example:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10450

On the other hand, we cannot simply force all patch context to match exactly:
doing this would break a lot of recipes suddenly, across all layers.

So let's try a softer approach: issue a warning, and gently update
patches over a longer span of time. When most of the warnings are eliminated,
we can start enforcing a strict patch application policy.

I do understand that this patch creates a lot of warnings all of a sudden, however
I believe the problem does need to be addressed. All of oe-core recipes have their
context already fixed.

Sample warning:

WARNING: vulkan-1.0.61.1-r0 do_patch:
Some of the context lines in patches were ignored. This can lead to incorrectly applied patches.
The context lines in the patches can be updated with devtool:

    devtool modify <recipe>
    devtool finish --force-patch-refresh <recipe> <layer_path>

Then the updated patches and the source tree (in devtool's workspace)
should be reviewed to make sure the patches apply in the correct place
and don't introduce duplicate lines (which can, and does happen
when some of the context is ignored).
Details:
Applying patch demos-Don-t-build-tri-or-cube.patch
patching file demos/CMakeLists.txt
Hunk #1 succeeded at 63 (offset 2 lines).
Hunk #2 succeeded at 76 with fuzz 1 (offset 2 lines).

[YOCTO #10450]

(From OE-Core rev: 5133fd46bccf14e21680f8d94e952914edccb113)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-15 06:27:18 -07:00
..
__init__.py lib/oe: turn oe into a namespace package 2014-03-17 14:01:41 +00:00
buildhistory_analysis.py buildhistory: remove duplicate renames 2018-03-08 10:39:32 -08:00
cachedpath.py cachedpath.py: global name 'error' is not defined 2013-05-15 19:27:11 +03:00
classextend.py meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
classutils.py classutils.py: deterministic sorting 2017-04-11 18:10:17 +01:00
copy_buildsystem.py oe/copy_buildsystem.py: make sure layer exists 2018-01-06 22:32:22 +00:00
data.py meta: add search, replace strings to export2json 2017-04-20 07:55:26 +01:00
distro_check.py lib/oe/distro_check: drop Mandriva from create_distro_packages_list() 2017-06-28 15:52:16 +01:00
gpg_sign.py gnupg: use native version for signing, rather than one provided by host 2018-01-11 10:26:07 +00:00
license.py license.py: Correct selection of licenses in is_included() 2017-10-07 23:20:39 +01:00
lsb.py oe.lsb: add get_os_release() 2017-05-16 14:08:28 +01:00
maketype.py classes/lib: Complete transition to python3 2016-06-02 08:24:01 +01:00
manifest.py manifest.py: sort package list 2018-01-11 10:26:07 +00:00
package_manager.py meta/lib/oe/package_manager.py: warn about failing scriptlets for all package types 2018-03-15 06:27:18 -07:00
package.py lib/oe/package: Improve filedeprunner subprocess handling 2017-09-02 00:52:10 +01:00
packagedata.py meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
packagegroup.py meta: remove True option to getVarFlag calls 2016-12-16 10:23:23 +00:00
patch.py lib/oe/patch.py: add a warning if patch context was ignored 2018-03-15 06:27:18 -07:00
path.py lib/oe/path: implement is_path_parent() 2018-03-01 22:13:56 +00:00
prservice.py meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
qa.py meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
recipeutils.py lib/oe/recipeutils: add .txz extension to archive list 2018-03-01 22:13:56 +00:00
rootfs.py rootfs.py: change the notice about deferring scripts to first boot from warning to a note 2018-01-30 11:50:12 +00:00
sdk.py sdk: only install locales if we're using glibc 2018-03-06 06:19:18 -08:00
sstatesig.py sstatesig: Move hardcoded native tools 2018-03-01 22:13:56 +00:00
terminal.py lib/oe/terminal.py: use an absolute path to execute oe-gnome-terminal-phonehome 2017-11-08 22:24:02 +00:00
types.py classes/lib: Complete transition to python3 2016-06-02 08:24:01 +01:00
useradd.py useradd: Create lib/oe/useradd function library 2017-05-16 14:08:28 +01:00
utils.py utils.py: Fix parallel_make limit 2018-02-24 10:31:45 +00:00