Skip to content

Commit

Permalink
package_rpm: remove support for DIRFILES
Browse files Browse the repository at this point in the history
This was added here:
https://git.yoctoproject.org/poky/commit/?id=2f42ef8d8fb1febf28252b98884cebabc931f720

It's undocumented, untested, rpm-specific, and currently
broken, and to begin with looks like a workaround for
Tizen/smack security label conflicts elsewhere.

(From OE-Core rev: ea8af19bb909c7e3633d82bec9d925c8f42ec860)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  • Loading branch information
kanavin authored and rpurdie committed Apr 23, 2024
1 parent 148e0c8 commit f7f4d9d
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions meta/classes-global/package_rpm.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ python write_specfile () {
if not len(depends_dict[dep]):
array.append("%s: %s" % (tag, dep))

def walk_files(walkpath, target, conffiles, dirfiles):
def walk_files(walkpath, target, conffiles):
# We can race against the ipk/deb backends which create CONTROL or DEBIAN directories
# when packaging. We just ignore these files which are created in
# packages-split/ and not package/
Expand Down Expand Up @@ -233,22 +233,12 @@ python write_specfile () {
return False
dirs[:] = [dir for dir in dirs if not move_to_files(dir)]

# Directory handling can happen in two ways, either DIRFILES is not set at all
# in which case we fall back to the older behaviour of packages owning all their
# directories
if dirfiles is None:
for dir in dirs:
if dir == "CONTROL" or dir == "DEBIAN":
continue
p = path + '/' + dir
# All packages own the directories their files are in...
target.append(get_attr(dir) + '%dir "' + escape_chars(p) + '"')
elif path:
# packages own only empty directories or explict directory.
# This will prevent the overlapping of security permission.
attr = get_attr(path)
if (not files and not dirs) or path in dirfiles:
target.append(attr + '%dir "' + escape_chars(path) + '"')
for dir in dirs:
if dir == "CONTROL" or dir == "DEBIAN":
continue
p = path + '/' + dir
# All packages own the directories their files are in...
target.append(get_attr(dir) + '%dir "' + escape_chars(p) + '"')

for file in files:
if file == "CONTROL" or file == "DEBIAN":
Expand Down Expand Up @@ -363,9 +353,6 @@ python write_specfile () {
localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)

conffiles = oe.package.get_conffiles(pkg, d)
dirfiles = localdata.getVar('DIRFILES')
if dirfiles is not None:
dirfiles = dirfiles.split()

splitname = pkgname

Expand Down Expand Up @@ -430,7 +417,7 @@ python write_specfile () {
srcrpostrm = splitrpostrm

file_list = []
walk_files(root, file_list, conffiles, dirfiles)
walk_files(root, file_list, conffiles)
if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1":
bb.note("Not creating empty RPM package for %s" % splitname)
else:
Expand Down Expand Up @@ -522,7 +509,7 @@ python write_specfile () {

# Now process files
file_list = []
walk_files(root, file_list, conffiles, dirfiles)
walk_files(root, file_list, conffiles)
if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1":
bb.note("Not creating empty RPM package for %s" % splitname)
else:
Expand Down

3 comments on commit f7f4d9d

@Livius90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kanavin @rpurdie
Will it be merged to scarthgap branch also?
It seems to me i have an issue which can be solved in scarthgap via this patch:
DynamicDevices/meta-mono#224 (comment)

@kanavin
Copy link
Contributor Author

@kanavin kanavin commented on f7f4d9d Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kanavin @rpurdie Will it be merged to scarthgap branch also? It seems to me i have an issue which can be solved in scarthgap via this patch: DynamicDevices/meta-mono#224 (comment)

This is not the correct channel, please use the openembedded-core list.

@Livius90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.