From: Alexander Kanavin Date: Thu, 1 Feb 2024 09:15:04 +0000 (+0100) Subject: classes/package_rpm: streamline the logic in one of the condition blocks X-Git-Tag: uninative-4.4~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6a8ca554509c0edf9fd36ced88165dc3caf0e87;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git classes/package_rpm: streamline the logic in one of the condition blocks Signed-off-by: Alexander Kanavin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass index 45ac138084b..3743be8c821 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: