public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: adam.duskett@amarulasolutions.com,
	 openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v8 1/7] signing-keys.bb: Fix DISTRO_CODENAME truncation
Date: Thu, 02 Apr 2026 13:04:54 +0100	[thread overview]
Message-ID: <f1593f079522f02b1cb45822eb519a860c015fd7.camel@linuxfoundation.org> (raw)
In-Reply-To: <18A28874DB6AAD6A.664470@lists.openembedded.org>

On Thu, 2026-04-02 at 13:00 +0100, Richard Purdie via lists.openembedded.org wrote:
> On Tue, 2026-03-31 at 11:57 +0200, Adam Duskett via lists.openembedded.org wrote:
> > If DISTRO_CODENAME is not set in the environment, bash quietly
> > drops the string resulting in a key such as PACKAGEFEED-GPG-KEY-defaultsetup-
> > 
> > However, when python calls self.d.getVar('DISTRO_CODENAME'), the resulting
> > string is 'None', leading to a configuration file pointing to a key such
> > as PACKAGEFEED-GPG-KEY-defaultsetup-None
> > 
> > Add a default value in signing-keys.bb to set DISTRO_CODENAME to None if
> > DISTRO_CODENAME is not set.
> > 
> > Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
> > ---
> >  meta/recipes-core/meta/signing-keys.bb | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/meta/recipes-core/meta/signing-keys.bb b/meta/recipes-core/meta/signing-keys.bb
> > index 94f4032911..c7713ed4a6 100644
> > --- a/meta/recipes-core/meta/signing-keys.bb
> > +++ b/meta/recipes-core/meta/signing-keys.bb
> > @@ -45,6 +45,10 @@ addtask get_public_keys before do_install
> >  do_get_public_keys[depends] += "gnupg-native:do_populate_sysroot"
> >  
> >  do_install () {
> > +    # Python evalutes an empty DISTRO_CODENAME to "None" which would cause mismatched files
> > +    # as the update config file would show GPG-KEY-${DISTRO}-None but the filename is
> > +    # installed as GPG-KEY-${DISTRO}-
> > +    DISTRO_CODENAME="${DISTRO_CODENAME:-None}"
> >      if [ -f "${B}/rpm-key" ]; then
> >          install -D -m 0644 "${B}/rpm-key" "${D}${sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
> >      fi
> > @@ -57,6 +61,7 @@ do_install () {
> >  }
> >  
> >  do_deploy () {
> > +    DISTRO_CODENAME="${DISTRO_CODENAME:-None}"
> >      if [ -f "${B}/rpm-key" ]; then
> >          install -D -m 0644 "${B}/rpm-key" "${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
> >      fi
> 
> I have a feeling it may be safer just to put something like:
> 
> DISTRO_CODENAME ??= "nodistro"
> 
> into the recipe to handle this?
> 
> My only concern is where else this is being referenced from and whether
> that would have the right scope? Most other usage sites have special
> usage.
> 
> Whether there should be a higher level default, I'm not sure and that
> is a bigger discussion but this would hopefully avoid the immediate
> issue?

As soon as I sent it, I realised the other reference in
meta/lib/oe/package_manager/rpm/__init__.py. Perhaps we should do the
above but also change that code to say:

self.d.getVar('DISTRO_CODENAME') or "nodistro"

?

Cheers,

Richard


      parent reply	other threads:[~2026-04-02 12:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31  9:57 [PATCH v8 1/7] signing-keys.bb: Fix DISTRO_CODENAME truncation Adam Duskett
2026-03-31  9:57 ` [PATCH v8 2/7] libtoml11: new recipe Adam Duskett
2026-03-31  9:57 ` [PATCH v8 3/7] libsolv: explicitly enable comps for rpm packageconfig Adam Duskett
2026-03-31  9:57 ` [PATCH v8 4/7] librepo: add PACKAGECONFIG[sequoia] Adam Duskett
2026-03-31  9:57 ` [PATCH v8 5/7] meta/lib/oe/rootfs.py: assign warn_check regex string to a variable Adam Duskett
2026-03-31  9:57 ` [PATCH v8 6/7] dnf: Upgrade to 5.4.0.0 Adam Duskett
2026-04-02 11:57   ` [OE-core] " Richard Purdie
2026-03-31  9:57 ` [PATCH v8 7/7] libdnf: remove recipe Adam Duskett
2026-04-02 12:00 ` [OE-core] [PATCH v8 1/7] signing-keys.bb: Fix DISTRO_CODENAME truncation Richard Purdie
     [not found] ` <18A28874DB6AAD6A.664470@lists.openembedded.org>
2026-04-02 12:04   ` Richard Purdie [this message]

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=f1593f079522f02b1cb45822eb519a860c015fd7.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=adam.duskett@amarulasolutions.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