hook/do-extract: support extracting .crate files

This commit is contained in:
Rasmus Thomsen 2018-10-31 22:11:01 +01:00 committed by maxice8
parent 67d2381243
commit a8f008f21c
2 changed files with 4 additions and 2 deletions

View file

@ -56,6 +56,7 @@ hook() {
*.txt) cursufx="txt";;
*.7z) cursufx="7z";;
*.gem) cursufx="gem";;
*.crate) cursufx="crate";;
*) msg_error "$pkgver: unknown distfile suffix for $curfile.\n";;
esac
@ -66,7 +67,7 @@ hook() {
fi
case ${cursufx} in
txz|tbz|tlz|tgz)
txz|tbz|tlz|tgz|crate)
tar -x --no-same-permissions --no-same-owner -f $srcdir/$curfile -C $extractdir
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"

View file

@ -44,11 +44,12 @@ contents_cksum() {
*.txt) cursufx="txt";;
*.7z) cursufx="7z";;
*.gem) cursufx="gem";;
*.crate) cursufx="crate";;
*) msg_error "$pkgver: unknown distfile suffix for $curfile.\n";;
esac
case ${cursufx} in
tar|txz|tbz|tlz|tgz)
tar|txz|tbz|tlz|tgz|crate)
cksum=$(tar xf "$curfile" --to-stdout | sha256sum | awk '{print $1}')
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile to pipe.\n"