diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-08-22 10:43:26 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-08-22 10:43:26 (EDT) |
commit | 2f2fa67818ac18d146852ebb9d40cb7eda8c16e3 (patch) | |
tree | 959bfcc1e6d07f643140544692b0102afef8a4ac /lib/cmd | |
parent | 7f08f8318c1eaac40fc3606eeb13956f17bfb08a (diff) |
Collect package checksums
Diffstat (limited to 'lib/cmd')
-rw-r--r-- | lib/cmd/install.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh index 2605831..4483843 100644 --- a/lib/cmd/install.sh +++ b/lib/cmd/install.sh @@ -26,6 +26,8 @@ use pkg cmd_install_optstring='a:P:m:F' cmd_install_deps= cmd_install_fnames= +cmd_install_md5sums= +cmd_install_sha256sums= cmd_install_feed_url= cmd_install_main() @@ -130,6 +132,8 @@ cmd_install_find_pkgs() cmd_install_deps= cmd_install_fnames= + cmd_install_md5sums= + cmd_install_sha256sums= fopen "${chroot}/.prokit/packages" 'w' pkgs_fd=${FD} @@ -147,7 +151,9 @@ cmd_install_find_pkgs() cmd_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 >&${pkgs_fd} + cmd_install_deps_cb cmd_install_fname_cb \ + cmd_install_md5sum_cb cmd_install_sha256sum_cb \ + >&${pkgs_fd} done <<-EOF $(profile_feeds "${mirror}" "${arch}" "${plat}" "${suite}") EOF @@ -179,6 +185,24 @@ cmd_install_fname_cb() "${pkg}" "${cmd_install_feed_url}" "${fname}")" } +cmd_install_md5sum_cb() +{ + local pkg="${1}" + local md5sum="${2}" + + cmd_install_md5sums="$(printf '%s\n%s %s' "${cmd_install_md5sums}" \ + "${pkg}" "${md5sum}")" +} + +cmd_install_sha256sum_cb() +{ + local pkg="${1}" + local sha256sum="${2}" + + cmd_install_sha256sums="$(printf '%s\n%s %s' \ + "${cmd_install_sha256sums}" "${pkg}" "${sha256sum}")" +} + cmd_install_get_pkgs() { local chroot="${1}" |