ソースを参照

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.
Kenneth Myhra 4 年 前
コミット
f7161b03ca
2 ファイル変更6 行追加0 行削除
  1. 5 0
      Ports/.port_include.sh
  2. 1 0
      Ports/README.md

+ 5 - 0
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"

+ 1 - 0
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`.