]> code.ossystems Code Review - openembedded-core.git/commit
update-alternatives: correctly escape PATHs when updating FILES_${PN}
authorAndré Draszik <andre.draszik@jci.com>
Tue, 5 Feb 2019 02:32:29 +0000 (02:32 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Feb 2019 08:29:02 +0000 (08:29 +0000)
commit126743162397e4145902b3f127f2dafd80a8a49b
tree0f09c5a93554c0a885cf82bbb4a2f8f258c6b6c0
parent0edda66097407c62821af9e98579f5fcf906e938
update-alternatives: correctly escape PATHs when updating FILES_${PN}

The recently added support for updating FILES based on the file renames
that are happening here is using a regex replace, but failed to
properly escape the search pattern (the full path). This manifests itself
in FILES not being updated as soon as the full path contains any
character that has a special meaning, e.g. '+'.

In other words an original path (alt_target in the code) like
    /opt/poky/2.6+snapshot/sysroots/i686-pokysdk-linux/sbin/losetup
can't be matched, and hence we fail to update FILES with the new value,
causing packaging errors.

Fix by using re.escape() on the original path before passing into re.sub()

Fixes: 5c23fe378732 ("update-alternatives: try to update FILES_${PN} when
renaming a file"), or bcb3e7b7f88a in poky.git

[YOCTO #13058]

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/update-alternatives.bbclass