classes/package_rpm: additionally escape \ and " in filenames

As specified in:
https://github.com/rpm-software-management/rpm/blob/rpm-4.19.x/docs/manual/spec.md#shell-globbing

(From OE-Core rev: 78d22c80c3f3a9f82c9f0d3dd1c591d395e02918)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2024-02-01 10:15:03 +01:00
committed by Richard Purdie
parent 3ef63361b4
commit eda2fe2ac0

View File

@@ -217,7 +217,7 @@ python write_specfile () {
return "%attr({:o},{},{}) ".format(mode, owner, group)
def escape_chars(p):
return p.replace("%", "%%")
return p.replace("%", "%%").replace("\\", "\\\\").replace('"', '\\"')
path = rootpath.replace(walkpath, "")
if path.endswith("DEBIAN") or path.endswith("CONTROL"):