From 93a510786b9b3bfd57bbe4e5e6ac8cb2949df6c7 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 11 Apr 2022 17:44:51 -0700 Subject: [PATCH 1/3] Fix replacement ordering --- release-repo-scripts/bump_dependency.bash | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/release-repo-scripts/bump_dependency.bash b/release-repo-scripts/bump_dependency.bash index 7a37ffb77..9dd0ea47c 100755 --- a/release-repo-scripts/bump_dependency.bash +++ b/release-repo-scripts/bump_dependency.bash @@ -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)" @@ -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" From 7a85af735980751f7ada6b67fee682f0b9a80877 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 11 Apr 2022 17:50:10 -0700 Subject: [PATCH 2/3] Implement IGN__VER fix --- release-repo-scripts/bump_dependency.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release-repo-scripts/bump_dependency.bash b/release-repo-scripts/bump_dependency.bash index 9dd0ea47c..50f19ea68 100755 --- a/release-repo-scripts/bump_dependency.bash +++ b/release-repo-scripts/bump_dependency.bash @@ -455,10 +455,10 @@ for ((i = 0; i < "${#LIBRARIES[@]}"; i++)); do DEP_VER=${VERSIONS[$j]} DEP_PREV_VER="$((${DEP_VER}-1))" - # Rule: IGN_PLUGIN_VER 2 -> IGN_PLUGIN_VER 3 + # Rule: IGN__VER -> IGN__VER ${ignition-_VERSION_MAJOR} # Replace lines like: "set(IGN_PLUGIN_VER 2)" - # with: "set(IGN_PLUGIN_VER 3)" - 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" + # with: "set(IGN_PLUGIN_VER ${ignition-plugin3_VERSION_MAJOR})" + find . -type f -name 'CMakeLists.txt' -print0 | xargs -0 sed -i "s@IGN_${DEP_LIB}_VER ${DEP_PREV_VER}@\UIGN_${DEP_LIB}_VER \L\$\{ignition-${DEP_LIB}${DEP_VER}_\UVERSION_MAJOR\}@ig" # Replace lines like "find_package(ignition-cmake2 2.0.0)" # with "find_package(ignition-cmake3)" From 7d75fd11b7cd890e64d033ed8a66cff3a65aa3b7 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 11 Apr 2022 18:24:38 -0700 Subject: [PATCH 3/3] Remove IGN__VER case instead This pattern requires that the library is found before it is invoked. And in most cases, it'll be invoked first. --- release-repo-scripts/bump_dependency.bash | 5 ----- 1 file changed, 5 deletions(-) diff --git a/release-repo-scripts/bump_dependency.bash b/release-repo-scripts/bump_dependency.bash index 50f19ea68..84a7a562d 100755 --- a/release-repo-scripts/bump_dependency.bash +++ b/release-repo-scripts/bump_dependency.bash @@ -455,11 +455,6 @@ for ((i = 0; i < "${#LIBRARIES[@]}"; i++)); do DEP_VER=${VERSIONS[$j]} DEP_PREV_VER="$((${DEP_VER}-1))" - # Rule: IGN__VER -> IGN__VER ${ignition-_VERSION_MAJOR} - # Replace lines like: "set(IGN_PLUGIN_VER 2)" - # with: "set(IGN_PLUGIN_VER ${ignition-plugin3_VERSION_MAJOR})" - find . -type f -name 'CMakeLists.txt' -print0 | xargs -0 sed -i "s@IGN_${DEP_LIB}_VER ${DEP_PREV_VER}@\UIGN_${DEP_LIB}_VER \L\$\{ignition-${DEP_LIB}${DEP_VER}_\UVERSION_MAJOR\}@ig" - # Replace lines like "find_package(ignition-cmake2 2.0.0)" # with "find_package(ignition-cmake3)" find . -type f -name 'CMakeLists.txt' -print0 | xargs -0 sed -i "s@\(find_package.*${DEP_LIB}\)${DEP_PREV_VER} \+${DEP_PREV_VER}[^ )]*@\1${DEP_VER}@g"