]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
classes/package_rpm: streamline the logic in one of the condition blocks
authorAlexander Kanavin <alex.kanavin@gmail.com>
Thu, 1 Feb 2024 09:15:04 +0000 (10:15 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Feb 2024 10:53:03 +0000 (10:53 +0000)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/package_rpm.bbclass

index 45ac138084ba9024c6f9f93a96aa6a84021e2453..3743be8c821283bc43f621f9083295119e45c18a 100644 (file)
@@ -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: