Skip to content

Commit

Permalink
update cdpd-patcher to support hotfix branches
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Nov 12, 2020
1 parent e42ff23 commit 26505d1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/scripts/cdpd-patcher.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,24 @@ echo "@@@ version: $VERSION"
wget -nv -O $tmp "http://release.infra.cloudera.com/hwre-api/latestcompiledbuild?stack=CDH&release=${VERSION}&os=centos7"
build="`cat $tmp|jq -r .build`"
echo "@@@ build: $build"
shopt -s extglob
case "${build}_$VERSION" in
null_7.[0-9].[0-9].[1-9]+([0-9]))
newVersion="`sed -r 's/[0-9]+$/0/' <<< ${VERSION}`"
echo "@@@ no build info available for $VERSION - and its a hotfix branch; trying base version ($newVersion) instead"
exec "$0" "$COMPONENT" "$newVersion"
;;
esac
patch_url="`cat $tmp | jq -r .centos7.patch_url`"
wget -nv -O $tmp "${patch_url}/${COMPONENT}-source.patch" ||
wget -nv -O $tmp "${patch_url}/dag_build/${COMPONENT}-source.patch"
git apply -p1 -C0 $tmp
if [[ "$build" < "7.2.1" ]];then
sed -i "s/pig.version>0.16.0.*</pig.version>0.16.0.${build}</" pom.xml
else
sed -i "s/pig.version>0.16.0.*</pig.version>0.16.0</" pom.xml
fi
echo "@@@ patched"

0 comments on commit 26505d1

Please sign in to comment.