Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions release_tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,22 @@
# $3: The concerned file
apply_triplets_to_file()
{
local _previous=( $1 ) _replacement=( $2 ) _file="$3" _varnames=(LT_CURRENT LT_REVISION LT_AGE)

local _previous
local _replacement
local _file="$3"
local _varnames=(LT_CURRENT LT_REVISION LT_AGE)

_previous=( $1 )

Check warning on line 168 in release_tools/release.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Assign this positional parameter to a local variable.

See more on https://sonarcloud.io/project/issues?id=OpenSCAP_openscap&issues=AZ2j3E3UWySueEBalzmp&open=AZ2j3E3UWySueEBalzmp&pullRequest=2341
_replacement=( $2 )

Check warning on line 169 in release_tools/release.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Assign this positional parameter to a local variable.

See more on https://sonarcloud.io/project/issues?id=OpenSCAP_openscap&issues=AZ2j3E3UWySueEBalzmq&open=AZ2j3E3UWySueEBalzmq&pullRequest=2341

for i in 0 1 2
do
substitute_variable_assignment_value_in_file "${_varnames[$i]}" "${_previous[$i]}" "${_replacement[$i]}" "$_file"
substitute_variable_assignment_value_in_file \
"${_varnames[$i]}" \
"${_previous[$i]}" \
"${_replacement[$i]}" \
"$_file"
done
}

Expand All @@ -174,7 +186,15 @@
local _cmake_file="$OSCAP_REPO_ROOT/CMakeLists.txt" _old_versions _new_versions _new_soname _old_soname
# check_for_clean_repo
_old_versions="$(get_lt_triplet_from_file "$_cmake_file")" || die "Unable to get current LT versions"
_new_versions="$(increment_on_$1 "$_old_versions")" || die "Unable to get calculate refreshed LT version with strategy '$1'"
case "$1" in

Check warning on line 189 in release_tools/release.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Assign this positional parameter to a local variable.

See more on https://sonarcloud.io/project/issues?id=OpenSCAP_openscap&issues=AZ2j3E3UWySueEBalzmr&open=AZ2j3E3UWySueEBalzmr&pullRequest=2341
backwards_compatible|bugfix|breaking_change)
_new_versions="$(increment_on_$1 "$_old_versions")"

Check warning on line 191 in release_tools/release.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Assign this positional parameter to a local variable.

See more on https://sonarcloud.io/project/issues?id=OpenSCAP_openscap&issues=AZ2j3E3UWySueEBalzms&open=AZ2j3E3UWySueEBalzms&pullRequest=2341
;;
*)
die "Invalid strategy: $1"

Check warning on line 194 in release_tools/release.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Assign this positional parameter to a local variable.

See more on https://sonarcloud.io/project/issues?id=OpenSCAP_openscap&issues=AZ2j3E3UWySueEBalzmt&open=AZ2j3E3UWySueEBalzmt&pullRequest=2341
;;
esac

_old_soname="$(get_soname_from_triplet "$_old_versions")"
_new_soname="$(get_soname_from_triplet "$_new_versions")"

Expand Down Expand Up @@ -316,7 +336,7 @@
# $1: The next version
bump_release()
{
test $# -lt 2 || die "Provide the version number as an argument"
test $# -eq 1 || die "Provide the version number as an argument"

Check failure on line 339 in release_tools/release.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use '[[' instead of 'test' command for conditional tests. The '[[' construct is safer and more feature-rich.

See more on https://sonarcloud.io/project/issues?id=OpenSCAP_openscap&issues=AZ2j3E3UWySueEBalzmu&open=AZ2j3E3UWySueEBalzmu&pullRequest=2341
check_that_bump_is_appropriate
bump_release_in_cmake "$1"
bump_release_in_release_script "$FILE_WITH_VERSIONS" "$1"
Expand Down
Loading