7.8.9 ‘pkg_gentree()

This function generates a dependency tree for the given package. The output and the dependency generation can be configured through a series of keys given as the second argument. Those keys are:

b

Include the base packages to the dependency tree.

f

Include the given package itself to the generated tree.

x

Do not include make dependencies of the package.

r

Print the generated tree in reverse order.

n

Print all packages in a single line instead of a package per line.

  1. Examples

    This example uses the ‘cpt’ package for Carbs Linux. The package itself is listed to depend on ‘curl’ and ‘rsync’. Here is the output of calling the function for cpt directly:

    $ pkg_gentree cpt
    bearssl
    ca-certificates
    zlib
    curl
    rsync
    

    The example above shows that even though ‘cpt’ itself only depends on ‘curl’ and ‘rsync’, we also indirectly need ‘zlib’, ‘bearssl’ (for ‘curl’), and ‘ca-certificates’ (for ‘bearssl’).

    # Print the dependency tree reverse sorted in a single line:
    $ pkg_gentree cpt rn
    rsync curl zlib ca-certificates bearssl