@eht16 commented on this pull request.


> @@ -135,7 +137,8 @@ _getpkg() {
        if [ "$use_cache" = "yes" ]; then
                package_info=$(pacman -Qi mingw-w64-$ABI-$1)
                package_version=$(echo "$package_info" | grep "^Version " | cut 
-d':' -f 2 | tr -d '[[:space:]]')
-               ls $cachedir/mingw-w64-${ABI}-${1}-${package_version}-* | sort 
-V | tail -n 1
+               # use @(gz|xz|zst) to filter out signature files (e.g. 
mingw-w64-x86_64-...-any.pkg.tar.zst.sig)
+               ls 
$cachedir/mingw-w64-${ABI}-${1}-${package_version}-*.tar.@(gz|xz|zst) | sort -V 
| tail -n 1

For me, it doesn't work:
```bash
enrico@endor:/tmp/shglob$ ls
test-1.tar.zst
enrico@endor:/tmp/shglob$ ls test-*.tar.{gz,xz,zst}
ls: cannot access 'test-*.tar.gz': No such file or directory
ls: cannot access 'test-*.tar.xz': No such file or directory
 test-1.tar.zst
enrico@endor:/tmp/shglob$ shopt -s extglob
enrico@endor:/tmp/shglob$ ls test-*.tar.@(gz|xz|zst)
test-1.tar.zst
```

`*.tar.{gz,xz,zst}` tries to expand to all of the patterns and so fails for 
missing files. The `extglob` variant only matches for *existing* files.
I don't see a big issue here, we already require `bash` anyway and performance 
is also not that relevant as probably nearly all other operations in the script 
are way more expensive.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2590#discussion_r717965162

Reply via email to