Skip to content

Commit 059cfc5

Browse files
committed
Quote yaml vars, local checkout_external vars
1 parent faa358d commit 059cfc5

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

release.sh

+31-31
Original file line numberDiff line numberDiff line change
@@ -884,17 +884,17 @@ parse_ignore() {
884884
continue
885885
fi
886886
# Strip any trailing CR character.
887-
yaml_line=${yaml_line%$carriage_return}
887+
yaml_line="${yaml_line%"$carriage_return"}"
888888

889889
case $yaml_line in
890890
[!\ ]*:*)
891891
# Split $yaml_line into a $yaml_key, $yaml_value pair.
892892
yaml_keyvalue "$yaml_line"
893893
# Set the $pkgmeta_phase for stateful processing.
894-
pkgmeta_phase=$yaml_key
894+
pkgmeta_phase="$yaml_key"
895895
;;
896896
[\ ]*"- "*)
897-
yaml_line=${yaml_line#"${yaml_line%%[! ]*}"} # trim leading whitespace
897+
yaml_line="${yaml_line#"${yaml_line%%[! ]*}"}" # trim leading whitespace
898898
# Get the YAML list item.
899899
yaml_listitem "$yaml_line"
900900
if [[ "$pkgmeta_phase" == "ignore" || "$pkgmeta_phase" == "plain-copy" ]] && [[ $yaml_item == "$sub_path"* ]]; then
@@ -943,14 +943,14 @@ if [ -f "$pkgmeta_file" ]; then
943943
continue
944944
fi
945945
# Strip any trailing CR character.
946-
yaml_line=${yaml_line%$carriage_return}
946+
yaml_line="${yaml_line%"$carriage_return"}"
947947

948948
case $yaml_line in
949949
[!\ ]*:*)
950950
# Split $yaml_line into a $yaml_key, $yaml_value pair.
951951
yaml_keyvalue "$yaml_line"
952952
# Set the $pkgmeta_phase for stateful processing.
953-
pkgmeta_phase=$yaml_key
953+
pkgmeta_phase="$yaml_key"
954954

955955
case $yaml_key in
956956
enable-nolib-creation)
@@ -967,14 +967,14 @@ if [ -f "$pkgmeta_file" ]; then
967967
license=$yaml_value
968968
;;
969969
manual-changelog)
970-
changelog=$yaml_value
970+
changelog="$yaml_value"
971971
manual_changelog="true"
972972
;;
973973
changelog-title)
974974
project="$yaml_value"
975975
;;
976976
package-as)
977-
package=$yaml_value
977+
package="$yaml_value"
978978
;;
979979
wowi-create-changelog)
980980
if [ "$yaml_value" = "no" ]; then
@@ -1021,12 +1021,12 @@ if [ -f "$pkgmeta_file" ]; then
10211021
manual-changelog)
10221022
case $yaml_key in
10231023
filename)
1024-
changelog=$yaml_value
1024+
changelog="$yaml_value"
10251025
manual_changelog="true"
10261026
;;
10271027
markup-type)
10281028
if [ "$yaml_value" = "markdown" ] || [ "$yaml_value" = "html" ]; then
1029-
changelog_markup=$yaml_value
1029+
changelog_markup="$yaml_value"
10301030
else
10311031
changelog_markup="text"
10321032
fi
@@ -1865,14 +1865,14 @@ parse_ignore "$pkgmeta_file"
18651865

18661866
# Checkout the external into a ".checkout" subdirectory of the final directory.
18671867
checkout_external() {
1868-
_external_dir=$1
1869-
_external_uri=$2
1870-
_external_tag=$3
1871-
_external_type=$4
1868+
local _external_dir="$1"
1869+
local _external_uri="$2"
1870+
local _external_tag="$3"
1871+
local _external_type="$4"
18721872
# shellcheck disable=SC2034
1873-
_external_slug=$5 # unused until we can easily fetch the project id
1874-
_external_checkout_type=$6
1875-
_external_path=$7
1873+
local _external_slug="$5" # unused until we can easily fetch the project id
1874+
local _external_checkout_type="$6"
1875+
local _external_path="$7"
18761876

18771877
_cqe_checkout_dir="$pkgdir/$_external_dir/.checkout"
18781878
if [[ -d $_cqe_checkout_dir ]]; then
@@ -2109,7 +2109,7 @@ if [ -z "$skip_externals" ] && [ -f "$pkgmeta_file" ]; then
21092109
continue
21102110
fi
21112111
# Strip any trailing CR character.
2112-
yaml_line=${yaml_line%$carriage_return}
2112+
yaml_line="${yaml_line%"$carriage_return"}"
21132113

21142114
case $yaml_line in
21152115
[!\ ]*:*)
@@ -2118,10 +2118,10 @@ if [ -z "$skip_externals" ] && [ -f "$pkgmeta_file" ]; then
21182118
# Split $yaml_line into a $yaml_key, $yaml_value pair.
21192119
yaml_keyvalue "$yaml_line"
21202120
# Set the $pkgmeta_phase for stateful processing.
2121-
pkgmeta_phase=$yaml_key
2121+
pkgmeta_phase="$yaml_key"
21222122
;;
21232123
" "*)
2124-
yaml_line=${yaml_line#"${yaml_line%%[! ]*}"} # trim leading whitespace
2124+
yaml_line="${yaml_line#"${yaml_line%%[! ]*}"}" # trim leading whitespace
21252125
case $yaml_line in
21262126
"- "*)
21272127
;;
@@ -2131,30 +2131,30 @@ if [ -z "$skip_externals" ] && [ -f "$pkgmeta_file" ]; then
21312131
case $pkgmeta_phase in
21322132
externals)
21332133
case $yaml_key in
2134-
url) external_uri=$yaml_value ;;
2134+
url) external_uri="$yaml_value" ;;
21352135
tag)
2136-
external_tag=$yaml_value
2137-
external_checkout_type=$yaml_key
2136+
external_tag="$yaml_value"
2137+
external_checkout_type="$yaml_key"
21382138
;;
21392139
branch)
2140-
external_tag=$yaml_value
2141-
external_checkout_type=$yaml_key
2140+
external_tag="$yaml_value"
2141+
external_checkout_type="$yaml_key"
21422142
;;
21432143
commit)
2144-
external_tag=$yaml_value
2145-
external_checkout_type=$yaml_key
2144+
external_tag="$yaml_value"
2145+
external_checkout_type="$yaml_key"
21462146
;;
2147-
type) external_type=$yaml_value ;;
2148-
curse-slug) external_slug=$yaml_value ;;
2149-
path) external_path=$yaml_value ;;
2147+
type) external_type="$yaml_value" ;;
2148+
curse-slug) external_slug="$yaml_value" ;;
2149+
path) external_path="$yaml_value" ;;
21502150
*)
21512151
# Started a new external, so checkout any queued externals.
21522152
process_external
21532153

2154-
external_dir=$yaml_key
2154+
external_dir="$yaml_key"
21552155
nolib_exclude="$nolib_exclude $pkgdir/$external_dir/*"
21562156
if [ -n "$yaml_value" ]; then
2157-
external_uri=$yaml_value
2157+
external_uri="$yaml_value"
21582158
# Immediately checkout this fully-specified external.
21592159
process_external
21602160
fi

0 commit comments

Comments
 (0)