diff options
author | Sébastien Mennetrier <smennetrier@voxtok.com> | 2015-05-20 16:48:19 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-24 23:47:04 +0100 |
commit | 311c428636ce218b8fbdb67afc166dd7e61fba82 (patch) | |
tree | 434e30977b94f49306b68447e7d39702f98c790e | |
parent | e062f01d5fbf30ede9f47e999127d0bcc5636ce0 (diff) | |
download | poky-311c428636ce218b8fbdb67afc166dd7e61fba82.tar.gz |
package_rpm.bbclass : escape "%" in files and directories name
The rpm process replace all the "%name" in the spec file by the name of
the package. So, if the package is composed of some files or directories
named "%name...", the rpm package process failed.
Replace all "%" present in files or directories names by "%%%%%%%%" to
correctly escape "%" due to the number of times that % is treated as an
escape character. Jeff Johnson says this is the Right Thing To Do.
[ YOCTO #5397 ]
(From OE-Core rev: 5ed1c7f556df3fafd45d493010cc0bbe74d05ebd)
Signed-off-by: Sébastien Mennetrier <smennetrier@voxtok.com>
Signed-off-by: Michaël Burtin <mburtin@voxtok.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/package_rpm.bbclass | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 271b9ae772..8fd068525b 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -196,6 +196,7 @@ python write_specfile () { | |||
196 | path = rootpath.replace(walkpath, "") | 196 | path = rootpath.replace(walkpath, "") |
197 | if path.endswith("DEBIAN") or path.endswith("CONTROL"): | 197 | if path.endswith("DEBIAN") or path.endswith("CONTROL"): |
198 | continue | 198 | continue |
199 | path = path.replace("%", "%%%%%%%%") | ||
199 | 200 | ||
200 | # Treat all symlinks to directories as normal files. | 201 | # Treat all symlinks to directories as normal files. |
201 | # os.walk() lists them as directories. | 202 | # os.walk() lists them as directories. |
@@ -214,6 +215,7 @@ python write_specfile () { | |||
214 | for dir in dirs: | 215 | for dir in dirs: |
215 | if dir == "CONTROL" or dir == "DEBIAN": | 216 | if dir == "CONTROL" or dir == "DEBIAN": |
216 | continue | 217 | continue |
218 | dir = dir.replace("%", "%%%%%%%%") | ||
217 | # All packages own the directories their files are in... | 219 | # All packages own the directories their files are in... |
218 | target.append('%dir "' + path + '/' + dir + '"') | 220 | target.append('%dir "' + path + '/' + dir + '"') |
219 | else: | 221 | else: |
@@ -227,6 +229,7 @@ python write_specfile () { | |||
227 | for file in files: | 229 | for file in files: |
228 | if file == "CONTROL" or file == "DEBIAN": | 230 | if file == "CONTROL" or file == "DEBIAN": |
229 | continue | 231 | continue |
232 | file = file.replace("%", "%%%%%%%%") | ||
230 | if conffiles.count(path + '/' + file): | 233 | if conffiles.count(path + '/' + file): |
231 | target.append('%config "' + path + '/' + file + '"') | 234 | target.append('%config "' + path + '/' + file + '"') |
232 | else: | 235 | else: |