Bug 7514 - bitbake-layers: canonical name of recipe
Summary: bitbake-layers: canonical name of recipe
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.9 M1
Assignee: Paul Eggleton
QA Contact: Cristina Agurida
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-03-25 14:12 UTC by Patrick Ohly
Modified: 2015-06-05 13:23 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Ohly 2015-03-25 14:12:43 UTC
I'd expect recipes to show up in the "bitbake-layers show-recipes" output under the name of their .bb file.

In Dizzy and master (shortly before Fido) and possibly older releases, one gets unexpected output at least for openssl:

> bitbake-layers show-recipes 2>&1 | grep openssl
nativesdk-openssl:
> bitbake-layers show-recipes openssl
=== Available recipes: ===
openssl:
  meta                 1.0.2
> bitbake-layers show-recipes -f 2>&1 | grep openssl
/data2/yocto/iot-os/meta/recipes-connectivity/openssl/openssl_1.0.2.bb

Note that it shows up as "nativesdk-openssl" in the first command variation.
Comment 1 Richard Purdie 2015-03-25 14:35:44 UTC
Looking at the code in list_recipes() it sorts using sorted(pkg_pn) and only displays the first one matching a given file so "nativesdk-openssl" comes first and takes priority over openssl.

Reassigning to Paul to see what the intent of the code is...
Comment 2 Richard Purdie 2015-03-25 14:50:18 UTC
A possible fix:

diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index c1c65aa..9824629 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -501,7 +501,12 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
 
             if len(allproviders[p]) > 1 or not show_multi_provider_only:
                 pref = preferred_versions[p]
-                preffile = bb.cache.Cache.virtualfn2realfn(pref[1])[0]
+                realfn = bb.cache.Cache.virtualfn2realfn(pref[1])
+                preffile = realfn[0]
+                # We only display once per recipe, we should prefer non extended versions of the recipe if
+                # present (so openssl, not nativesdk-openssl which would otherwise sort first).
+                if realfn[1] and realfn[0] in self.bbhandler.cooker.recipecache.pkg_fn:
+                    continue
                 if preffile not in preffiles:
                     preflayer = self.get_file_layer(preffile)
                     multilayer = False
Comment 3 Paul Eggleton 2015-03-28 05:16:58 UTC
Hmm, yes, this is definitely not desirable.

Richard, your fix looks OK to me (although the comment probably ought to say "e.g. in OpenEmbedded" next to the example). Do you want to send the fix as a patch or shall I?
Comment 5 Cristina Agurida 2015-06-05 13:23:15 UTC
Verified on master: fcc67ae90feeceee204bdb36e45eacf8d056779a