···66Options:
77 --url url The url of the archive to fetch.
88 --name name The name to use for the store path (defaults to \`basename \$url\`).
99+ --ext ext The file extension (.zip, .tar.gz, ...) to be REMOVED from name
910 --hash hash The hash of unpacked archive.
1011 --hash-type type Use the specified cryptographic hash algorithm, which can be one of md5, sha1, and sha256.
1112 --leave-root Keep the root directory of the archive.
···161717181819name=""
2020+ext=""
1921argi=0
2022argfun=""
2123for arg; do
···2325 case $arg in
2426 --url) argfun=set_url;;
2527 --name) argfun=set_name;;
2828+ --ext) argfun=set_ext;;
2629 --hash) argfun=set_expHash;;
2730 --hash-type) argfun=set_hashType;;
2831 --leave-root) leaveRoot=true;;
···6770tmp=$(mktemp -d 2>/dev/null || mktemp -d -t "$$")
6871trap "rm -rf '$tmp'" EXIT
69727070-unpackDirTmp=$tmp/unpacked-tmp/$name
7373+dirname=$(basename -s "$ext" "$name")
7474+7575+unpackDirTmp=$tmp/unpacked-tmp/$dirname
7176mkdir -p $unpackDirTmp
72777373-unpackDir=$tmp/unpacked/$name
7878+unpackDir=$tmp/unpacked/$dirname
7479mkdir -p $unpackDir
75807681downloadedFile=$tmp/$(basename "$url")