diff options
-rw-r--r-- | lib/install.sh | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/lib/install.sh b/lib/install.sh index d10e07e..ef89df6 100644 --- a/lib/install.sh +++ b/lib/install.sh @@ -26,11 +26,11 @@ use profile use fd use pkg -cmd_install_deps= -cmd_install_fnames= -cmd_install_md5sums= -cmd_install_sha256sums= -cmd_install_feed_url= +install_deps= +install_fnames= +install_md5sums= +install_sha256sums= +install_feed_url= install_system() { @@ -50,9 +50,9 @@ install_system() >"${chroot}/prokit/installing" info "$(get_msg 'cmd_install_find_pkgs')" - cmd_install_find_pkgs "${mirror}" "${suite}" "${arch}" "${plat}" \ + install_find_pkgs "${mirror}" "${suite}" "${arch}" "${plat}" \ "${chroot}" - cmd_install_get_pkgs "${chroot}" + install_get_pkgs "${chroot}" info "$(get_msg 'cmd_install_configuring')" if ! ${foreign}; then @@ -64,7 +64,7 @@ install_system() rm "${chroot}/prokit/installing" } -cmd_install_find_pkgs() +install_find_pkgs() { local mirror="${1}" local suite="${2}" @@ -83,10 +83,10 @@ cmd_install_find_pkgs() fopen "${chroot}/etc/opkg/opkg.conf" 'w' opkg_conf_fd=${FD} - cmd_install_deps= - cmd_install_fnames= - cmd_install_md5sums= - cmd_install_sha256sums= + install_deps= + install_fnames= + install_md5sums= + install_sha256sums= fopen "${chroot}/.prokit/packages" 'w' pkgs_fd=${FD} @@ -101,11 +101,11 @@ cmd_install_find_pkgs() >&${opkg_conf_fd} feed_download "${feed}" ${gzip} \ >"${chroot}/var/lib/opkg/lists/${feed_idx}" - cmd_install_feed_url="${feed%/*}" + install_feed_url="${feed%/*}" feed_find_pkgs "${chroot}/var/lib/opkg/lists/${feed_idx}" \ "$(profile_dep_fields)" profile_include_pkg \ - cmd_install_deps_cb cmd_install_fname_cb \ - cmd_install_md5sum_cb cmd_install_sha256sum_cb \ + install_deps_cb install_fname_cb \ + install_md5sum_cb install_sha256sum_cb \ >&${pkgs_fd} done <<-EOF $(profile_feeds "${mirror}" "${arch}" "${plat}" "${suite}") @@ -117,46 +117,46 @@ cmd_install_find_pkgs() fclose ${pkgs_fd} pkgs="$(resolve_deps "$(cat "${chroot}/.prokit/packages")" \ - "${cmd_install_deps}" | xargs printf '%s\n' | sort -u)" + "${install_deps}" | xargs printf '%s\n' | sort -u)" printf '%s\n' "${pkgs}" >"${chroot}/.prokit/packages" } -cmd_install_deps_cb() +install_deps_cb() { local pkg="${1}" local deps="${2}" - cmd_install_deps="${cmd_install_deps}${pkg}: ${deps}${LF}" + install_deps="${install_deps}${pkg}: ${deps}${LF}" } -cmd_install_fname_cb() +install_fname_cb() { local pkg="${1}" local fname="${2}" - cmd_install_fnames="$(printf '%s\n%s %s/%s' "${cmd_install_fnames}" \ - "${pkg}" "${cmd_install_feed_url}" "${fname}")" + install_fnames="$(printf '%s\n%s %s/%s' "${install_fnames}" \ + "${pkg}" "${install_feed_url}" "${fname}")" } -cmd_install_md5sum_cb() +install_md5sum_cb() { local pkg="${1}" local md5sum="${2}" - cmd_install_md5sums="$(printf '%s\n%s %s' "${cmd_install_md5sums}" \ + install_md5sums="$(printf '%s\n%s %s' "${install_md5sums}" \ "${pkg}" "${md5sum}")" } -cmd_install_sha256sum_cb() +install_sha256sum_cb() { local pkg="${1}" local sha256sum="${2}" - cmd_install_sha256sums="$(printf '%s\n%s %s' \ - "${cmd_install_sha256sums}" "${pkg}" "${sha256sum}")" + install_sha256sums="$(printf '%s\n%s %s' \ + "${install_sha256sums}" "${pkg}" "${sha256sum}")" } -cmd_install_get_pkgs() +install_get_pkgs() { local chroot="${1}" local status_fd= @@ -177,11 +177,11 @@ cmd_install_get_pkgs() for pkg in $(cat "${chroot}/.prokit/packages"); do info "$(get_msg 'cmd_install_downloading_pkg')" "${pkg}" - fname="$(printf '%s\n' "${cmd_install_fnames}" | \ + fname="$(printf '%s\n' "${install_fnames}" | \ sed -n "s/^${pkg} //p")" - md5sum="$(printf '%s\n' "${cmd_install_md5sums}" | \ + md5sum="$(printf '%s\n' "${install_md5sums}" | \ sed -n "s/^${pkg} //p")" - sha256sum="$(printf '%s\n' "${cmd_install_sha256sums}" | \ + sha256sum="$(printf '%s\n' "${install_sha256sums}" | \ sed -n "s/^${pkg} //p")" wget -q -O "${chroot}/var/cache/opkg/archives/${fname##*/}" \ "${fname}" || \ |