summaryrefslogtreecommitdiffstats
path: root/lib/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cmd')
-rw-r--r--lib/cmd/install.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh
index 696f24c..9b90fff 100644
--- a/lib/cmd/install.sh
+++ b/lib/cmd/install.sh
@@ -160,13 +160,20 @@ cmd_install_fname_cb()
cmd_install_get_pkgs()
{
local chroot="${1}"
+ local status_fd=
local pkg=
local fname=
local file=
+ local control=
+ local field=
+ local printed=
mkdir -p "${chroot}/var/cache/opkg/archives" "${chroot}/tmp/opkg" \
"${chroot}/var/lib/opkg/info"
+ fopen "${chroot}/var/lib/opkg/status" 'w'
+ status_fd=${FD}
+
for pkg in $(cat "${chroot}/.prokit/packages"); do
info "$(get_msg 'cmd_install_downloading_pkg')" "${pkg}"
fname="$(printf '%s\n' "${cmd_install_fnames}" | \
@@ -195,5 +202,32 @@ cmd_install_get_pkgs()
"${chroot}/var/lib/opkg/info/${pkg}.${file##*/}"
done
rmdir "${chroot}/tmp/opkg/${pkg}"
+
+ # Write status file.
+ control="${chroot}/var/lib/opkg/info/${pkg}.control"
+ for field in Package Version Depends Recommends Suggests \
+ Provides Replaces Conflicts; do
+ grep "^${field}: " "${control}" >&${status_fd}
+ done
+ printf 'Status: install ok unpacked\n' >&${status_fd}
+ for field in Essential Architecture; do
+ grep "^${field}: " "${control}" >&${status_fd}
+ done
+ if [ -r "${chroot}/var/lib/opkg/info/${pkg}.conffiles" ]; then
+ printed=false
+ while read -r file; do
+ ${printed} || printf 'Conffiles:\n' \
+ >&${status_fd}
+ printf ' %s %s\n' "${file}" "$(md5sum \
+ "${chroot}/${file}" | cut -d' ' -f1)" \
+ >&${status_fd}
+ printed=true
+ done <"${chroot}/var/lib/opkg/info/${pkg}.conffiles"
+ fi
+ printf 'Installed-Time: %s\n\n' "$(date '+%s')" >&${status_fd}
+
+ rm -f "${chroot}/${fname}"
done
+
+ fclose ${status_fd}
}