Prepared to consume jdk11
This commit is contained in:
parent
ed20958314
commit
7f2cf86b7c
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
|||||||
/jdk-jdk-jdk-11+16.tar.xz
|
/jdk-jdk-jdk-11+16.tar.xz
|
||||||
/jdk-jdk-jdk-11+19.tar.xz
|
/jdk-jdk-jdk-11+19.tar.xz
|
||||||
/jdk-shenandoah-jdk-ac148db384ee.tar.xz
|
/jdk-shenandoah-jdk-ac148db384ee.tar.xz
|
||||||
|
/icedtea8_9d464368e06d_systemtap-tapset_3.2.tar.xz
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Generates the 'source tarball' for JDK 8 projects.
|
# Generates the 'source tarball' for JDK projects.
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# When used from local repo set REPO_ROOT pointing to file:// with your repo
|
# When used from local repo set REPO_ROOT pointing to file:// with your repo
|
||||||
@ -40,7 +40,6 @@ if [ "x$1" = "xhelp" ] ; then
|
|||||||
echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)"
|
echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)"
|
||||||
echo "REPO_ROOT - the location of the Mercurial repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME)"
|
echo "REPO_ROOT - the location of the Mercurial repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME)"
|
||||||
echo "PR2126 - the path to the PR2126 patch to apply (optional; downloaded if unavailable)"
|
echo "PR2126 - the path to the PR2126 patch to apply (optional; downloaded if unavailable)"
|
||||||
echo "REPOS - specify the repositories to use (optional; defaults to ${REPOS_DEFAULT})"
|
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -88,9 +87,9 @@ if [ "x$REPO_ROOT" = "x" ] ; then
|
|||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ -d ${FILE_NAME_ROOT} ] ; then
|
if [ -d ${FILE_NAME_ROOT} ] ; then
|
||||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
echo "exists exists exists exists exists exists exists "
|
||||||
echo "${FILE_NAME_ROOT} exists, reusing !!!!!!!"
|
echo "reusing reusing reusing reusing reusing reusing "
|
||||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
echo ${FILE_NAME_ROOT}
|
||||||
else
|
else
|
||||||
mkdir "${FILE_NAME_ROOT}"
|
mkdir "${FILE_NAME_ROOT}"
|
||||||
pushd "${FILE_NAME_ROOT}"
|
pushd "${FILE_NAME_ROOT}"
|
||||||
|
@ -17,9 +17,9 @@ OUTPUT_FILE=$OUTPUT.tar.xz
|
|||||||
if [ -e $OUTPUT_FILE ] ; then
|
if [ -e $OUTPUT_FILE ] ; then
|
||||||
set +x
|
set +x
|
||||||
echo "exists exists exists exists exists exists exists "
|
echo "exists exists exists exists exists exists exists "
|
||||||
echo " $OUTPUT_FILE"
|
|
||||||
echo "reusing reusing reusing reusing reusing reusing "
|
echo "reusing reusing reusing reusing reusing reusing "
|
||||||
exit 1
|
echo $OUTPUT_FILE
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e $INPUT_FILE ] ; then
|
if [ ! -e $INPUT_FILE ] ; then
|
||||||
@ -38,3 +38,4 @@ pushd $OUTPUT
|
|||||||
popd
|
popd
|
||||||
rm -rf $OUTPUT
|
rm -rf $OUTPUT
|
||||||
rm $INPUT_FILE
|
rm $INPUT_FILE
|
||||||
|
echo $OUTPUT_FILE
|
||||||
|
@ -28,10 +28,10 @@ if [ "x$PROJECT_NAME" = "x" ] ; then
|
|||||||
PROJECT_NAME="jdk"
|
PROJECT_NAME="jdk"
|
||||||
fi
|
fi
|
||||||
if [ "x$REPO_NAME" = "x" ] ; then
|
if [ "x$REPO_NAME" = "x" ] ; then
|
||||||
REPO_NAME="jdk"
|
REPO_NAME="jdk11"
|
||||||
fi
|
fi
|
||||||
if [ "x$VERSION" = "x" ] ; then
|
if [ "x$VERSION" = "x" ] ; then
|
||||||
VERSION="jdk-11+19"
|
VERSION="jdk-11+20"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x$COMPRESSION" = "x" ] ; then
|
if [ "x$COMPRESSION" = "x" ] ; then
|
||||||
@ -41,154 +41,65 @@ fi
|
|||||||
if [ "x$FILE_NAME_ROOT" = "x" ] ; then
|
if [ "x$FILE_NAME_ROOT" = "x" ] ; then
|
||||||
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
|
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
|
||||||
fi
|
fi
|
||||||
#if [ "x$PKG" = "x" ] ; then
|
|
||||||
# URL=`cat .git/config | grep url`
|
|
||||||
# PKG=${URL##*/}
|
|
||||||
#fi
|
|
||||||
if [ "x$SPEC" = "x" ] ; then
|
|
||||||
SPEC=${PKG}.spec
|
|
||||||
fi
|
|
||||||
if [ "x$RELEASE" = "x" ] ; then
|
|
||||||
RELEASE=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION}
|
MAIN_FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION}
|
||||||
|
|
||||||
if [ ! -f ${FILENAME} ] ; then
|
if [ ! -f ${MAIN_FILENAME} ] ; then
|
||||||
echo "Generating ${FILENAME}"
|
echo "Generating ${MAIN_FILENAME}"
|
||||||
. ./generate_source_tarball.sh
|
. ./generate_source_tarball.sh
|
||||||
else
|
else
|
||||||
echo "${FILENAME} already exists, using"
|
echo "exists exists exists exists exists exists exists "
|
||||||
|
echo "reusing reusing reusing reusing reusing reusing "
|
||||||
|
echo ${MAIN_FILENAME}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo "Touching spec: $SPEC"
|
|
||||||
#sed -i "s/^%global\s\+project.*/%global project ${PROJECT_NAME}/" $SPEC
|
|
||||||
#sed -i "s/^%global\s\+repo.*/%global repo ${REPO_NAME}/" $SPEC
|
|
||||||
#sed -i "s/^%global\s\+revision.*/%global revision ${VERSION}/" $SPEC
|
|
||||||
# updated sources, resetting release
|
|
||||||
#sed -i "s/^Release:.*/Release: $RELEASE.%{buildver}%{?dist}/" $SPEC
|
|
||||||
|
|
||||||
#https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Bash
|
|
||||||
function levenshtein {
|
|
||||||
if [ "$#" -ne "2" ]; then
|
|
||||||
echo "Usage: $0 word1 word2" >&2
|
|
||||||
elif [ "${#1}" -lt "${#2}" ]; then
|
|
||||||
levenshtein "$2" "$1"
|
|
||||||
else
|
|
||||||
local str1len=$((${#1}))
|
|
||||||
local str2len=$((${#2}))
|
|
||||||
local d i j
|
|
||||||
for i in $(seq 0 $(((str1len+1)*(str2len+1)))); do
|
|
||||||
d[i]=0
|
|
||||||
done
|
|
||||||
for i in $(seq 0 $((str1len))); do
|
|
||||||
d[$((i+0*str1len))]=$i
|
|
||||||
done
|
|
||||||
for j in $(seq 0 $((str2len))); do
|
|
||||||
d[$((0+j*(str1len+1)))]=$j
|
|
||||||
done
|
|
||||||
|
|
||||||
for j in $(seq 1 $((str2len))); do
|
|
||||||
for i in $(seq 1 $((str1len))); do
|
|
||||||
[ "${1:i-1:1}" = "${2:j-1:1}" ] && local cost=0 || local cost=1
|
|
||||||
local del=$((d[(i-1)+str1len*j]+1))
|
|
||||||
local ins=$((d[i+str1len*(j-1)]+1))
|
|
||||||
local alt=$((d[(i-1)+str1len*(j-1)]+cost))
|
|
||||||
d[i+str1len*j]=$(echo -e "$del\n$ins\n$alt" | sort -n | head -1)
|
|
||||||
done
|
|
||||||
done
|
|
||||||
echo ${d[str1len+str1len*(str2len)]}
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
# generate shenandoah hotspot
|
# generate shenandoah hotspot
|
||||||
# that means supply the underlying script with new values
|
if [ "x$PROJECT_NAME" = "x" ] ; then
|
||||||
# to new filename.
|
PROJECT_NAME="shenandoah"
|
||||||
MAIN_VERSION=$VERSION
|
|
||||||
if [ "x$VERSION" = "xtip" ] ; then
|
|
||||||
VERSION="tip"
|
|
||||||
else
|
|
||||||
#hardcoding version for anything else except tip
|
|
||||||
VERSION="tip"
|
|
||||||
fi
|
fi
|
||||||
MAIN_REPO_NAME=shenandoah
|
if [ "x$REPO_NAME" = "x" ] ; then
|
||||||
REPO_NAME=jdk
|
REPO_NAME="jdk"
|
||||||
#PROJECT_NAME=$REPO_NAME-$MAIN_REPO_NAME ???
|
fi
|
||||||
MAIN_FILE_NAME_ROOT=$FILE_NAME_ROOT
|
if [ "x$VERSION" = "x" ] ; then
|
||||||
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
|
VERSION="4f5549ec27fb"
|
||||||
FILENAME_SH=${FILE_NAME_ROOT}.tar.${COMPRESSION}
|
|
||||||
|
|
||||||
echo "this fialed last time, got http://hg.openjdk.java.net/shenandoah/jdk/archive/ac148db384ee.zip instead"
|
|
||||||
###TODO! compress only hotspot!!!
|
|
||||||
REPOS="hotspot"
|
|
||||||
###TODO! compress only hotspot!!!
|
|
||||||
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
if [ ! -f ${FILENAME_SH} ] ; then
|
|
||||||
echo "Generating ${FILENAME_SH}"
|
|
||||||
. ./generate_source_tarball.sh
|
|
||||||
else
|
|
||||||
echo "${FILENAME_SH} already exists, using"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mv jdk-jdk-tip.tar.xz jdk-shenandoah-jdk-tip.tar.xz
|
if [ "x$COMPRESSION" = "x" ] ; then
|
||||||
|
# rhel 5 needs tar.gz
|
||||||
|
COMPRESSION=xz
|
||||||
|
fi
|
||||||
|
if [ "x$FILE_NAME_ROOT" = "x" ] ; then
|
||||||
|
FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION}
|
||||||
|
fi
|
||||||
|
|
||||||
sed -i "s/^Source1:.*/Source1: ${FILENAME_SH}/" $SPEC
|
SHENANDOAH_FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION}
|
||||||
git --no-pager diff $SPEC
|
|
||||||
|
|
||||||
echo "shenandoah hotpsot source generated and used"
|
if [ ! -f ${SHENANDOAH_FILENAME} ] ; then
|
||||||
echo "nothing more for shenandoah jdk 11 now!"
|
echo "Generating ${SHENANDOAH_FILENAME}"
|
||||||
exit 0
|
. ./generate_source_tarball.sh
|
||||||
|
else
|
||||||
|
echo "exists exists exists exists exists exists exists "
|
||||||
|
echo "reusing reusing reusing reusing reusing reusing "
|
||||||
|
echo ${SHENANDOAH_FILENAME}
|
||||||
|
fi
|
||||||
|
|
||||||
# find the most similar sources name and replace it by newly generated one.
|
TAPSET=`sh generate_tapsets.sh | tail -n 1`
|
||||||
echo "Old sources"
|
|
||||||
cat sources
|
echo "rh/fedpkg $TAPSET $SHENANDOAH_FILENAME $MAIN_FILENAME"
|
||||||
a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"`
|
|
||||||
winner=""
|
|
||||||
winnerDistance=999999
|
|
||||||
for x in $a_sources ; do
|
|
||||||
distance=`levenshtein $x ${FILENAME}`
|
|
||||||
if [ $distance -lt $winnerDistance ] ; then
|
|
||||||
winner=$x
|
|
||||||
winnerDistance=$distance
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
sum=`md5sum ${FILENAME}`
|
|
||||||
sed -i "s;.*$winner;$sum;" sources
|
|
||||||
# now shenandoah hotspot
|
|
||||||
winner=""
|
|
||||||
winnerDistance=999999
|
|
||||||
for x in $a_sources ; do
|
|
||||||
distance=`levenshtein $x ${FILENAME_SH}`
|
|
||||||
if [ $distance -lt $winnerDistance ] ; then
|
|
||||||
winner=$x
|
|
||||||
winnerDistance=$distance
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
sum=`md5sum ${FILENAME_SH}`
|
|
||||||
sed -i "s;.*$winner;$sum;" sources
|
|
||||||
|
|
||||||
echo "New sources"
|
|
||||||
cat sources
|
|
||||||
a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"`
|
|
||||||
echo " you can get inspired by following %changelog template:"
|
|
||||||
user_name=`whoami`
|
user_name=`whoami`
|
||||||
user_record=$(getent passwd $user_name)
|
user_record=$(getent passwd $user_name)
|
||||||
user_gecos_field=$(echo "$user_record" | cut -d ':' -f 5)
|
user_gecos_field=$(echo "$user_record" | cut -d ':' -f 5)
|
||||||
user_full_name=$(echo "$user_gecos_field" | cut -d ',' -f 1)
|
user_full_name=$(echo "$user_gecos_field" | cut -d ',' -f 1)
|
||||||
spec_date=`date +"%a %b %d %Y"`
|
spec_date=`date +"%a %b %d %Y"`
|
||||||
# See spec:
|
|
||||||
revision_helper=`echo ${MAIN_VERSION%-*}`
|
revision_helper=`echo ${MAIN_VERSION%-*}`
|
||||||
updatever=`echo ${revision_helper##*u}`
|
updatever=`echo ${revision_helper##*u}`
|
||||||
buildver=`echo ${MAIN_VERSION##*-}`
|
buildver=`echo ${MAIN_VERSION##*-}`
|
||||||
echo "* $spec_date $user_full_name <$user_name@redhat.com> - 1:1.8.0.$updatever-$RELEASE.$buildver"
|
echo "%chnagelog"
|
||||||
echo "- updated to $MAIN_VERSION (from $PROJECT_NAME/$MAIN_REPO_NAME)"
|
echo "* $spec_date $user_full_name <$user_name@redhat.com> - 1:MAJORVER.SECURITY.UPDATE.BUILD-RELEASE(1)"
|
||||||
echo "- updated to $VERSION (from $PROJECT_NAME/$REPO_NAME) of hotspot"
|
echo "- updated to $MAIN_FILENAME"
|
||||||
echo "- used $FILENAME as new sources"
|
echo "- updated to $SHENANDOAH_FILENAME"
|
||||||
echo "- used $FILENAME_SH as new sources for hotspot"
|
echo "- updated to $TAPSET "
|
||||||
|
echo "- adjusted buildver minorver securityver majorver acordingly"
|
||||||
echo " execute:"
|
echo "you should verify by fedpkg/rhpkg prep --arch XXXX on all architectures: x86_64 i386 i586 i686 ppc ppc64 ppc64le s390 s390x aarch64 armv7hl"
|
||||||
echo "fedpkg/rhpkg new-sources "$a_sources
|
|
||||||
echo " to upload sources"
|
|
||||||
echo "you can verify by fedpkg/rhpkg prep --arch XXXX on all architectures: x86_64 i386 i586 i686 ppc ppc64 ppc64le s390 s390x aarch64 armv7hl"
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user