Skip to content

Commit

Permalink
move picker and old patcher from dev-box to here
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Nov 12, 2020
1 parent 26505d1 commit 41b90f6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/scripts/patcher.bash
Original file line number Diff line number Diff line change
@@ -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`
24 changes: 24 additions & 0 deletions src/main/scripts/picker
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 41b90f6

Please sign in to comment.