summaryrefslogtreecommitdiffstats
path: root/lib/cmd
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-20 16:42:58 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-20 16:47:42 (EDT)
commita284e52ee80674946fd2553b785bb3e8662eb690 (patch)
tree871afa995f9c2fe802402ec2ad34a804e3fa5eb5 /lib/cmd
parenta5839ef83195af1892104c706fbf72c71c2d1b9f (diff)
feed_find_pkgs(): Take callbacks, not file names
Diffstat (limited to 'lib/cmd')
-rw-r--r--lib/cmd/install.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh
index efbd551..02f09bc 100644
--- a/lib/cmd/install.sh
+++ b/lib/cmd/install.sh
@@ -23,6 +23,8 @@ use profile
use fd
cmd_install_optstring='a:P:m:'
+cmd_install_deps=
+cmd_install_fnames=
cmd_install_main()
{
@@ -105,14 +107,16 @@ cmd_install_find_pkgs()
fopen "${chroot}/etc/opkg/opkg.conf" 'w'
opkg_conf_fd=${FD}
+ cmd_install_deps=
+ cmd_install_fnames=
+
while read -r feed_idx feed; do
printf 'src %s %s\n' "${feed_idx}" "${feed}" >&${opkg_conf_fd}
feed_download "${feed}" \
>"${chroot}/var/lib/opkg/lists/${feed_idx}"
feed_find_pkgs "${chroot}/var/lib/opkg/lists/${feed_idx}" \
- "$(profile_dep_fields)" 'profile_include_pkg' \
- "${chroot}/.prokit/${feed_idx}.depends" \
- "${chroot}/.prokit/${feed_idx}.filenames" \
+ "$(profile_dep_fields)" profile_include_pkg \
+ cmd_install_deps_cb cmd_install_fname_cb \
>>"${chroot}/.prokit/packages"
done <<-EOF
$(profile_feeds "${mirror}" "${arch}" "${plat}" "${suite}")
@@ -122,3 +126,19 @@ cmd_install_find_pkgs()
printf 'arch %s 1\n' 'all' "${arch}" 'src' >&${opkg_conf_fd}
fclose ${opkg_conf_fd}
}
+
+cmd_install_deps_cb()
+{
+ local pkg="${1}"
+ local deps="${2}"
+
+ cmd_install_deps="${cmd_install_deps}${pkg}: ${deps}${LF}"
+}
+
+cmd_install_fname_cb()
+{
+ local pkg="${1}"
+ local fname="${2}"
+
+ cmd_install_fnames="${cmd_install_fnames}${pkg} ${fname}${LF}"
+}