summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/package_rpm.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-global/package_rpm.bbclass')
-rw-r--r--meta/classes-global/package_rpm.bbclass39
1 files changed, 11 insertions, 28 deletions
diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass
index 2e3e4e8c79..474d2491eb 100644
--- a/meta/classes-global/package_rpm.bbclass
+++ b/meta/classes-global/package_rpm.bbclass
@@ -38,6 +38,7 @@ def filter_nativesdk_deps(srcname, var):
38 38
39# Construct per file dependencies file 39# Construct per file dependencies file
40def write_rpm_perfiledata(srcname, d): 40def write_rpm_perfiledata(srcname, d):
41 import oe.package
41 workdir = d.getVar('WORKDIR') 42 workdir = d.getVar('WORKDIR')
42 packages = d.getVar('PACKAGES') 43 packages = d.getVar('PACKAGES')
43 pkgd = d.getVar('PKGD') 44 pkgd = d.getVar('PKGD')
@@ -53,12 +54,7 @@ def write_rpm_perfiledata(srcname, d):
53 key = "FILE" + varname + ":" + dfile + ":" + pkg 54 key = "FILE" + varname + ":" + dfile + ":" + pkg
54 deps = filter_nativesdk_deps(srcname, d.getVar(key) or "") 55 deps = filter_nativesdk_deps(srcname, d.getVar(key) or "")
55 depends_dict = bb.utils.explode_dep_versions(deps) 56 depends_dict = bb.utils.explode_dep_versions(deps)
56 file = dfile.replace("@underscore@", "_") 57 file = oe.package.file_reverse_translate(dfile)
57 file = file.replace("@closebrace@", "]")
58 file = file.replace("@openbrace@", "[")
59 file = file.replace("@tab@", "\t")
60 file = file.replace("@space@", " ")
61 file = file.replace("@at@", "@")
62 outfile.write('"' + pkgd + file + '" : "') 58 outfile.write('"' + pkgd + file + '" : "')
63 for dep in depends_dict: 59 for dep in depends_dict:
64 ver = depends_dict[dep] 60 ver = depends_dict[dep]
@@ -191,7 +187,7 @@ python write_specfile () {
191 if not len(depends_dict[dep]): 187 if not len(depends_dict[dep]):
192 array.append("%s: %s" % (tag, dep)) 188 array.append("%s: %s" % (tag, dep))
193 189
194 def walk_files(walkpath, target, conffiles, dirfiles): 190 def walk_files(walkpath, target, conffiles):
195 # We can race against the ipk/deb backends which create CONTROL or DEBIAN directories 191 # We can race against the ipk/deb backends which create CONTROL or DEBIAN directories
196 # when packaging. We just ignore these files which are created in 192 # when packaging. We just ignore these files which are created in
197 # packages-split/ and not package/ 193 # packages-split/ and not package/
@@ -233,22 +229,12 @@ python write_specfile () {
233 return False 229 return False
234 dirs[:] = [dir for dir in dirs if not move_to_files(dir)] 230 dirs[:] = [dir for dir in dirs if not move_to_files(dir)]
235 231
236 # Directory handling can happen in two ways, either DIRFILES is not set at all 232 for dir in dirs:
237 # in which case we fall back to the older behaviour of packages owning all their 233 if dir == "CONTROL" or dir == "DEBIAN":
238 # directories 234 continue
239 if dirfiles is None: 235 p = path + '/' + dir
240 for dir in dirs: 236 # All packages own the directories their files are in...
241 if dir == "CONTROL" or dir == "DEBIAN": 237 target.append(get_attr(dir) + '%dir "' + escape_chars(p) + '"')
242 continue
243 p = path + '/' + dir
244 # All packages own the directories their files are in...
245 target.append(get_attr(dir) + '%dir "' + escape_chars(p) + '"')
246 elif path:
247 # packages own only empty directories or explict directory.
248 # This will prevent the overlapping of security permission.
249 attr = get_attr(path)
250 if (not files and not dirs) or path in dirfiles:
251 target.append(attr + '%dir "' + escape_chars(path) + '"')
252 238
253 for file in files: 239 for file in files:
254 if file == "CONTROL" or file == "DEBIAN": 240 if file == "CONTROL" or file == "DEBIAN":
@@ -363,9 +349,6 @@ python write_specfile () {
363 localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg) 349 localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
364 350
365 conffiles = oe.package.get_conffiles(pkg, d) 351 conffiles = oe.package.get_conffiles(pkg, d)
366 dirfiles = localdata.getVar('DIRFILES')
367 if dirfiles is not None:
368 dirfiles = dirfiles.split()
369 352
370 splitname = pkgname 353 splitname = pkgname
371 354
@@ -430,7 +413,7 @@ python write_specfile () {
430 srcrpostrm = splitrpostrm 413 srcrpostrm = splitrpostrm
431 414
432 file_list = [] 415 file_list = []
433 walk_files(root, file_list, conffiles, dirfiles) 416 walk_files(root, file_list, conffiles)
434 if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1": 417 if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1":
435 bb.note("Not creating empty RPM package for %s" % splitname) 418 bb.note("Not creating empty RPM package for %s" % splitname)
436 else: 419 else:
@@ -522,7 +505,7 @@ python write_specfile () {
522 505
523 # Now process files 506 # Now process files
524 file_list = [] 507 file_list = []
525 walk_files(root, file_list, conffiles, dirfiles) 508 walk_files(root, file_list, conffiles)
526 if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1": 509 if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1":
527 bb.note("Not creating empty RPM package for %s" % splitname) 510 bb.note("Not creating empty RPM package for %s" % splitname)
528 else: 511 else: