diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-06-08 13:53:35 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-06-08 13:53:35 (EDT) |
commit | f300464d952f5a43b87ac2fbfdb21d299c266e78 (patch) | |
tree | 1714a56ee705c966bbc6b21c5fc7256dc08a3aaa | |
parent | 9cc5373ed2ac619c684c4dc9949481f934ca6e0c (diff) |
miniprokit.sh: Save data.tar.gz for a while.
Also make sha256sum call more portable.
-rwxr-xr-x | miniprokit.sh | 15 |
1 files changed, 10 insertions, 5 deletions
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}" } |