Skip to content

Commit b89a485

Browse files
authored
Merge pull request #13 from abstractdog/cdpd_patcher_no_pom
skip pom.xml pig.version patching if repo is not maven based and there is no pom.xml
2 parents a0f9f48 + 4d5bc87 commit b89a485

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main/scripts/cdpd-patcher

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,15 @@ wget -nv -O $tmp "${patch_url}/${COMPONENT}-source.patch" ||
9898
wget -nv -O $tmp "${patch_url}/dag_build/${COMPONENT}-source.patch"
9999
100100
git apply -p1 -C0 $tmp || git apply -3 -p1 -C0 $tmp
101-
if [[ "$build" < "7.2.1" && "$VERSION" != "7.0.2.1" ]];then
102-
sed -i "s/pig.version>0.16.0.*</pig.version>0.16.0.${build}</" pom.xml
103-
else
104-
sed -i "s/pig.version>0.16.0.*</pig.version>0.16.0</" pom.xml
101+
102+
if test -f "pom.xml"; then
103+
echo "found pom.xml, trying to patch pig version"
104+
if [[ "$build" < "7.2.1" && "$VERSION" != "7.0.2.1" ]];then
105+
sed -i "s/pig.version>0.16.0.*</pig.version>0.16.0.${build}</" pom.xml
106+
else
107+
sed -i "s/pig.version>0.16.0.*</pig.version>0.16.0</" pom.xml
108+
fi
105109
fi
106110
111+
107112
echo "@@@ patched"

0 commit comments

Comments
 (0)