From 57d82f92c1060c5f15072f5d266dbac11665ae26 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Thu, 1 Feb 2024 10:15:04 +0100 Subject: classes/package_rpm: streamline the logic in one of the condition blocks (From OE-Core rev: e6a8ca554509c0edf9fd36ced88165dc3caf0e87) Signed-off-by: Alexander Kanavin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/classes-global/package_rpm.bbclass | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass index 45ac138084..3743be8c82 100644 --- a/meta/classes-global/package_rpm.bbclass +++ b/meta/classes-global/package_rpm.bbclass @@ -243,13 +243,11 @@ python write_specfile () { p = path + '/' + dir # All packages own the directories their files are in... target.append(get_attr(dir) + '%dir "' + escape_chars(p) + '"') - else: + elif path: # packages own only empty directories or explict directory. # This will prevent the overlapping of security permission. attr = get_attr(path) - if path and not files and not dirs: - target.append(attr + '%dir "' + escape_chars(path) + '"') - elif path and path in dirfiles: + if (not files and not dirs) or path in dirfiles: target.append(attr + '%dir "' + escape_chars(path) + '"') for file in files: -- cgit v1.2.3-54-g00ecf