Bug 10216

Summary: Suggested (currently missing) documentation for oe-pkgdata-util
Product: [Documentation] Reference Reporter: ulfalizer
Component: handbookAssignee: Scott Rifenbark <srifenbark>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: bluelightning, poky.doc.watcher, poky.watcher, srifenbark
Version: 2.2   
Target Milestone: 2.2 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: 07 Sept 2016: RESOLVED
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Done (doc changes complete)

Description ulfalizer 2016-09-03 15:14:05 UTC
Hello,

oe-pkgdata-util currently seems to be completely undocumented. I suggest adding
the following section:

  2.3.3. Viewing Package Information with oe-pkgdata-util
  
  oe-pkgdata-util is a command-line utility that queries [PKGDATA_DIR] to
  display various package-related information. Only packages that have already
  been built can be queried.
  
  Listed below are a few of the available oe-pkgdata-util subcommands. The
  standard * and ? globbing wildcards can be used in package names and paths.
  
    * oe-pkgdata-util list-pkgs [<pattern>]: Lists all packages that have been
      built, optionally limiting the match to packages that match <pattern>.
  
    * oe-pkgdata-util list-pkg-files <package> ...: Lists the files and
      directories contained in the given packages.
  
      Note {
      A different way to view the contents of a package is to look at the
      ${WORKDIR}/packages-split directory of the recipe that generates the
      package. This directory is created by the [do_package] task and has one
      subdirectory for each package the recipe generates, containing the files
      stored in that package.
      
      If you want to inspect the ${WORKDIR}/packages-split directory, make sure
      that you are not running with
      [rm_work](http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#ref-classes-rm-work)
      enabled when building the recipe.
      }
  
    * oe-pkgdata-util find-path <path> ...: Lists the names of the packages
      that contains the given paths. For example,
      'oe-pkgdata-util find-path /usr/share/man/man1/make.1' might return
      'make-doc: /usr/share/man/man1/make.1'.
  
    * oe-pkgdata-util lookup-recipe <package> ...: Lists the name of the recipe
      that produces the given packages.
  
  See 'oe-pkgdata-util --help' and 'oe-pkgdata-util <subcommand> --help' for
  more information on oe-pkgdata-util.


Cheers,
Ulf
Comment 1 ulfalizer 2016-09-03 16:27:53 UTC
Small nit: "Only packages that have already been built can be queried" could say "only information on packages that have already been built can be queried".
Comment 2 ulfalizer 2016-09-03 20:12:03 UTC
Small nit 2: "Lists the names of the packages that contains the given paths" should say "contain", not "contains".
Comment 3 Scott Rifenbark 2016-09-07 20:34:51 UTC
Ulf, 

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#viewing-package-information-with-oe-pkgdata-util for the added section.  Let me know if it is okay.

Regarding nit #2 -- Nice realization... that is a subtle grammar error that nails a lot of people :)

Scott
Comment 4 ulfalizer 2016-09-07 21:04:56 UTC
Thanks! :)

Just a few nits below:

 - The final "directory" in "if you want to inspect the ${WORKDIR}/packages-split
   directory" seems to accidentally have gotten monospaced.

 - Self-nit: This version of the find-path description might flow a bit better:

     oe-pkgdata-util find-path path ...: Lists the names of the packages that
     contain the given paths. For example, the following tells us that the
     make-doc package contains /usr/share/man/man1/make.1:
    
         $ oe-pkgdata-util find-path /usr/share/man/man1/make.1
         make-doc: /usr/share/man/man1/make.1


 - Self-nit:

     If you want to inspect the ${WORKDIR}/packages-split directory, make sure
     that you are not running with rm_work enabled when building the recipe.

   could be shortened to

     If you want to inspect the ${WORKDIR}/packages-split directory, make sure that
     rm_work is not enabled when you build the recipe.


Cheers,
Ulf
Comment 5 ulfalizer 2016-09-07 21:21:39 UTC
Self-nit v2: Reversing the order of the path and the package matches the
command more closely. :P

    For example, the following tells us that /usr/share/man/man1/make.1
    is contained in the make-doc package.
Comment 6 Scott Rifenbark 2016-09-07 21:44:58 UTC
Ulf, 

Good changes.  Thanks.  See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#viewing-package-information-with-oe-pkgdata-util.

Scott
Comment 7 ulfalizer 2016-09-07 21:49:06 UTC
Note the "self-nit v2" I added in a separate comment as well. It's meant as a new version of the first nit. :)

If you're fine with that change, you could close the bug afterwards too.

Thanks,
Ulf
Comment 8 Scott Rifenbark 2016-09-07 22:19:33 UTC
Completely missed that one... sorry.  It is in at http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#viewing-package-information-with-oe-pkgdata-util

setting to RESOLVED and putting the doc flag to done.

Thanks,
Scott
Comment 9 ulfalizer 2016-09-07 23:43:06 UTC
Ops... found one more mistake. The correct description of lookup-recipe is as follows (s/recipe/recipes/, s/produces/produce/):

  oe-pkgdata-util lookup-recipe package ...: Lists the name of the recipes that
  produce the given packages. 


Sorry about that,
Ulf