summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xminiprokit.sh15
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}"
}