Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion contrib/bash-completion/bob
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ __bob_complete_dir()
compgen -d -P "$2" -S / -- "$1" ) )
}

# Complete file
__bob_complete_file()
{
local IFS=$'\n'
COMPREPLY=( $(for i in "${chroot[@]}" ; do eval ls "$i" || exit ; done
compgen -f -P "$2" -- "$1" ) )
for ((i=0; i < ${#COMPREPLY[@]}; i++)); do
[ -d "${COMPREPLY[$i]}" ] && COMPREPLY[$i]=${COMPREPLY[$i]}/
done
}

__bob_commands="build dev clean graph help init jenkins ls project status \
query-scm query-recipe query-path query-meta show layers \
ls-recipes"
Expand Down Expand Up @@ -121,14 +132,18 @@ __bob_cook()
{
if [[ "$prev" = "--destination" ]] ; then
__bob_complete_dir "$cur"
elif [[ "$prev" == "--bundle" || "$prev" == "--unbundle" ]]; then
__bob_complete_file "$cur"
elif [[ "$prev" = "--download" ]] ; then
__bob_complete_words "yes no deps forced forced-deps forced-fallback"
elif [[ "$prev" = "--download-layer" ]] ; then
__bob_complete_words "yes= no= forced="
elif [[ "$prev" = "--always-checkout" ]] ; then
COMPREPLY=( )
elif [[ "$prev" = "--bundle-indeterministic" ]] ; then
__bob_complete_words "yes no fail"
else
__bob_complete_path "--destination -j --jobs -k --keep-going -f --force -n --no-deps -p --with-provided --without-provided -A --no-audit --audit -b --build-only -B --checkout-only --normal --clean --incremental --always-checkout --resume -q --quiet -v --verbose --no-logfiles -D -c -e -E -M --upload --link-deps --no-link-deps --download --download-layer --shared --no-shared --install --no-install --sandbox --no-sandbox --slim-sandbox --dev-sandbox --strict-sandbox --clean-checkout --attic --no-attic"
__bob_complete_path "--destination -j --jobs -k --keep-going -f --force -n --no-deps -p --with-provided --without-provided -A --no-audit --audit -b --build-only -B --checkout-only --normal --clean --incremental --always-checkout --resume -q --quiet -v --verbose --no-logfiles -D -c -e -E -M --upload --link-deps --no-link-deps --download --download-layer --shared --no-shared --install --no-install --sandbox --no-sandbox --slim-sandbox --dev-sandbox --strict-sandbox --clean-checkout --attic --no-attic --bundle --bundle-exclude --bundle-indeterministic --bundle-vcs --unbundle"
fi
}

Expand Down
20 changes: 20 additions & 0 deletions doc/manpages/bob-build-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,23 @@ Options

This is the default unless the user changed it in ``default.yaml``.

``--bundle BUNDLE``
Bundle all the sources needed to build the package. The output of this is
a zip-file containing all sources required to build the package. This also
enables `--always-checkout` and `--clean-checkout` and can not be used
along with `--build-only`.

``--bundle-exclude BUNDLE_EXCLUDE``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this a regex? That would be more consistent with --always-checkout and --download=packages= and --download-layer=.

Do not add packages matching a given regular expression (regex) to the
bundle. Can be specified multiple times.

``--bundle-vcs``
Add files used by version control systems to the bundle.

``--unbundle BUNDLE``
Try to download sources from BUNDLE first. The BUNDLE should be the zip
file created with the ``--bundle`` option.

``--clean``
Do clean builds by clearing the build directory before executing the build
commands. It will *not* clean all build results (e.g. like ``make clean``)
Expand Down Expand Up @@ -363,6 +380,9 @@ Options
``-q, --quiet``
Decrease verbosity (may be specified multiple times)

``--unbundle``
Use bundle specified by ``--bundle`` as source input.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to make --bundle and --unbundle mutually exclusive options that both take a file name. At least that was what I think it does when reading the names. It also makes sense because --bundle implies --always-checkout.


``-v, --verbose``
Increase verbosity (may be specified multiple times)

Expand Down
2 changes: 2 additions & 0 deletions doc/manpages/bob-build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Synopsis
[--install | --no-install]
[--sandbox | --slim-sandbox | --dev-sandbox | --strict-sandbox | --no-sandbox]
[--clean-checkout] [--attic | --no-attic]
[--bundle BUNDLE | --unbundle BUNDLE]
[--bundle-exclude BUNDLE_EXCLUDE] [--bundle-vcs]
PACKAGE [PACKAGE ...]

Description
Expand Down
2 changes: 2 additions & 0 deletions doc/manpages/bob-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Synopsis
[--install | --no-install]
[--sandbox | --slim-sandbox | --dev-sandbox | --strict-sandbox | --no-sandbox]
[--clean-checkout] [--attic | --no-attic]
[--bundle BUNDLE | --unbundle BUNDLE]
[--bundle-exclude BUNDLE_EXCLUDE] [--bundle-vcs]
PACKAGE [PACKAGE ...]

Description
Expand Down
27 changes: 27 additions & 0 deletions doc/tutorial/compile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,30 @@ the zlib packages: ::
.. raw:: html

<iframe src="../_static/sandbox.html" height="500px" width="100%"></iframe>

Using source bundles
====================

A source code bundle is a zip file containing all the sources required to build a
package. Such a bundle can be used to compile on a air gapped system, to
archive the build input, to transfer the sources to a reviewer, ...

To create a bundle for a given package you need to build this package using
:ref:`manpage-dev` or :ref:`manpage-build` with the ``--bundle`` option. This
option takes one argument specifying the name of the bundle file. Several other
`bundle` arguments are available to control what goes into the bundle. Refer to
the manpages for a detailed description of those.

For example to bundle the sources needed to build `my_package` use: ::

$ bob build my_package --bundle my_package_bundle.zip

After that you can take the my_package_bundle.tar to another system and use: ::

$ bob build my_package --unbundle my_package_bundle.zip

to build `my_package` from the bundled-sources.

.. note::
The recipes and `bob` are not part of the bundle and need to be handled
separately. It's strongly recommended to use matching recipes.
Loading
Loading