From 7083680b1167a9a4f8ef2c4cc8354d23fba58a03 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 25 Apr 2019 19:48:36 -0400 Subject: src/feed.sh: Define functions before references --- (limited to 'src') diff --git a/src/feed.sh b/src/feed.sh index d45e977..94f9b62 100644 --- a/src/feed.sh +++ b/src/feed.sh @@ -112,39 +112,6 @@ feed_download_cert() return 0 } -feed_find_pkgs() -{ - local feed_idx="${1}" - local dep_fields="${2}" - local pkg_cb="${3}" - local deps_cb="${4}" - local fname_cb="${5}" - local md5sum_cb="${6}" - local sha256sum_cb="${7}" - shift 7 - - feed_dep_fields=" $(printf '%s ' ${dep_fields} | tr 'A-Z' 'a-z')" - feed_pkg_cb="${pkg_cb}" - feed_deps_cb="${deps_cb}" - feed_fname_cb="${fname_cb}" - feed_md5sum_cb="${md5sum_cb}" - feed_sha256sum_cb="${sha256sum_cb}" - - feed_pkgs='' - feed_pkg_include='false' - feed_pkg='' - feed_deps='' - - parse_control '-' feed_field_cb feed_para_cb 'Package' <<-EOF - $({ ${GUNZIP} -c -- "${feed_idx}" || cat "${feed_idx}"; } \ - 2>/dev/null) - EOF - - printf '%s\n' "${feed_pkgs# }" - - return 0 -} - feed_field_cb() { local name="${1}" @@ -206,3 +173,36 @@ feed_para_cb() return 0 } + +feed_find_pkgs() +{ + local feed_idx="${1}" + local dep_fields="${2}" + local pkg_cb="${3}" + local deps_cb="${4}" + local fname_cb="${5}" + local md5sum_cb="${6}" + local sha256sum_cb="${7}" + shift 7 + + feed_dep_fields=" $(printf '%s ' ${dep_fields} | tr 'A-Z' 'a-z')" + feed_pkg_cb="${pkg_cb}" + feed_deps_cb="${deps_cb}" + feed_fname_cb="${fname_cb}" + feed_md5sum_cb="${md5sum_cb}" + feed_sha256sum_cb="${sha256sum_cb}" + + feed_pkgs='' + feed_pkg_include='false' + feed_pkg='' + feed_deps='' + + parse_control '-' feed_field_cb feed_para_cb 'Package' <<-EOF + $({ ${GUNZIP} -c -- "${feed_idx}" || cat "${feed_idx}"; } \ + 2>/dev/null) + EOF + + printf '%s\n' "${feed_pkgs# }" + + return 0 +} -- cgit v0.9.1