summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-22 15:19:56 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-09 13:39:11 +0000
commitd008867e45b276e69da43adaed93a668800cccf3 (patch)
tree797095984140f8022a0dc3fce76cbf6acfad5005 /meta/classes/package_rpm.bbclass
parentfff7563799f7ea049c290fc04484f96b69a744ca (diff)
downloadpoky-d008867e45b276e69da43adaed93a668800cccf3.tar.gz
classes/package_rpm: handle square brackets in filenames
When constructing a spec file we list files and directory paths in the %files section. If ] or [ characters are in a file or directory name, rpm treats them as wildcards which will mean it won't properly match the filename. Instead, transform these into an ? wildcard so they don't cause a problem. (This fixes packaging the npm package "file-set" and anything that happens to depend upon it, since it includes tests with files that contain unusual characters including ] and [). (From OE-Core rev: f95adb749619e70920c6cc6cd01c6d02cd348fd8) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 638cc1b488..b9f049e4b2 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -197,6 +197,8 @@ python write_specfile () {
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 path = path.replace("%", "%%%%%%%%")
200 path = path.replace("[", "?")
201 path = path.replace("]", "?")
200 202
201 # Treat all symlinks to directories as normal files. 203 # Treat all symlinks to directories as normal files.
202 # os.walk() lists them as directories. 204 # os.walk() lists them as directories.
@@ -216,6 +218,8 @@ python write_specfile () {
216 if dir == "CONTROL" or dir == "DEBIAN": 218 if dir == "CONTROL" or dir == "DEBIAN":
217 continue 219 continue
218 dir = dir.replace("%", "%%%%%%%%") 220 dir = dir.replace("%", "%%%%%%%%")
221 dir = dir.replace("[", "?")
222 dir = dir.replace("]", "?")
219 # All packages own the directories their files are in... 223 # All packages own the directories their files are in...
220 target.append('%dir "' + path + '/' + dir + '"') 224 target.append('%dir "' + path + '/' + dir + '"')
221 else: 225 else:
@@ -230,6 +234,8 @@ python write_specfile () {
230 if file == "CONTROL" or file == "DEBIAN": 234 if file == "CONTROL" or file == "DEBIAN":
231 continue 235 continue
232 file = file.replace("%", "%%%%%%%%") 236 file = file.replace("%", "%%%%%%%%")
237 file = file.replace("[", "?")
238 file = file.replace("]", "?")
233 if conffiles.count(path + '/' + file): 239 if conffiles.count(path + '/' + file):
234 target.append('%config "' + path + '/' + file + '"') 240 target.append('%config "' + path + '/' + file + '"')
235 else: 241 else: