diff --git a/src/main/scripts/patcher.bash b/src/main/scripts/patcher.bash new file mode 100755 index 0000000..843f117 --- /dev/null +++ b/src/main/scripts/patcher.bash @@ -0,0 +1,15 @@ +#!/bin/bash +set -x +set -e + +C=${1:-hive} +V=${2:-3.0.0.0} +PF=/tmp/.patcher + +wget -nv -O $PF http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/${V:0:1}.x/PATCH_FILES/$V/patch_files/${C}-source.patch || +wget -nv -O $PF http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/${V:0:1}.x/PATCH_FILES/$V/patch_files/${C}-source.patch || +wget -nv -O $PF http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/${V:0:1}.x/PATCH_FILES/$V/patch_files/${C}-source.patch || +wget -nv -O $PF http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11sp3/${V:0:1}.x/PATCH_FILES/$V/patch_files/${C}-source.patch || +wget -nv -O $PF http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian7/${V:0:1}.x/PATCH_FILES/$V/patch_files/${C}-source.patch +git apply -3 -p1 $PF +git commit -m "HWX_PATCH" `find . -name pom.xml` diff --git a/src/main/scripts/picker b/src/main/scripts/picker new file mode 100755 index 0000000..6891ee3 --- /dev/null +++ b/src/main/scripts/picker @@ -0,0 +1,24 @@ +#!/bin/bash -e + +COMMIT=${1} +rm -rf /tmp/fp +git format-patch -o /tmp/fp "${COMMIT}^..${COMMIT}" + +for f in `git diff-tree --no-commit-id --name-only -r $COMMIT`;do + [ -f "$f" ] && continue + echo "might be problematic: $f" + newFile="$(find . -name "`basename "$f"`" -printf '%P\n')" + if [ ! -f "$newFile" ]; then + echo "there might be multiple alternatives to $f ; I won't do that automatically => DIY" + echo "...or set the env FORCE to skip changes like this" + [ "$FORCE" != "" ] && continue + exit 1 + fi + echo "s|$f|$newFile|g" >&3 +done 3>/tmp/fp/replace.sed + +sed -f /tmp/fp/replace.sed < /tmp/fp/000* > /tmp/fp/new.patch + +echo " * patch file: /tmp/fp/new.patch" +#git am -p0 /tmp/fp/new.patch +git apply -3 -p0 /tmp/fp/new.patch