-
Notifications
You must be signed in to change notification settings - Fork 40
`build.sh` Helpers
Ben Cambourne edited this page Jul 11, 2020
·
1 revision
These helpers are documented in the template docker image build.sh
.
The template build.sh
also has instructions on examples of installing packages manually, or removing packages, which haven’t been replicated here.
This wiki page is focused on the kubler specific helpers.
update_use 'dev-libs/some-lib' '+feature' '-some_other_feature'
Add a package to Portage’s package.provided file, effectively skipping it during installation (provide_package
)
provide_package 'dev-lang/some-package'
This can be useful to install a package from a parent image again, it may be needed at build time
unprovide_package 'dev-lang/some-package'
Only needed when ${_packages} is empty, initializes PACKAGES.md
init_docs "${_tmpl_namespace}/${_tmpl_image_name}"
Thin wrapper for sed
that fails the build if no match was found, default sed delimiter is %
sed-or-die '^foo' 'replaceval' "${_EMERGE_ROOT}"/etc/foo.conf
Download file at url to /distfiles if it doesn’t exist yet, file name is derived from last url fragment
download_file "$url"`
echo "${__download_file}"
# Same as above but set a custom file name
download_file "$url" my_file_v1.tar.gz
# Same as above but pass arbitrary additional args to curl
download_file "$url" my_file_v1.tar.gz '-v' '--cookie' 'foo'