diff options
-rwxr-xr-x | miniprokit.sh | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/miniprokit.sh b/miniprokit.sh index 57953fb..bdf7aa4 100755 --- a/miniprokit.sh +++ b/miniprokit.sh @@ -213,6 +213,7 @@ get_pkg() local package="${3}" local filename="${4}" local sha256sum="${5}" + local file= info 'Downloading %s...' "${package}" filename="${filename#../../../../../../}" @@ -224,6 +225,16 @@ get_pkg() info 'Unpacking %s...' "${package}" (cd "${root}"; tar -xzOf "${filename#${root}/}" data.tar.gz | tar -xz) + mkdir "${root}/tmp/opkg/${package}" + ( + cd "${root}/tmp/opkg/${package}" + tar -xzOf "../../../${filename#${root}/}" control.tar.gz | \ + tar -xz + ) + for file in "${root}/tmp/opkg/${package}/"*; do + mv "${file}" "${root}/var/lib/opkg/info/${package}.${file##*/}" + done + rmdir "${root}/tmp/opkg/${package}" } configure_pkgs() @@ -231,28 +242,16 @@ configure_pkgs() local root="${1}" local opk= local pkg= - local file= local script= local control= + local field= local printed= + local file= for opk in "${root}/var/cache/opkg/archives/"*.opk; do pkg="${opk##*/}" pkg="${pkg%%_*}" - # Finish unpacking. - mkdir "${root}/tmp/opkg/${pkg}" - ( - cd "${root}/tmp/opkg/${pkg}" - tar -xzOf "../../../${opk#${root}/}" control.tar.gz | \ - tar -xz - ) - for file in "${root}/tmp/opkg/${pkg}/"*; do - mv "${file}" \ - "${root}/var/lib/opkg/info/${pkg}.${file##*/}" - done - rmdir "${root}/tmp/opkg/${pkg}" - info 'Configuring %s...' "${pkg}" for script in 'preinst' 'postinst'; do if [ -x "${root}/var/lib/opkg/info/${pkg}.${script}" ] |