msys2 / msys2-pacman

A friendly fork of https://gitlab.archlinux.org/pacman/pacman
GNU General Public License v2.0
21 stars 12 forks source link

libmakepkg: fix compatibility with bash-5.2 patsub_replacement #30

Closed lazka closed 1 year ago

lazka commented 1 year ago

Bash-5.2 introduced the patsub_replacement shell option, which is enabled by default. Apparently is it supposed to handle a sed-like idiom, but what it does achieve is making any substitution involving a "&" requiring special care.

For makepkg's DLAGENTS, we replace "%o" and "%u" if present. Any "&" in the replacement fields triggers patsub_replacement unless quoted. This is particularly important for the URL field.

Add relevant quotes to avoid issues.