From f7161b03caff67c2a40fd845657889048a15aa1a Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Tue, 20 Jul 2021 06:40:41 -0700 Subject: [PATCH] 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. --- Ports/.port_include.sh | 5 +++++ Ports/README.md | 1 + 2 files changed, 6 insertions(+) diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 561b70e3848..a7e1967958a 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -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" diff --git a/Ports/README.md b/Ports/README.md index 2b21d1b2863..8b3e2106c4e 100644 --- a/Ports/README.md +++ b/Ports/README.md @@ -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`.