* [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable @ 2024-04-24 6:14 srinuvasan.a 2024-04-24 6:33 ` Schmidt, Adriaan 0 siblings, 1 reply; 7+ messages in thread From: srinuvasan.a @ 2024-04-24 6:14 UTC (permalink / raw) To: isar-users; +Cc: jan.kiszka, felix.moessbauer, Srinuvasan A From: Srinuvasan A <srinuvasan.a@siemens.com> In some cases we may need to install the prebuilt deb packages based on some condition or based on distro selection, in this case the present implementation not works as expected. The reason behind this is SRC_URI variable is not exapnding, remove False flag to expand SRC_URI variable to get the required field. Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com> --- meta/classes/dpkg-prebuilt.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg-prebuilt.bbclass index 8135fc81..1ee1147c 100644 --- a/meta/classes/dpkg-prebuilt.bbclass +++ b/meta/classes/dpkg-prebuilt.bbclass @@ -7,7 +7,7 @@ inherit dpkg-base python do_unpack:prepend() { # enforce unpack=false - src_uri = (d.getVar('SRC_URI', False) or '').split() + src_uri = (d.getVar('SRC_URI') or '').split() if len(src_uri) == 0: return def ensure_unpack_false(uri): -- 2.34.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable 2024-04-24 6:14 [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable srinuvasan.a @ 2024-04-24 6:33 ` Schmidt, Adriaan 2024-04-24 6:59 ` Srinuvasan Arjunan 0 siblings, 1 reply; 7+ messages in thread From: Schmidt, Adriaan @ 2024-04-24 6:33 UTC (permalink / raw) To: Arjunan, Srinu, isar-users; +Cc: Kiszka, Jan, MOESSBAUER, Felix Hi, srinuvasan.a, Mittwoch, 24. April 2024 08:15: > In some cases we may need to install the prebuilt deb packages based on > some condition or based on distro selection, in this case the present > implementation not works as expected. I've seen dpkg-prebuilt SRC_URIs containing "${PACKAGE_ARCH}" and/or "${DISTRO}", and that seemed to work just fine. Your patch would only change the time at which expansion happens, and that should not make a difference. Could you give some details or an example what you're trying to do? > The reason behind this is SRC_URI variable is not exapnding, remove > False flag to expand SRC_URI variable to get the required field. The current behavior was introduced in ee20790f454030fad40b4ac7b97bf9eaadda48e7. Commit message reads: --- signatures: do not expand SRC_URI This patch reworks modification to SRC_URI to avoid expanding the variables in the string. By that, both cachability issues, as well as information leaks (e.g. repo access tokens) are mitigated. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> --- I assume that this is still valid? Adriaan > Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com> > --- > meta/classes/dpkg-prebuilt.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg- > prebuilt.bbclass > index 8135fc81..1ee1147c 100644 > --- a/meta/classes/dpkg-prebuilt.bbclass > +++ b/meta/classes/dpkg-prebuilt.bbclass > @@ -7,7 +7,7 @@ inherit dpkg-base > > python do_unpack:prepend() { > # enforce unpack=false > - src_uri = (d.getVar('SRC_URI', False) or '').split() > + src_uri = (d.getVar('SRC_URI') or '').split() > if len(src_uri) == 0: > return > def ensure_unpack_false(uri): > -- > 2.34.1 > > -- > You received this message because you are subscribed to the Google Groups > "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to isar-users+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/20240424061452.506278-1- > srinuvasan.a%40siemens.com. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable 2024-04-24 6:33 ` Schmidt, Adriaan @ 2024-04-24 6:59 ` Srinuvasan Arjunan 2024-04-24 7:27 ` Schmidt, Adriaan 0 siblings, 1 reply; 7+ messages in thread From: Srinuvasan Arjunan @ 2024-04-24 6:59 UTC (permalink / raw) To: Schmidt, Adriaan Cc: Arjunan, Srinu, isar-users, Kiszka, Jan, MOESSBAUER, Felix [-- Attachment #1: Type: text/plain, Size: 3383 bytes --] On Wed, Apr 24, 2024 at 12:03 PM 'Schmidt, Adriaan' via isar-users < isar-users@googlegroups.com> wrote: > Hi, > > srinuvasan.a, Mittwoch, 24. April 2024 08:15: > > In some cases we may need to install the prebuilt deb packages based on > > some condition or based on distro selection, in this case the present > > implementation not works as expected. > > I've seen dpkg-prebuilt SRC_URIs containing "${PACKAGE_ARCH}" and/or > "${DISTRO}", and that seemed to work just fine. Your patch would only > change the time at which expansion happens, and that should not make > a difference. > > Could you give some details or an example what you're trying to do? > Hi Adriaan, Suppose if you want to install the prebuilt-deb packages based on the selection like below: SRC_URI:append = " ${@ 'file://example-prebuilt_1.0.0-0_bullseye.deb' if d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else 'file://example-prebuilt_1.0.0-0_all.deb' }" The above changes not works with the present implementation, with the help of expanding the SRC_URI variable we can able to get the right packages in WORKDIR. Thanks, Srinu > > > The reason behind this is SRC_URI variable is not exapnding, remove > > False flag to expand SRC_URI variable to get the required field. > > The current behavior was introduced in > ee20790f454030fad40b4ac7b97bf9eaadda48e7. > Commit message reads: > --- > signatures: do not expand SRC_URI > This patch reworks modification to SRC_URI to avoid expanding > the variables in the string. By that, both cachability issues, > as well as information leaks (e.g. repo access tokens) are > mitigated. > > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> > --- > I assume that this is still valid? > > Adriaan > > > Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com> > > --- > > meta/classes/dpkg-prebuilt.bbclass | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg- > > prebuilt.bbclass > > index 8135fc81..1ee1147c 100644 > > --- a/meta/classes/dpkg-prebuilt.bbclass > > +++ b/meta/classes/dpkg-prebuilt.bbclass > > @@ -7,7 +7,7 @@ inherit dpkg-base > > > > python do_unpack:prepend() { > > # enforce unpack=false > > - src_uri = (d.getVar('SRC_URI', False) or '').split() > > + src_uri = (d.getVar('SRC_URI') or '').split() > > if len(src_uri) == 0: > > return > > def ensure_unpack_false(uri): > > -- > > 2.34.1 > > > > -- > > You received this message because you are subscribed to the Google Groups > > "isar-users" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to isar-users+unsubscribe@googlegroups.com. > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/isar-users/20240424061452.506278-1- > > srinuvasan.a%40siemens.com. > > -- > You received this message because you are subscribed to the Google Groups > "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to isar-users+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/AS4PR10MB5318C687D0B13B3007FDC20BED102%40AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM > . > [-- Attachment #2: Type: text/html, Size: 4977 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable 2024-04-24 6:59 ` Srinuvasan Arjunan @ 2024-04-24 7:27 ` Schmidt, Adriaan 2024-04-24 8:02 ` Srinuvasan Arjunan 0 siblings, 1 reply; 7+ messages in thread From: Schmidt, Adriaan @ 2024-04-24 7:27 UTC (permalink / raw) To: Srinuvasan Arjunan Cc: Arjunan, Srinu, isar-users, Kiszka, Jan, MOESSBAUER, Felix Hi Srinu, In this case I would: PACKAGE_NAME = "example-prebuilt_1.0.0-0_all.deb" PACKAGE_NAME:debian-bullseye = "example-prebuilt_1.0.0-0_bullseye.deb" SRC_URI += "file://${PACKAGE_NAME}" Adriaan From: Srinuvasan Arjunan <srinuvasanasv@gmail.com> Sent: Mittwoch, 24. April 2024 08:59 To: Schmidt, Adriaan (T CED EDC-DE) <adriaan.schmidt@siemens.com> Cc: Arjunan, Srinu (DI CTO FDS CES LX PBU 2) <srinuvasan.a@siemens.com>; isar-users@googlegroups.com; Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Moessbauer, Felix (T CED OES-DE) <felix.moessbauer@siemens.com> Subject: Re: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable On Wed, Apr 24, 2024 at 12:03 PM 'Schmidt, Adriaan' via isar-users <mailto:isar-users@googlegroups.com> wrote: Hi, srinuvasan.a, Mittwoch, 24. April 2024 08:15: > In some cases we may need to install the prebuilt deb packages based on > some condition or based on distro selection, in this case the present > implementation not works as expected. I've seen dpkg-prebuilt SRC_URIs containing "${PACKAGE_ARCH}" and/or "${DISTRO}", and that seemed to work just fine. Your patch would only change the time at which expansion happens, and that should not make a difference. Could you give some details or an example what you're trying to do? Hi Adriaan, Suppose if you want to install the prebuilt-deb packages based on the selection like below: SRC_URI:append = " ${@ 'file://example-prebuilt_1.0.0-0_bullseye.deb' if d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else 'file://example-prebuilt_1.0.0-0_all.deb' }" The above changes not works with the present implementation, with the help of expanding the SRC_URI variable we can able to get the right packages in WORKDIR. Thanks, Srinu > The reason behind this is SRC_URI variable is not exapnding, remove > False flag to expand SRC_URI variable to get the required field. The current behavior was introduced in ee20790f454030fad40b4ac7b97bf9eaadda48e7. Commit message reads: --- signatures: do not expand SRC_URI This patch reworks modification to SRC_URI to avoid expanding the variables in the string. By that, both cachability issues, as well as information leaks (e.g. repo access tokens) are mitigated. Signed-off-by: Felix Moessbauer <mailto:felix.moessbauer@siemens.com> --- I assume that this is still valid? Adriaan > Signed-off-by: Srinuvasan A <mailto:srinuvasan.a@siemens.com> > --- > meta/classes/dpkg-prebuilt.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg- > prebuilt.bbclass > index 8135fc81..1ee1147c 100644 > --- a/meta/classes/dpkg-prebuilt.bbclass > +++ b/meta/classes/dpkg-prebuilt.bbclass > @@ -7,7 +7,7 @@ inherit dpkg-base > > python do_unpack:prepend() { > # enforce unpack=false > - src_uri = (d.getVar('SRC_URI', False) or '').split() > + src_uri = (d.getVar('SRC_URI') or '').split() > if len(src_uri) == 0: > return > def ensure_unpack_false(uri): > -- > 2.34.1 > > -- > You received this message because you are subscribed to the Google Groups > "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to mailto:isar-users%2Bunsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/20240424061452.506278-1- > srinuvasan.a%http://40siemens.com. -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mailto:isar-users%2Bunsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/AS4PR10MB5318C687D0B13B3007FDC20BED102%40AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable 2024-04-24 7:27 ` Schmidt, Adriaan @ 2024-04-24 8:02 ` Srinuvasan Arjunan 2024-04-24 9:42 ` Schmidt, Adriaan 0 siblings, 1 reply; 7+ messages in thread From: Srinuvasan Arjunan @ 2024-04-24 8:02 UTC (permalink / raw) To: Schmidt, Adriaan Cc: Arjunan, Srinu, isar-users, Kiszka, Jan, MOESSBAUER, Felix [-- Attachment #1: Type: text/plain, Size: 5026 bytes --] On Wed, Apr 24, 2024 at 12:57 PM Schmidt, Adriaan < adriaan.schmidt@siemens.com> wrote: > Hi Srinu, > > In this case I would: > > PACKAGE_NAME = "example-prebuilt_1.0.0-0_all.deb" > PACKAGE_NAME:debian-bullseye = "example-prebuilt_1.0.0-0_bullseye.deb" > SRC_URI += "file://${PACKAGE_NAME}" > > Adriaan > Hi Adriaan, Actually this is not my use cases but same intention, originally my use case is am going to install the copyright file based on the selection of LICENSE variable which is configured in the recipe , this selection of copyright file i introduced in debianize.bbclass file, when we build the images it is not building successfully, we faced build error in prebuilt-deb recipe. Your suggestion only works with the overrides variable not for others, but my use case is based on the user configure LICENSE in the recipe, it should pick the appropriate copyright file and install it in the debian package. Please refer my original use case here: https://groups.google.com/g/isar-users/c/SCM8yQ0PYXg Many thanks, Srinu > > > > From: Srinuvasan Arjunan <srinuvasanasv@gmail.com> > Sent: Mittwoch, 24. April 2024 08:59 > To: Schmidt, Adriaan (T CED EDC-DE) <adriaan.schmidt@siemens.com> > Cc: Arjunan, Srinu (DI CTO FDS CES LX PBU 2) <srinuvasan.a@siemens.com>; > isar-users@googlegroups.com; Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; > Moessbauer, Felix (T CED OES-DE) <felix.moessbauer@siemens.com> > Subject: Re: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable > > > > On Wed, Apr 24, 2024 at 12:03 PM 'Schmidt, Adriaan' via isar-users <mailto: > isar-users@googlegroups.com> wrote: > Hi, > > srinuvasan.a, Mittwoch, 24. April 2024 08:15: > > In some cases we may need to install the prebuilt deb packages based on > > some condition or based on distro selection, in this case the present > > implementation not works as expected. > > I've seen dpkg-prebuilt SRC_URIs containing "${PACKAGE_ARCH}" and/or > "${DISTRO}", and that seemed to work just fine. Your patch would only > change the time at which expansion happens, and that should not make > a difference. > > Could you give some details or an example what you're trying to do? > > Hi Adriaan, > > Suppose if you want to install the prebuilt-deb packages based > on the selection like below: > SRC_URI:append = " ${@ > 'file://example-prebuilt_1.0.0-0_bullseye.deb' if > d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else > 'file://example-prebuilt_1.0.0-0_all.deb' }" > > The above changes not works with the present implementation, with the help > of expanding the SRC_URI variable we can able to get the right packages in > WORKDIR. > > Thanks, > Srinu > > > The reason behind this is SRC_URI variable is not exapnding, remove > > False flag to expand SRC_URI variable to get the required field. > > The current behavior was introduced in > ee20790f454030fad40b4ac7b97bf9eaadda48e7. > Commit message reads: > --- > signatures: do not expand SRC_URI > This patch reworks modification to SRC_URI to avoid expanding > the variables in the string. By that, both cachability issues, > as well as information leaks (e.g. repo access tokens) are > mitigated. > > Signed-off-by: Felix Moessbauer <mailto:felix.moessbauer@siemens.com> > --- > I assume that this is still valid? > > Adriaan > > > Signed-off-by: Srinuvasan A <mailto:srinuvasan.a@siemens.com> > > --- > > meta/classes/dpkg-prebuilt.bbclass | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg- > > prebuilt.bbclass > > index 8135fc81..1ee1147c 100644 > > --- a/meta/classes/dpkg-prebuilt.bbclass > > +++ b/meta/classes/dpkg-prebuilt.bbclass > > @@ -7,7 +7,7 @@ inherit dpkg-base > > > > python do_unpack:prepend() { > > # enforce unpack=false > > - src_uri = (d.getVar('SRC_URI', False) or '').split() > > + src_uri = (d.getVar('SRC_URI') or '').split() > > if len(src_uri) == 0: > > return > > def ensure_unpack_false(uri): > > -- > > 2.34.1 > > > > -- > > You received this message because you are subscribed to the Google Groups > > "isar-users" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to mailto:isar-users%2Bunsubscribe@googlegroups.com. > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/isar-users/20240424061452.506278-1- > > srinuvasan.a%http://40siemens.com. > > -- > You received this message because you are subscribed to the Google Groups > "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to mailto:isar-users%2Bunsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/AS4PR10MB5318C687D0B13B3007FDC20BED102%40AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM > . > [-- Attachment #2: Type: text/html, Size: 7315 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable 2024-04-24 8:02 ` Srinuvasan Arjunan @ 2024-04-24 9:42 ` Schmidt, Adriaan 2024-04-24 10:55 ` Srinuvasan Arjunan 0 siblings, 1 reply; 7+ messages in thread From: Schmidt, Adriaan @ 2024-04-24 9:42 UTC (permalink / raw) To: Srinuvasan Arjunan Cc: Arjunan, Srinu, isar-users, Kiszka, Jan, MOESSBAUER, Felix Srinuvasan Arjunan <srinuvasanasv@gmail.com>, Mittwoch, 24. April 2024 10:03: On Wed, Apr 24, 2024 at 12:57 PM Schmidt, Adriaan <mailto:adriaan.schmidt@siemens.com> wrote: Hi Srinu, > Hi Adriaan, > > Actually this is not my use cases but same intention, originally my use case is am going to install the copyright file based on the selection of LICENSE variable which is configured in the recipe , this selection of copyright file i introduced in debianize.bbclass file, when we build the images it is not building successfully, we faced build error in prebuilt-deb recipe. > > Your suggestion only works with the overrides variable not for others, but my use case is based on the user configure LICENSE in the recipe, it should pick the appropriate copyright file and install it in the debian package. I'm not sure I understand this. The idea behind the dpkg-prebuilt class is to take existing (usually 3rd-party) packages as-is and "inject" them into the Isar build. So when you say "install a copyright file in the debian package", does that mean you unpack, modify, and then re-pack the package? That's not what dpkg-prebuilt is for. However, if you really want to use your original expression: > SRC_URI:append = " ${@ 'file://example-prebuilt_1.0.0-0_bullseye.deb' if d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else 'file://example-prebuilt_1.0.0-0_all.deb' }" I believe this breaks because it contains spaces, and then calling split() on the un-expanded variable (as we do in dpkg-prebuilt) just creates chaos. You should be able to work around this: TEMPORARY = "${@ 'file://example-prebuilt_1.0.0-0_bullseye.deb' if d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else 'file://example-prebuilt_1.0.0-0_all.deb' }" SRC_URI:append = " ${TEMPORARY}" > Please refer my original use case here: > > https://groups.google.com/g/isar-users/c/SCM8yQ0PYXg Again, I don't understand the use case. It seems to me that you're dealing with sources that don't have license information, and that you are trying to "fix" this by attaching a license in the Isar build. IMO the license is an essential part of the source, and should not come via the "side-channel" of the Isar image/integration build. Adriaan > >Many thanks, >Srinu > From: Srinuvasan Arjunan <mailto:srinuvasanasv@gmail.com> Sent: Mittwoch, 24. April 2024 08:59 To: Schmidt, Adriaan (T CED EDC-DE) <mailto:adriaan.schmidt@siemens.com> Cc: Arjunan, Srinu (DI CTO FDS CES LX PBU 2) <mailto:srinuvasan.a@siemens.com>; mailto:isar-users@googlegroups.com; Kiszka, Jan (T CED) <mailto:jan.kiszka@siemens.com>; Moessbauer, Felix (T CED OES-DE) <mailto:felix.moessbauer@siemens.com> Subject: Re: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable On Wed, Apr 24, 2024 at 12:03 PM 'Schmidt, Adriaan' via isar-users <mailto:mailto:isar-users@googlegroups.com> wrote: Hi, srinuvasan.a, Mittwoch, 24. April 2024 08:15: > In some cases we may need to install the prebuilt deb packages based on > some condition or based on distro selection, in this case the present > implementation not works as expected. I've seen dpkg-prebuilt SRC_URIs containing "${PACKAGE_ARCH}" and/or "${DISTRO}", and that seemed to work just fine. Your patch would only change the time at which expansion happens, and that should not make a difference. Could you give some details or an example what you're trying to do? Hi Adriaan, Suppose if you want to install the prebuilt-deb packages based on the selection like below: SRC_URI:append = " ${@ 'file://example-prebuilt_1.0.0-0_bullseye.deb' if d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else 'file://example-prebuilt_1.0.0-0_all.deb' }" The above changes not works with the present implementation, with the help of expanding the SRC_URI variable we can able to get the right packages in WORKDIR. Thanks, Srinu > The reason behind this is SRC_URI variable is not exapnding, remove > False flag to expand SRC_URI variable to get the required field. The current behavior was introduced in ee20790f454030fad40b4ac7b97bf9eaadda48e7. Commit message reads: --- signatures: do not expand SRC_URI This patch reworks modification to SRC_URI to avoid expanding the variables in the string. By that, both cachability issues, as well as information leaks (e.g. repo access tokens) are mitigated. Signed-off-by: Felix Moessbauer <mailto:mailto:felix.moessbauer@siemens.com> --- I assume that this is still valid? Adriaan > Signed-off-by: Srinuvasan A <mailto:mailto:srinuvasan.a@siemens.com> > --- > meta/classes/dpkg-prebuilt.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg- > prebuilt.bbclass > index 8135fc81..1ee1147c 100644 > --- a/meta/classes/dpkg-prebuilt.bbclass > +++ b/meta/classes/dpkg-prebuilt.bbclass > @@ -7,7 +7,7 @@ inherit dpkg-base > > python do_unpack:prepend() { > # enforce unpack=false > - src_uri = (d.getVar('SRC_URI', False) or '').split() > + src_uri = (d.getVar('SRC_URI') or '').split() > if len(src_uri) == 0: > return > def ensure_unpack_false(uri): > -- > 2.34.1 > > -- > You received this message because you are subscribed to the Google Groups > "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to mailto:mailto:isar-users%252Bunsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/20240424061452.506278-1- > srinuvasan.a%http://40siemens.com. -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mailto:mailto:isar-users%252Bunsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/AS4PR10MB5318C687D0B13B3007FDC20BED102%40AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable 2024-04-24 9:42 ` Schmidt, Adriaan @ 2024-04-24 10:55 ` Srinuvasan Arjunan 0 siblings, 0 replies; 7+ messages in thread From: Srinuvasan Arjunan @ 2024-04-24 10:55 UTC (permalink / raw) To: Schmidt, Adriaan Cc: Arjunan, Srinu, isar-users, Kiszka, Jan, MOESSBAUER, Felix [-- Attachment #1: Type: text/plain, Size: 7223 bytes --] On Wed, Apr 24, 2024 at 3:12 PM Schmidt, Adriaan < adriaan.schmidt@siemens.com> wrote: > Srinuvasan Arjunan <srinuvasanasv@gmail.com>, Mittwoch, 24. April 2024 > 10:03: > > On Wed, Apr 24, 2024 at 12:57 PM Schmidt, Adriaan <mailto: > adriaan.schmidt@siemens.com> wrote: > Hi Srinu, > > > > Hi Adriaan, > > > > Actually this is not my use cases but same intention, > originally my use case is am going to install the copyright file based on > the selection of LICENSE variable which is configured in the recipe , this > selection of copyright file i introduced in debianize.bbclass file, when we > build the images it is not building successfully, we faced build error in > prebuilt-deb recipe. > > > > Your suggestion only works with the overrides variable not for others, > but my use case is based on the user configure LICENSE in the recipe, it > should pick the appropriate copyright file and install it in the debian > package. > > I'm not sure I understand this. > > The idea behind the dpkg-prebuilt class is to take existing (usually > 3rd-party) packages as-is and "inject" them into the Isar build. So when > you say "install a copyright file in the debian package", does that mean > you unpack, modify, and then re-pack the package? That's not what > dpkg-prebuilt is for. > > However, if you really want to use your original expression: > > > SRC_URI:append = " ${@ 'file://example-prebuilt_1.0.0-0_bullseye.deb' if > d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else > 'file://example-prebuilt_1.0.0-0_all.deb' }" > > I believe this breaks because it contains spaces, and then calling split() > on the un-expanded variable (as we do in dpkg-prebuilt) just creates chaos. > > You should be able to work around this: > > TEMPORARY = "${@ 'file://example-prebuilt_1.0.0-0_bullseye.deb' if > d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else > 'file://example-prebuilt_1.0.0-0_all.deb' }" > SRC_URI:append = " ${TEMPORARY}" > > > Please refer my original use case here: > > > > https://groups.google.com/g/isar-users/c/SCM8yQ0PYXg > > Again, I don't understand the use case. > It seems to me that you're dealing with sources that don't have license > information, and that you are trying to "fix" this by attaching a license > in the Isar build. > IMO the license is an essential part of the source, and should not come > via the "side-channel" of the Isar image/integration build. > > Adriaan > Hi Adriaan, Already we have one example in our ISAR build system to install the copyright file in the debian package, here we used the MIT licenses. Please refer: https://github.com/ilbers/isar/blob/master/meta-isar/recipes-app/example-raw/files/default-copyright Now I am trying to modularize the installation of copyright based on the recipe configuration, if the recipe configures any open source LICENSE then the respective copyright should install in the debian package. Probably i will introduce one more class should have all the information of this selection, instead of putting them into debianize class. Many thanks, Srinu > > > > >Many thanks, > >Srinu > > > > > From: Srinuvasan Arjunan <mailto:srinuvasanasv@gmail.com> > Sent: Mittwoch, 24. April 2024 08:59 > To: Schmidt, Adriaan (T CED EDC-DE) <mailto:adriaan.schmidt@siemens.com> > Cc: Arjunan, Srinu (DI CTO FDS CES LX PBU 2) <mailto: > srinuvasan.a@siemens.com>; mailto:isar-users@googlegroups.com; Kiszka, > Jan (T CED) <mailto:jan.kiszka@siemens.com>; Moessbauer, Felix (T CED > OES-DE) <mailto:felix.moessbauer@siemens.com> > Subject: Re: [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable > > > > On Wed, Apr 24, 2024 at 12:03 PM 'Schmidt, Adriaan' via isar-users <mailto: > mailto:isar-users@googlegroups.com> wrote: > Hi, > > srinuvasan.a, Mittwoch, 24. April 2024 08:15: > > In some cases we may need to install the prebuilt deb packages based on > > some condition or based on distro selection, in this case the present > > implementation not works as expected. > > I've seen dpkg-prebuilt SRC_URIs containing "${PACKAGE_ARCH}" and/or > "${DISTRO}", and that seemed to work just fine. Your patch would only > change the time at which expansion happens, and that should not make > a difference. > > Could you give some details or an example what you're trying to do? > > Hi Adriaan, > > Suppose if you want to install the prebuilt-deb packages based > on the selection like below: > SRC_URI:append = " ${@ > 'file://example-prebuilt_1.0.0-0_bullseye.deb' if > d.getVar('BASE_DISTRO_CODENAME') == 'bullseye' else > 'file://example-prebuilt_1.0.0-0_all.deb' }" > > The above changes not works with the present implementation, with the help > of expanding the SRC_URI variable we can able to get the right packages in > WORKDIR. > > Thanks, > Srinu > > > The reason behind this is SRC_URI variable is not exapnding, remove > > False flag to expand SRC_URI variable to get the required field. > > The current behavior was introduced in > ee20790f454030fad40b4ac7b97bf9eaadda48e7. > Commit message reads: > --- > signatures: do not expand SRC_URI > This patch reworks modification to SRC_URI to avoid expanding > the variables in the string. By that, both cachability issues, > as well as information leaks (e.g. repo access tokens) are > mitigated. > > Signed-off-by: Felix Moessbauer <mailto:mailto: > felix.moessbauer@siemens.com> > --- > I assume that this is still valid? > > Adriaan > > > Signed-off-by: Srinuvasan A <mailto:mailto:srinuvasan.a@siemens.com> > > --- > > meta/classes/dpkg-prebuilt.bbclass | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg- > > prebuilt.bbclass > > index 8135fc81..1ee1147c 100644 > > --- a/meta/classes/dpkg-prebuilt.bbclass > > +++ b/meta/classes/dpkg-prebuilt.bbclass > > @@ -7,7 +7,7 @@ inherit dpkg-base > > > > python do_unpack:prepend() { > > # enforce unpack=false > > - src_uri = (d.getVar('SRC_URI', False) or '').split() > > + src_uri = (d.getVar('SRC_URI') or '').split() > > if len(src_uri) == 0: > > return > > def ensure_unpack_false(uri): > > -- > > 2.34.1 > > > > -- > > You received this message because you are subscribed to the Google Groups > > "isar-users" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to mailto:mailto:isar-users%252Bunsubscribe@googlegroups.com. > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/isar-users/20240424061452.506278-1- > > srinuvasan.a%http://40siemens.com. > > -- > You received this message because you are subscribed to the Google Groups > "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to mailto:mailto:isar-users%252Bunsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/AS4PR10MB5318C687D0B13B3007FDC20BED102%40AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM > . > [-- Attachment #2: Type: text/html, Size: 10160 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-04-24 10:55 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-04-24 6:14 [PATCH] meta/classes/dpkg-prebuilt: expand SRC_URI variable srinuvasan.a 2024-04-24 6:33 ` Schmidt, Adriaan 2024-04-24 6:59 ` Srinuvasan Arjunan 2024-04-24 7:27 ` Schmidt, Adriaan 2024-04-24 8:02 ` Srinuvasan Arjunan 2024-04-24 9:42 ` Schmidt, Adriaan 2024-04-24 10:55 ` Srinuvasan Arjunan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox