Created
February 12, 2018 01:46
-
-
Save ghadishayban/1dbba8e77d0e8fb7b98da55e32627aee to your computer and use it in GitHub Desktop.
a script that vendors asm and writes itself as git commit 'transaction data'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# author Ghadi Shayban <[email protected]> | |
set -e | |
if [ -z ${1+x} ] | |
then | |
echo provide an asm git sha / ref | |
exit 1 | |
fi | |
GITREF=$1 | |
URI=https://gitlab.ow2.org/asm/asm.git | |
ASM_CHECKOUT=asm | |
CLJASM=src/jvm/clojure/asm | |
git clone --no-checkout $URI $ASM_CHECKOUT | |
pushd $ASM_CHECKOUT | |
git checkout $GITREF | |
GITREF=$(git rev-parse HEAD) # resolve refs | |
popd | |
git rm -r --ignore-unmatch $CLJASM | |
rsync -rt \ | |
$ASM_CHECKOUT/asm/src/main/java/org/objectweb/asm/ \ | |
$ASM_CHECKOUT/asm-commons/src/main/java/org/objectweb/asm/ \ | |
$ASM_CHECKOUT/asm-tree/src/main/java/org/objectweb/asm/ \ | |
$CLJASM \ | |
--include '*.java' \ | |
--include '*/' \ | |
--exclude '*' | |
find $CLJASM -name '*.java' -print0 | xargs -0 sed -iBAK 's/org.objectweb.asm/clojure.asm/g' | |
find $CLJASM -name '*BAK' -delete | |
git add $CLJASM | |
cat - "${BASH_SOURCE[0]}" > COMMIT_MSG <<EOM | |
vendor asm to sha $GITREF | |
the following script vendors asm, asm-commons and asm-tree | |
in \$CLOJURE/src/main/java under the package clojure.asm | |
EOM | |
git commit -F COMMIT_MSG | |
rm -rf COMMIT_MSG $ASM_CHECKOUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment