On 02/15/2018 03:11 PM, Dave Reisner wrote:
> Rather than making this stand out like a sore thumb for the next person
> to trip over, why don't we just define a "file_exists" function?
> 
>   file_exists() {
>     [[ -f $1 ]]
>   }
> 
> Now you're free to do this:
> 
>   file_exists 
> "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} && return 1
> 
> Expansion is taken care of by the shell before you pass to exists, and
> the check does what you'd expect.

That was my first inclination, my second was to stop allowing people to
upload *.kz compressed packages for giggles.

If we absolutely need to glob anything there, we should use bash
extended globs to match @(g|z) and whatever else we actually want. This
would work in [[ ]]


-- 
Eli Schwartz
Bug Wrangler and Trusted User

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to