java-openjdk/generate_tapsets.sh
2018-07-04 21:19:04 +02:00

42 lines
1010 B
Bash

#!/bin/bash
set -x
set -e
TAPSET_VERSION=3.2
# icedtea7 have different jstack
#PROJECT_VERSION=6327cf1cea9e
#PROJECT=icedtea7-2.6
#PROJECT_URL=http://icedtea.classpath.org/hg/release/$PROJECT/
PROJECT_VERSION=9d464368e06d
PROJECT=icedtea8
PROJECT_URL=http://icedtea.classpath.org/hg/$PROJECT/
INPUT_FILE=$PROJECT_VERSION.tar.gz
OUTPUT=${PROJECT}_${PROJECT_VERSION}_systemtap-tapset_${TAPSET_VERSION}
OUTPUT_FILE=$OUTPUT.tar.xz
if [ -e $OUTPUT_FILE ] ; then
set +x
echo "exists exists exists exists exists exists exists "
echo "reusing reusing reusing reusing reusing reusing "
echo $OUTPUT_FILE
exit 0
fi
if [ ! -e $INPUT_FILE ] ; then
wget $PROJECT_URL/archive/$INPUT_FILE
fi
rm -rf $OUTPUT
mkdir $OUTPUT
pushd $OUTPUT
tar --strip-components=1 -xf ../$INPUT_FILE
for file in hotspot hotspot_gc hotspot_jni jstack ; do
mv tapset/${file}.stp.in tapset/${file}-NVRA.stp.in
done
tar cvJf $OUTPUT_FILE tapset
mv $OUTPUT_FILE ../
popd
rm -rf $OUTPUT
rm $INPUT_FILE
echo $OUTPUT_FILE