From 13ca657716d5b6920629b68ade7781212f5833d7 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 25 Apr 2019 23:33:12 -0400 Subject: src/package/2.sh: Define callbacks before references --- diff --git a/src/package/2.sh b/src/package/2.sh index 4fa4286..75785a9 100644 --- a/src/package/2.sh +++ b/src/package/2.sh @@ -20,6 +20,22 @@ package_2_build_deps= +package_2_build_deps_field_cb() +{ + local name="${1}" + local value="${2}" + shift 2 + + name="$(printf '%s\n' "${name}" | tr 'A-Z' 'a-z')" + + if [ "x${name}" = 'xbuild-depends' ]; then + package_2_build_deps="${value}" + return 1 + fi + + return 0 +} + package_2_get_build_deps() { local arch="${1}" @@ -36,18 +52,13 @@ package_2_get_build_deps() return 0 } -package_2_build_deps_field_cb() +package_2_substvar_cb() { local name="${1}" local value="${2}" shift 2 - name="$(printf '%s\n' "${name}" | tr 'A-Z' 'a-z')" - - if [ "x${name}" = 'xbuild-depends' ]; then - package_2_build_deps="${value}" - return 1 - fi + set_substvar "${name}" "${value}" return 0 } @@ -68,14 +79,3 @@ package_2_set_substvars() return 0 } - -package_2_substvar_cb() -{ - local name="${1}" - local value="${2}" - shift 2 - - set_substvar "${name}" "${value}" - - return 0 -} -- cgit v0.9.1