Bug 4368 - Way to list all the PACKAGECONFIG's flags
Summary: Way to list all the PACKAGECONFIG's flags
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.5
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 1.5 M4
Assignee: Hongxu Jia
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-04-22 06:34 UTC by Robert Yang
Modified: 2013-09-11 06:55 UTC (History)
10 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Yang 2013-04-22 06:34:34 UTC
We have a lot recipes use the PACKAGECONFIG, we need a way to list them so that we can know which recipe will be affected when we add or remove a recipe(or feature) from the image, e.g.:

In cairo.inc:
PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
           ${@base_contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}"
PACKAGECONFIG[x11] = "--with-x=yes,--without-x,${X11DEPENDS}"
PACKAGECONFIG[directfb] = "--enable-directfb=yes,,directfb"

and pulseaudio.inc:
PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
                   ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
                   ${@base_contains('DISTRO_FEATURES', 'x11', 'gtk x11', '', d)}"
PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,bluez4 sbc"
PACKAGECONFIG[gtk] = "--enable-gtk2,--disable-gtk2,gtk+"
PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb"


The flags are x11 and directfb, the way should list a list:

cairo: x11 directfb
...
pulseaudio: bluez gtk systemd x11
Comment 1 Hongxu Jia 2013-08-01 11:07:24 UTC
Usage: list-packageconfig-flag.py [OPTION] [METADIR]...
  list recipes which have PACKAGECONFIG's flags in METADIR

OPTION:
  -h, --help  display this help and exit
  -f, --flag  list PACKAGECONFIG's flags and all affected recipes in METADIR

EXAMPLE:
list-packageconfig-flag.py poky/meta poky/meta-yocto
RECIPE NAME          PACKAGECONFIG's flag
=========================================
libarchive_2.8.5.bb  acl xattr largefile zlib bz2 xz openssl libxml2 expat
strace_4.8.bb        libaio acl
connman.inc          wifi bluetooth 3g tist openvpn vpnc l2tp pptp wispr

list-packageconfig-flag.py -f poky/meta poky/meta-yocto
PACKAGECONFIG's flag     RECIPE NAME
====================================
speex                    gstreamer1.0-plugins-good.inc
keyutils                 rpm_5.4.9.bb
gallium-egl              mesa.inc
Comment 2 Hongxu Jia 2013-08-03 08:09:23 UTC
Reference Paul's bitbake parser examples, I think we could do
more and better, so redesign the script.

Usage: list-packageconfig-flags.py [OPTION]
  list all available package names which have PACKAGECONFIG flags

OPTION:
  -h, --help    display this help and exit
  -p, --prefer  list package names with preferred version
  -f, --flag    list available PACKAGECONFIG flags and all affected packages

EXAMPLE:
list-packageconfig-flags.py
PACKAGE NAME              PACKAGECONFIG flags
=======================================================================
connman-1.16              wifi bluetooth 3g tist openvpn vpnc l2tp pptp wispr
subversion-1.7.10         sasl
subversion-1.6.15         sasl
subversion-native-1.7.10  sasl
subversion-native-1.6.15  sasl
	

list-packageconfig-flags.py -p
PACKAGE NAME              PACKAGECONFIG flags
=======================================================================
connman-1.16              wifi bluetooth 3g tist openvpn vpnc l2tp pptp wispr
subversion-1.7.10         sasl
subversion-native-1.7.10  sasl

list-packageconfig-flags.py -f
PACKAGECONFIG flags    PACKAGE NAME
=========================================
largefile              nativesdk-libarchive-2.8.5  libarchive-2.8.5
speex                  gstreamer1.0-plugins-good-1.0.7  gstreamer1.0-plugins-good-git
gallium-egl            mesa-9.1.5  mesa-9.1.3+gitAUTOINC+5a925cc550
keyutils               rpm-5.4.9 rpm-native-5.4.9

list-packageconfig-flags.py -f -p
PACKAGECONFIG flags    PACKAGE NAME
====================================
largefile              nativesdk-libarchive-2.8.5  libarchive-2.8.5
speex                  gstreamer1.0-plugins-good-1.0.7
gallium-egl            mesa-9.1.5
keyutils               rpm-5.4.9 rpm-native-5.4.9
Comment 3 Hongxu Jia 2013-08-07 01:35:27 UTC
Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2ff22490aa65df2fe895f3ea3b0c3e7e674243da

Test Case:
Enter the build directory and setup OE Build Environment

list-packageconfig-flags.py
PACKAGE NAME                               PACKAGECONFIG FLAGS
==============================================================
alsa-tools-1.0.26.1                        defaultval gtk+
avahi-ui-0.6.31                            defaultval python
bluez4-4.101                               alsa defaultval pie

list-packageconfig-flags.py -f
PACKAGECONFIG FLAG     PACKAGE NAMES
====================================
3g                     connman-1.16        
avahi                  cups-1.6.3  pulseaudio-4.0
beecrypt               rpm-5.4.9  rpm-native-5.4.9

list-packageconfig-flags.py -a
==================================================
gtk+-2.24.18
/home/jiahongxu/yocto/poky/meta/recipes-gnome/gtk+/gtk+_2.24.18.bb
PACKAGECONFIG x11
PACKAGECONFIG[x11] --with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}

xf86-video-intel-2.21.9
/home/jiahongxu/yocto/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.21.9.bb
PACKAGECONFIG None
PACKAGECONFIG[xvmc] --enable-xvmc,--disable-xvmc,libxvmc
PACKAGECONFIG[sna] --enable-sna,--disable-sna

//Hongxu
Comment 4 Yi Zhao 2013-09-11 06:55:16 UTC
Verified with 1.5 M4 RC3.

poky: master/ed3ef0823fde89371a473d20c0127c0bd16d062b