public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Adam Blank <adam.blank.g@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Adam Blank <adam.blank.g@gmail.com>
Subject: [PATCH 3/4] sstate: remove dead code and unify path operations
Date: Thu, 02 Apr 2026 16:55:00 +0200	[thread overview]
Message-ID: <20260402-dead_code_and_unification-v1-3-5a3906b6340d@gmail.com> (raw)
In-Reply-To: <20260402-dead_code_and_unification-v1-0-5a3906b6340d@gmail.com>

Most substring replacement operations performed on
'dirs' and 'plaindirs' are implemented in the same
pattern, except two. Unify the implementation.

Signed-off-by: Adam Blank <adam.blank.g@gmail.com>
---
 meta/classes-global/sstate.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 88449d19c7..6d5ff265c5 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -333,9 +333,9 @@ def sstate_install(ss, d):
     for plain in ss['plaindirs']:
         workdir = d.getVar('WORKDIR')
         sharedworkdir = os.path.join(d.getVar('TMPDIR'), "work-shared")
-        src = sstateinst + "/" + plain.replace(workdir, '')
+        src = plain.replace(workdir, sstateinst)
         if sharedworkdir in plain:
-            src = sstateinst + "/" + plain.replace(sharedworkdir, '')
+            src = plain.replace(sharedworkdir, sstateinst)
         dest = plain
         bb.utils.mkdirhier(src)
         prepdir(dest)
@@ -639,7 +639,6 @@ def sstate_package(ss, d):
     for state in ss['dirs']:
         if not os.path.exists(state[1]):
             continue
-        srcbase = state[0].rstrip("/").rsplit('/', 1)[0]
         # Find and error for absolute symlinks. We could attempt to relocate but its not
         # clear where the symlink is relative to in this context. We could add that markup
         # to sstate tasks but there aren't many of these so better just avoid them entirely.

-- 
2.43.0



  parent reply	other threads:[~2026-04-02 14:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 14:54 [PATCH 0/4] Slight code cleanup - remove dead code, fix typos, unify patterns Adam Blank
2026-04-02 14:54 ` [PATCH 1/4] lib/packagedata.py: slight improvement to code readability Adam Blank
2026-04-02 14:54 ` [PATCH 2/4] package_pkgdata: fix typo to stop calling undefined function Adam Blank
2026-04-02 15:00   ` Patchtest results for " patchtest
2026-04-02 14:55 ` Adam Blank [this message]
2026-04-02 14:55 ` [PATCH 4/4] package: update the comment block explaining 'emit_pkgdata' Adam Blank
2026-04-02 15:00   ` Patchtest results for " patchtest

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=20260402-dead_code_and_unification-v1-3-5a3906b6340d@gmail.com \
    --to=adam.blank.g@gmail.com \
    --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