From 9f03969994797220663280ef13fcb187446335ee Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 5 Feb 2015 15:08:22 +0000 Subject: oe-pkgdata-util: improve command-line usage * Use argparse instead of optparse for standardised help output, options and a much cleaner code structure * Look up pkgdata directory automatically so the user doesn't have to specify it * Use standard logging NOTE: this does mean a slight change in syntax - if you do want to specify the pkgdata directory (usually only necessary if you're calling it from within the build process) you need to use the parameter -p (or --pkgdata-dir) and specify this before the command, not after it. Examples: oe-pkgdata-util find-path /sbin/mke2fs oe-pkgdata-util lookup-recipe libelf1 oe-pkgdata-util read-value PKGSIZE libc6 oe-pkgdata-util -p /home/user/oe/build/tmp/sysroots/qemux86-64/pkgdata read-value PKGSIZE libc6 (From OE-Core rev: 04dc571ac7c26f0dcf1a1fcd466482e22519998d) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- meta/classes/buildhistory.bbclass | 2 +- meta/classes/license.bbclass | 2 +- meta/lib/oe/package_manager.py | 2 +- meta/lib/oeqa/runtime/_ptest.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'meta') diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 90cfe4f954..211dcf18b5 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -374,7 +374,7 @@ buildhistory_get_installed() { printf "" > $1/installed-package-sizes.tmp cat $pkgcache | while read pkg pkgfile pkgarch do - size=`oe-pkgdata-util read-value ${PKGDATA_DIR} "PKGSIZE" ${pkg}_${pkgarch}` + size=`oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PKGSIZE" ${pkg}_${pkgarch}` if [ "$size" != "" ] ; then echo "$size $pkg" >> $1/installed-package-sizes.tmp fi diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 21465d8d00..13c1a0fddf 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -80,7 +80,7 @@ license_create_manifest() { if [ "${COPY_LIC_DIRS}" = "1" ]; then for pkg in ${INSTALLED_PKGS}; do mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg} - pkged_pn="$(oe-pkgdata-util lookup-recipe ${PKGDATA_DIR} ${pkg})" + pkged_pn="$(oe-pkgdata-util -p ${PKGDATA_DIR} lookup-recipe ${pkg})" for lic in `ls ${LICENSE_DIRECTORY}/${pkged_pn}`; do # Really don't need to copy the generics as they're # represented in the manifest and in the actual pkg licenses diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 6f49c69110..fcf05dc282 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py @@ -529,7 +529,7 @@ class PackageManager(object): return cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"), - "glob", self.d.getVar('PKGDATA_DIR', True), installed_pkgs_file, + "-p", self.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file, globs] try: bb.note("Installing complementary packages ...") diff --git a/meta/lib/oeqa/runtime/_ptest.py b/meta/lib/oeqa/runtime/_ptest.py index 4c58dc1d7f..53b0807c4a 100644 --- a/meta/lib/oeqa/runtime/_ptest.py +++ b/meta/lib/oeqa/runtime/_ptest.py @@ -86,7 +86,7 @@ class PtestRunnerTest(oeRuntimeTest): installed_pkgs.write(self.pkgs_list.list("arch")) cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"), - "glob", oeRuntimeTest.tc.d.getVar('PKGDATA_DIR', True), installed_pkgs_file, + "-p", oeRuntimeTest.tc.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file, globs] try: bb.note("Installing complementary packages ...") -- cgit v1.2.3-54-g00ecf