summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/package_rpm.bbclass32
1 files changed, 24 insertions, 8 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 57309accf5..92ddf7a30f 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -185,7 +185,7 @@ python write_specfile () {
185 if not len(depends_dict[dep]): 185 if not len(depends_dict[dep]):
186 array.append("%s: %s" % (tag, dep)) 186 array.append("%s: %s" % (tag, dep))
187 187
188 def walk_files(walkpath, target, conffiles): 188 def walk_files(walkpath, target, conffiles, dirfiles):
189 # We can race against the ipk/deb backends which create CONTROL or DEBIAN directories 189 # We can race against the ipk/deb backends which create CONTROL or DEBIAN directories
190 # when packaging. We just ignore these files which are created in 190 # when packaging. We just ignore these files which are created in
191 # packages-split/ and not package/ 191 # packages-split/ and not package/
@@ -196,11 +196,24 @@ 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 for dir in dirs: 199
200 if dir == "CONTROL" or dir == "DEBIAN": 200 # Directory handling can happen in two ways, either DIRFILES is not set at all
201 continue 201 # in which case we fall back to the older behaviour of packages owning all their
202 # All packages own the directories their files are in... 202 # directories
203 target.append('%dir "' + path + '/' + dir + '"') 203 if dirfiles is None:
204 for dir in dirs:
205 if dir == "CONTROL" or dir == "DEBIAN":
206 continue
207 # All packages own the directories their files are in...
208 target.append('%dir "' + path + '/' + dir + '"')
209 else:
210 # packages own only empty directories or explict directory.
211 # This will prevent the overlapping of security permission.
212 if path and not files and not dirs:
213 target.append('%dir "' + path + '"')
214 elif path and path in dirfiles:
215 target.append('%dir "' + path + '"')
216
204 for file in files: 217 for file in files:
205 if file == "CONTROL" or file == "DEBIAN": 218 if file == "CONTROL" or file == "DEBIAN":
206 continue 219 continue
@@ -312,6 +325,9 @@ python write_specfile () {
312 bb.data.update_data(localdata) 325 bb.data.update_data(localdata)
313 326
314 conffiles = (localdata.getVar('CONFFILES', True) or "").split() 327 conffiles = (localdata.getVar('CONFFILES', True) or "").split()
328 dirfiles = localdata.getVar('DIRFILES', True)
329 if dirfiles is not None:
330 dirfiles = dirfiles.split()
315 331
316 splitname = strip_multilib(pkgname, d) 332 splitname = strip_multilib(pkgname, d)
317 333
@@ -368,7 +384,7 @@ python write_specfile () {
368 srcrpostrm = splitrpostrm 384 srcrpostrm = splitrpostrm
369 385
370 file_list = [] 386 file_list = []
371 walk_files(root, file_list, conffiles) 387 walk_files(root, file_list, conffiles, dirfiles)
372 if not file_list and localdata.getVar('ALLOW_EMPTY') != "1": 388 if not file_list and localdata.getVar('ALLOW_EMPTY') != "1":
373 bb.note("Not creating empty RPM package for %s" % splitname) 389 bb.note("Not creating empty RPM package for %s" % splitname)
374 else: 390 else:
@@ -477,7 +493,7 @@ python write_specfile () {
477 493
478 # Now process files 494 # Now process files
479 file_list = [] 495 file_list = []
480 walk_files(root, file_list, conffiles) 496 walk_files(root, file_list, conffiles, dirfiles)
481 if not file_list and localdata.getVar('ALLOW_EMPTY') != "1": 497 if not file_list and localdata.getVar('ALLOW_EMPTY') != "1":
482 bb.note("Not creating empty RPM package for %s" % splitname) 498 bb.note("Not creating empty RPM package for %s" % splitname)
483 else: 499 else: