Skip to content

Commit

Permalink
Fix replacement ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
methylDragon committed Apr 12, 2022
1 parent 88436da commit 93a5107
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions release-repo-scripts/bump_dependency.bash
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,10 @@ for ((i = 0; i < "${#LIBRARIES[@]}"; i++)); do
DEP_VER=${VERSIONS[$j]}
DEP_PREV_VER="$((${DEP_VER}-1))"

# Rule: *plugin2 -> *plugin3
# Replace lines like: "find_package(ignition-cmake2)"
# with: "find_package(ignition-cmake3)"
find . -type f ! -name 'Changelog.md' ! -name 'Migration.md' -print0 | xargs -0 sed -i "s ${DEP_LIB}${DEP_PREV_VER} ${DEP_LIB}${DEP_VER} g"

# Rule: IGN_PLUGIN_VER 2 -> IGN_PLUGIN_VER 3
# Replace lines like: "set(IGN_PLUGIN_VER 2)"
# with: "set(IGN_PLUGIN_VER 3)"
find . -type f ! -name 'Changelog.md' ! -name 'Migration.md' -print0 | xargs -0 sed -i "s@IGN_${DEP_LIB}_VER ${DEP_PREV_VER}@\UIGN_${DEP_LIB}_VER ${DEP_VER}@ig"
find . -type f -name 'CMakeLists.txt' -print0 | xargs -0 sed -i "s@IGN_${DEP_LIB}_VER ${DEP_PREV_VER}@\UIGN_${DEP_LIB}_VER ${DEP_VER}@ig"

# Replace lines like "find_package(ignition-cmake2 2.0.0)"
# with "find_package(ignition-cmake3)"
Expand All @@ -478,6 +473,12 @@ for ((i = 0; i < "${#LIBRARIES[@]}"; i++)); do
# with "ign_find_package(ignition-math7 REQUIRED COMPONENTS eigen3)"
find . -type f -name 'CMakeLists.txt' -print0 | xargs -0 sed -i "s@\(find_package.*${DEP_LIB}\)${DEP_PREV_VER}\(.*\) \+VERSION \+${DEP_PREV_VER}[^ )]*@\1${DEP_VER}\2@g"


# Rule: *plugin2 -> *plugin3
# Replace lines like: "find_package(ignition-cmake2)"
# with: "find_package(ignition-cmake3)"
find . -type f ! -name 'Changelog.md' ! -name 'Migration.md' -print0 | xargs -0 sed -i "s ${DEP_LIB}${DEP_PREV_VER} ${DEP_LIB}${DEP_VER} g"

# Replace collection yaml branch names with main
if [[ "${LIB}" == "ign-${COLLECTION}" ]]; then
find . -type f -name "collection-${COLLECTION}.yaml" -print0 | xargs -0 sed -i "s ign-${DEP_LIB}${DEP_VER} main g"
Expand Down

0 comments on commit 93a5107

Please sign in to comment.