bash-completion.bbclass: prepend bash-completion to PACKAGES
PATCH v2 1/1 bash-completion.bbclass: prepend bash-completion to PACKAGES
It was observed when FILES:${PN} contains "${sysconfdir}" or "${datadir}", the bash-completion files wont be installed to bash-completion package.
Fix it by prepending bash-completion package to PACKAGES, this ensures bash-completion package get the files packaged before PN.
--- meta/classes-recipe/bash-completion.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/bash-completion.bbclass +1 -1
@@ -6,7 +6,7 @@ DEPENDS:append:class-target = " bash-completion" -PACKAGES += "${PN}-bash-completion" +PACKAGES:prepend = "${PN}-bash-completion " FILES:${PN}-bash-completion = "${datadir}/bash-completion ${sysconfdir}/bash_completion.d"
Signature · 1 line
2.43.0
Quoted 21 lines · Ming Liu via lists.openembedded.org
It was observed when FILES:${PN} contains "${sysconfdir}" or "${datadir}", the bash-completion files wont be installed to bash-completion package.
Fix it by prepending bash-completion package to PACKAGES, this ensures bash-completion package get the files packaged before PN.
Signed-off-by Ming Liu <[email protected]>---
meta/classes-recipe/bash-completion.bbclass | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)meta/classes-recipe/bash-completion.bbclass +0
-0@@ -6,7 +6,7 @@DEPENDS:append:class-target = " bash-completion"
meta/classes-recipe/bash-completion.bbclass
Quoted 2 lines
meta/classes-recipe/bash-completion.bbclass +1
-1-PACKAGES += "${PN}-bash-completion" +PACKAGES:prepend = "${PN}-bash-completion “
Please use PACKAGES_BEFORE_PN for this, and just +=.
Ross
Hi, Ross:
I was using exact PACKAGES_BEFORE_PN with += as you suggested in V1 patch, but it broke the build, clearly PACKAGES_BEFORE_PN is not handled correctly in some recipes.
//Ming Liu
Ross Burton <[email protected]> 於 2025年11月10日 週一 下午6:54寫道:
Quoted 32 lines
Quoted 8 lines · Ming Liu via lists.openembedded.org
It was observed when FILES:${PN} contains "${sysconfdir}" or "${datadir}", the bash-completion files wont be installed to bash-completion package.
Fix it by prepending bash-completion package to PACKAGES, this ensures bash-completion package get the files packaged before PN.
Review
Quoted 6 lines
Signed-off-by Ming Liu <[email protected]>---
meta/classes-recipe/bash-completion.bbclass | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0b/meta/classes-recipe/bash-completion.bbclass
meta/classes-recipe/bash-completion.bbclass
Quoted 9 lines
index
b656e76c09..e337c2045d100644meta/classes-recipe/bash-completion.bbclass +0
-0@@ -6,7 +6,7 @@DEPENDS:append:class-target = " bash-completion"
meta/classes-recipe/bash-completion.bbclass +1
-1-PACKAGES += "${PN}-bash-completion" +PACKAGES:prepend = "${PN}-bash-completion “Please use
PACKAGES_BEFORE_PNfor this, and just +=.Ross
Quoted 2 lines · Ming Liu
I was using exact
PACKAGES_BEFORE_PNwith += as you suggested in V1 patch, but it broke the build, clearlyPACKAGES_BEFORE_PNis not handled correctly in some recipes.
Those recipes are assigning to PACKAGES_BEFORE_PN, so this class should use PACKAGES_BEFORE_PN:prepend instead.
Ross
Hi, Ross:
Yes, that should work, but I have to use prepend any way, I am wondering "PACKAGES_BEFORE_PN:prepend " is better than "PACKAGES:prepend"?
//Ming Liu
Ross Burton <[email protected]> 於 2025年11月11日 週二 上午11:50寫道:
Quoted 12 lines · Ming Liu
Quoted 2 lines
I was using exact
PACKAGES_BEFORE_PNwith += as you suggested in V1patch, but it broke the build, clearly
PACKAGES_BEFORE_PNis not handled correctly in some recipes.Those recipes are assigning to
PACKAGES_BEFORE_PN, so this class should use PACKAGES_BEFORE_PN:prepend instead.Ross
Quoted 4 lines · Ming Liu
Hi, Ross:
Yes, that should work, but I have to use prepend any way, I am wondering "PACKAGES_BEFORE_PN:prepend " is better than "PACKAGES:prepend”?
Personally I think it’s better because we have a variable that is designed to be the packages that are collected before PN, so we should use it.
Ross
Quoted 12 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Ross Burton via lists.openembedded.org
Sent: den 11 november 2025 12:46
To: Ming Liu <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core] [PATCH V2] bash-completion.bbclass: prepend bash- completion to PACKAGESQuoted 1 line · Ming Liu
Quoted 8 lines
Quoted 3 lines
Hi, Ross:
Yes, that should work, but I have to use prepend any way, I am wondering "PACKAGES_BEFORE_PN:prepend " is better than "PACKAGES:prepend”?
Personally I think it’s better because we have a variable that is designed to be the packages that are collected before PN, so we should use it.
Ross
The reason I suggested to use PACKAGES:prepend rather than PACKAGE_BEFORE_PN:prepend is that we do not know what is in PACKAGES and in their FILES variables. However, we do know that the user wants to package the bash-completion package and thus expects it to claim its paths regardless of what else is in PACKAGES and FILES. I.e., to support someone doing something like:
inherit bash-completion
PACKAGES =+ "${PN}-foo"
FILES:${PN}-foo = "${sysconfdir}"
we need to prepend to PACKAGES rather than PACKAGE_BEFORE_PN.
//Peter
Quoted 33 lines · Peter Kjellerstedt via lists.openembedded.org
Quoted 19 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Ross Burton via lists.openembedded.org
Sent: den 11 november 2025 12:46
To: Ming Liu <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core] [PATCH V2] bash-completion.bbclass: prepend bash-
completion to PACKAGESQuoted 6 lines · Ming Liu
Hi, Ross:
Yes, that should work, but I have to use prepend any way, I am wondering "PACKAGES_BEFORE_PN:prepend " is better than "PACKAGES:prepend”?
Quoted 6 lines
Personally I think it’s better because we have a variable that is designed
to be the packages that are collected before PN, so we should use it.Ross
The reason I suggested to use PACKAGES:prepend rather than PACKAGE_BEFORE_PN:prepend is that we do not know what is in PACKAGES and in their FILES variables. However, we do know that the user wants to package the bash-completion package and thus expects it to claim its paths regardless of what else is in PACKAGES and FILES. I.e., to support someone doing something like:
Quoted 7 lines
inherit bash-completion
PACKAGES =+ "${PN}-foo"
FILES:${PN}-foo = "${sysconfdir}"
we need to prepend to PACKAGES rather than
PACKAGE_BEFORE_PN.
I'm going to weigh in here. I have a very strong preference not to use prepend/append but just stick with += in the classes.
If that means we need to edit the recipes to have the inherit for bash- completion in the right place, so be it.
Our recipes are already sensitive to inherit positioning and everything switching to prepend just makes += ultimately useless and moves the problem a level down the line.
So we should get ahead of this and just position the inherits correctly.
Cheers,
Richard