download_and_compile.sh: allow '_', '-' and '.' in usernames

With this commit, option --git-clone-site-params accepts '_', '-' and
'.' in usernames. Thanks to Keith Paterson for the report.
This commit is contained in:
Florent Rougon 2020-09-02 11:02:14 +02:00
parent bbf956b518
commit 56ae978017

View File

@ -1075,7 +1075,7 @@ while true; do
shift 2 shift 2
;; ;;
--git-clone-site-params) --git-clone-site-params)
if [[ "$2" =~ ^([[:alnum:]]+)=([[:alpha:]]+)(:([[:alnum:]]+))?$ ]]; then if [[ "$2" =~ ^([[:alnum:]]+)=([[:alpha:]]+)(:([-_.[:alnum:]]+))?$ ]]; then
site="${BASH_REMATCH[1],,}" # convert the site to lowercase site="${BASH_REMATCH[1],,}" # convert the site to lowercase
verbatim_proto="${BASH_REMATCH[2]}" verbatim_proto="${BASH_REMATCH[2]}"
proto="${verbatim_proto,,}" # ditto for the protocol proto="${verbatim_proto,,}" # ditto for the protocol