From f300464d952f5a43b87ac2fbfdb21d299c266e78 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 08 Jun 2014 13:53:35 -0400 Subject: miniprokit.sh: Save data.tar.gz for a while. Also make sha256sum call more portable. --- diff --git a/miniprokit.sh b/miniprokit.sh index 039bb23..20d3ff2 100755 --- a/miniprokit.sh +++ b/miniprokit.sh @@ -222,21 +222,26 @@ get_pkg() filename="${filename#../../../../../../}" wget -q -O "${root}/var/cache/opkg/archives/${filename##*/}" \ "${mirror}/${filename}" || error 2 'Failed to download package' - filename="${root}/var/cache/opkg/archives/${filename##*/}" - printf '%s %s\n' "${sha256sum}" "${filename}" | sha256sum --quiet -c \ + filename="var/cache/opkg/archives/${filename##*/}" + printf '%s %s\n' "${sha256sum}" "${root}/${filename}" | \ + sha256sum -c >/dev/null 2>&1 \ || error 2 'Checksum of source package file failed' 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 | \ + cd "${root}" + tar -xzOf "${filename}" data.tar.gz \ + >"tmp/opkg/${package}/data.tar.gz" + tar -xzf "tmp/opkg/${package}/data.tar.gz" + cd "tmp/opkg/${package}" + tar -xzOf "../../../${filename}" control.tar.gz | \ tar -xz ) for file in "${root}/tmp/opkg/${package}/"*; do mv "${file}" "${root}/var/lib/opkg/info/${package}.${file##*/}" done + rm -f "${root}/tmp/opkg/${package}/data.tar.gz" rmdir "${root}/tmp/opkg/${package}" } -- cgit v0.9.1