Skip to content

Commit

Permalink
COMP: modified several sed invocations to be BSD compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
seanm committed Oct 12, 2021
1 parent 94dfea4 commit b76ff2c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Modules/ThirdParty/HDF5/UpdateFromUpstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ readonly paths="
extract_source () {
git_archive
pushd "$extractdir/$name-reduced"
sed -i '1 s| /bin/sh|/bin/sh|' c++/src/h5c++.in config/cmake/libh5cc.in
sed -i.bak -e '1 s| /bin/sh|/bin/sh|' c++/src/h5c++.in config/cmake/libh5cc.in
rm c++/src/h5c++.in.bak config/cmake/libh5cc.in.bak
chmod a+x c++/src/h5c++.in config/cmake/libh5cc.in
chmod a-x README.txt
chmod a-x config/cmake/CTestScript.cmake
Expand Down
3 changes: 2 additions & 1 deletion Modules/ThirdParty/KWSys/UpdateFromUpstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ readonly paths="

extract_source () {
git_archive
sed -i -e '/import off/,/import on/d' "$extractdir/$name-reduced/.gitattributes"
sed -i.bak -e '/import off/,/import on/d' "$extractdir/$name-reduced/.gitattributes"
rm "$extractdir/$name-reduced/.gitattributes.bak"
}

. "${BASH_SOURCE%/*}/../../../Utilities/Maintenance/update-third-party.bash"
12 changes: 8 additions & 4 deletions Utilities/Maintenance/UpdateRequiredITKVersionInRemoteModules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ current_git_str=($(grep $git_tag_label $azure_pipelines_ci_filename))
current_git_tag=${current_git_str[1]}

# Sed the latest ITK git tag in the Azure pipelines config file
sed -i "s/${git_tag_label}${current_git_tag}/${git_tag_label}${latest_git_tag}/g" $azure_pipelines_ci_filename
sed -i.bak -e "s/${git_tag_label}${current_git_tag}/${git_tag_label}${latest_git_tag}/g" $azure_pipelines_ci_filename
rm "${azure_pipelines_ci_filename}.bak"


# Get the latest ITK Python git tag
Expand All @@ -98,7 +99,8 @@ current_git_str=($(grep $python_git_tag_label $azure_pipelines_ci_filename))
current_git_tag=${current_git_str[1]}

# Sed the latest ITK git tag in the Azure pipelines config file
sed -i "s/${python_git_tag_label}${current_git_tag}/${python_git_tag_label}${latest_git_tag}/g" $azure_pipelines_ci_filename
sed -i.bak -e "s/${python_git_tag_label}${current_git_tag}/${python_git_tag_label}${latest_git_tag}/g" $azure_pipelines_ci_filename
rm "${azure_pipelines_ci_filename}.bak"

# Python setup file

Expand All @@ -115,7 +117,8 @@ git_install_req_tag_arr=($(echo $git_install_req_tag | tr "=" " "))
current_git_tag=${git_install_req_tag_arr[-1]}

# Sed the latest ITK git tag in the Python setup file
sed -i "s/${current_git_tag}/${latest_git_tag}'/g" $python_setup_filename
sed -i.bak -e "s/${current_git_tag}/${latest_git_tag}'/g" $python_setup_filename
rm "${python_setup_filename}.bak"

pckg_version_label='version'

Expand All @@ -139,4 +142,5 @@ new_pckg_patch_version=$((pckg_patch_version + 1))
# Update to a new major version
new_pckg_version="${pckg_version_tag_str::-2}${new_pckg_patch_version}'"

sed -i "s/${pckg_version_tag_str}/${new_pckg_version}/g" $python_setup_filename
sed -i.bak -e "s/${pckg_version_tag_str}/${new_pckg_version}/g" $python_setup_filename
rm "${python_setup_filename}.bak"

0 comments on commit b76ff2c

Please sign in to comment.