Ports: Add overridable pre_fetch method in .port_include.sh

This adds an overridable pre_fetch method which is called from the fetch
method at the very beginning.

The pre_fetch method can be overridden in your package.sh script so that
you can do any necessary preparations before the fetch method is called.
This commit is contained in:
Kenneth Myhra 2021-07-20 06:40:41 -07:00 committed by Gunnar Beutner
parent f2be1f9326
commit f7161b03ca
Notes: sideshowbarker 2024-07-18 08:32:52 +09:00
2 changed files with 6 additions and 0 deletions

View file

@ -177,10 +177,15 @@ func_defined() {
PATH= command -V "$1" > /dev/null 2>&1
}
func_defined pre_fetch || pre_fetch() {
:
}
func_defined post_fetch || post_fetch() {
:
}
fetch() {
pre_fetch
if [ "$auth_type" = "sig" ] && [ ! -z "${auth_import_key}" ]; then
# import gpg key if not existing locally
# The default keyserver keys.openpgp.org prints "new key but contains no user ID - skipped"

View file

@ -261,6 +261,7 @@ build() {
The following can be overridden, the names should be self-explanatory as they
mostly match the [available options](#options):
- `pre_fetch`
- `post_fetch`
- `pre_configure`
- `configure`.