Slight code cleanup - remove dead code, fix typos, unify patterns
cover Slight code cleanup - remove dead code, fix typos, unify patterns
---
Adam Blank (4):
lib/packagedata.py: slight improvement to code readability
package_pkgdata: fix typo to stop calling undefined function
sstate: remove dead code and unify path operations
package: update the comment block explaining 'emit_pkgdata'
meta/classes-global/package.bbclass | 3 +-- meta/classes-global/package_pkgdata.bbclass | 4 +--- meta/classes-global/sstate.bbclass | 5 ++--- meta/lib/oe/packagedata.py | 3 +-- 4 files changed, 5 insertions(+), 10 deletions(-)
---
base-commit: c56990178b31b893fbf695eaf6b67de501e9d2e9
change-id: 20260402-dead_code_and_unification-d2b31d998515
Best regards,
Signature · 1 line
Adam Blank <[email protected]>
PATCH 1/4 lib/packagedata.py: slight improvement to code readability
Make use of an existing variable rather than creating a new one when collecting files of a package.
--- meta/lib/oe/packagedata.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
meta/lib/oe/packagedata.py +1 -2
@@ -340,8 +340,7 @@ fi allow_empty = d.getVar('ALLOW_EMPTY:%s' % pkg) if not allow_empty: allow_empty = d.getVar('ALLOW_EMPTY') - root = "%s/%s" % (pkgdest, pkg) - os.chdir(root) + os.chdir(pkgdestpkg) g = glob('*') if g or allow_empty == "1": # Symlinks needed for reverse lookups (from the final package name)
Signature · 1 line
2.43.0
PATCH 2/4 package_pkgdata: fix typo to stop calling undefined function
In reply to Adam Blank--- meta/classes-global/package_pkgdata.bbclass | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
meta/classes-global/package_pkgdata.bbclass +1 -3
@@ -47,7 +47,7 @@ python package_prepare_pkgdata() { # Detect bitbake -b usage nodeps = d.getVar("BB_LIMITEDDEPS") or False if nodeps: - staging_package_populate_pkgdata_dir(pkgdatadir, d) + package_populate_pkgdata_dir(pkgdatadir, d) return start = None
@@ -169,5 +169,3 @@ python package_prepare_pkgdata() { } package_prepare_pkgdata[cleandirs] = "${WORKDIR_PKGDATA}" package_prepare_pkgdata[vardepsexclude] += "MACHINE_ARCH PACKAGE_EXTRA_ARCHS SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA SSTATETASKS" - -
Signature · 1 line
2.43.0
Patchtest results for [PATCH 2/4] package_pkgdata: fix typo to stop calling undefined function
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/2-4-package_pkgdata-fix-typo-to-stop-calling-undefined-function.patch
FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
PATCH 3/4 sstate: remove dead code and unify path operations
In reply to Adam BlankMost substring replacement operations performed on 'dirs' and 'plaindirs' are implemented in the same pattern, except two. Unify the implementation.
--- meta/classes-global/sstate.bbclass | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
meta/classes-global/sstate.bbclass +2 -3
@@ -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.
Signature · 1 line
2.43.0
PATCH 4/4 package: update the comment block explaining 'emit_pkgdata'
In reply to Adam Blank--- meta/classes-global/package.bbclass | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
meta/classes-global/package.bbclass +1 -2
@@ -41,7 +41,7 @@ # # k) package_depchains - Adds automatic dependencies to -dbg and -dev packages # -# l) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later +# l) emit_pkgdata - saves the packaging data into PKGDESTWORK for use in later # packaging steps inherit packagedata
@@ -610,4 +610,3 @@ python do_packagedata_setscene () { sstate_setscene(d) } addtask do_packagedata_setscene -
Signature · 1 line
2.43.0
Patchtest results for [PATCH 4/4] package: update the comment block explaining 'emit_pkgdata'
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/4-4-package-update-the-comment-block-explaining-emit_pkgdata.patch
FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!