From c7a130bed358b95f88209a37b50eead355e9c0c8 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 19 Apr 2019 18:24:57 -0400 Subject: install_*_pkgs(): Use profile_opkg_state_dir() --- (limited to 'src') diff --git a/src/install.sh b/src/install.sh index 40d4418..ecd312e 100644 --- a/src/install.sh +++ b/src/install.sh @@ -125,7 +125,7 @@ install_find_pkgs() local dl_func= local pkgs= - mkdir -p "${root}/etc/opkg" "${root}/var/lib/opkg/lists" + mkdir -p "${root}/etc/opkg" "${root}/$(profile_opkg_state_dir)/lists" if ! fopen "${root}/etc/opkg/opkg.conf" 'w'; then return 1 fi @@ -175,12 +175,13 @@ install_find_pkgs() printf '%s %s %s\n' "${type}" "${name}" \ "${base_url}" >&${opkg_conf_fd} if ! ${dl_func} "${base_url}" \ - "${root}/var/lib/opkg/lists/${name}" \ + "${root}/$(profile_opkg_state_dir)/lists/${name}" \ ${gzip} "${root}"; then return 1 fi install_feed_url="${base_url}" - feed_find_pkgs "${root}/var/lib/opkg/lists/${name}" \ + feed_find_pkgs \ + "${root}/$(profile_opkg_state_dir)/lists/${name}" \ "$(profile_dep_fields)" profile_include_pkg \ install_deps_cb install_fname_cb \ install_md5sum_cb install_sha256sum_cb \ @@ -260,9 +261,9 @@ install_get_pkgs() local printed= mkdir -p "${root}/var/cache/opkg/archives" "${root}/tmp/opkg" \ - "${root}/var/lib/opkg/info" + "${root}/$(profile_opkg_state_dir)/info" - if ! fopen "${root}/var/lib/opkg/status" 'w'; then + if ! fopen "${root}/$(profile_opkg_state_dir)/status" 'w'; then return 1 fi status_fd=${FD} @@ -314,16 +315,18 @@ install_get_pkgs() tar -xz ) tar -tzf "${root}/tmp/opkg/${pkg}/data.tar.gz" | \ - sed 's/^\.//' >"${root}/var/lib/opkg/info/${pkg}.list" + sed 's/^\.//' \ + >"${root}/$(profile_opkg_state_dir)/info/${pkg}.list" rm -f "${root}/tmp/opkg/${pkg}/data.tar.gz" for file in "${root}/tmp/opkg/${pkg}/"*; do mv "${file}" \ - "${root}/var/lib/opkg/info/${pkg}.${file##*/}" + "${root}/$(profile_opkg_state_dir \ + )/info/${pkg}.${file##*/}" done rmdir "${root}/tmp/opkg/${pkg}" # Write status file. - control="${root}/var/lib/opkg/info/${pkg}.control" + control="${root}/$(profile_opkg_state_dir)/info/${pkg}.control" for field in Package Version Depends Recommends Suggests \ Provides Replaces Conflicts; do grep "^${field}: " "${control}" >&${status_fd} @@ -332,7 +335,8 @@ install_get_pkgs() for field in Essential Architecture; do grep "^${field}: " "${control}" >&${status_fd} done - if [ -r "${root}/var/lib/opkg/info/${pkg}.conffiles" ]; then + if [ -r "${root}/$(profile_opkg_state_dir \ + )/info/${pkg}.conffiles" ]; then printed=false while read -r file; do ${printed} || printf 'Conffiles:\n' \ @@ -341,7 +345,8 @@ install_get_pkgs() "${root}/${file}" | cut -d' ' -f1)" \ >&${status_fd} printed=true - done <"${root}/var/lib/opkg/info/${pkg}.conffiles" + done <"${root}/$(profile_opkg_state_dir \ + )/info/${pkg}.conffiles" fi printf 'Installed-Time: %s\n\n' "$(date '+%s')" >&${status_fd} -- cgit v0.9.1