File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ declare -i format=1 builddate
2525declare -a buildenv options installed
2626declare -A data
2727
28+ shopt -s extglob
29+
2830# Desc: Parses line into current global state
2931# 1: line
3032function parse_line () {
@@ -91,18 +93,19 @@ function verify_archive_link () {
9193# 1: Package archive link
9294# 2: Target directory
9395function download_archive_package () {
94- local filename= " ${1} .pkg.tar.xz "
96+ local cachename
9597 local cachedir=$( readlink -e " ${2} " )
96- if [[ -f " ${cachedir } /${filename} " ]] ; then
97- echo " Hit cache for ${filename} " >&2
98- echo " ${2} / ${filename }"
98+ if cachename= $( compgen -G " ${2 } /${1} .pkg.tar.@(xz|zst) " ) ; then
99+ echo " Hit cache for $( basename ${cachename} ) " >&2
100+ echo " ${cachename } "
99101 else
100102 local pwd=" $( pwd) "
101103 local workdir=" $( mktemp -d) "
102104 cd " ${workdir} " || exit 1
103105 for ext in zst xz; do
104106 local target=" $( get_archive_link " ${1} " " $ext " ) "
105107 if verify_archive_link " ${target} " ; then
108+ local filename=" $( basename ${target} ) "
106109 echo " Downloading ${filename} " >&2
107110 curl -L --remote-name-all " ${target} " " ${target} .sig" 2> /dev/null
108111 if gpg --keyring /etc/pacman.d/gnupg/pubring.gpg --verify " ${filename} .sig" " ${filename} " 2> /dev/null; then
You can’t perform that action at this time.
0 commit comments