public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Alexander Kanavin <alex.kanavin@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Alexander Kanavin <alex@linutronix.de>
Subject: [PATCH 2/2] classes/package_rpm: streamline the logic in one of the condition blocks
Date: Wed, 31 Jan 2024 13:04:38 +0100	[thread overview]
Message-ID: <20240131120438.1097632-2-alex@linutronix.de> (raw)
In-Reply-To: <20240131120438.1097632-1-alex@linutronix.de>

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 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 c9354734756..ffa0623af1d 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:
-- 
2.39.2



  reply	other threads:[~2024-01-31 12:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 12:04 [PATCH 1/2] classes/package_rpm: additionally escape \ and " in filenames Alexander Kanavin
2024-01-31 12:04 ` Alexander Kanavin [this message]
2024-02-01  0:02 ` [OE-core] " Alexandre Belloni
2024-02-01  9:15   ` Alexander Kanavin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240131120438.1097632-2-alex@linutronix.de \
    --to=alex.kanavin@gmail.com \
    --cc=alex@linutronix.de \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox