2f50aa1
#!/bin/sh
2f50aa1
# Generate a commit for a rawhide RC release
2f50aa1
2f50aa1
source scripts/kernel-version.sh
2f50aa1
177691d
klist -s
177691d
if [ ! $? -eq 0 ]; then
177691d
	echo "klist couldn't read the credential cache."
177691d
	echo "Do you need to fix your kerberos tokens?"
177691d
	exit 1
177691d
fi
177691d
2f50aa1
make release
2f50aa1
# fixup the release because rpmdev-bumpspec *sigh*
2f50aa1
scripts/fixup-bumpspec.sh
2f50aa1
fedpkg commit -c
2f50aa1
2f50aa1
# Figure out what is our RC
4894ff8
RC=`grep "%global rcrev" kernel.spec| cut -d ' ' -f 3`
2f50aa1
RC=$(($RC+1))
1713b62
BASE=`grep "%define base_sublevel" kernel.spec| cut -d ' ' -f 3`
7e1781f
OLDBASE=$BASE
4894ff8
# See comment in kernel.spec about the base numbering
4894ff8
BASE=$(($BASE+1))
2f50aa1
2f50aa1
# Kill all patches
2f50aa1
awk '!/patch/ { print $0 }' < sources > sources.tmp
2f50aa1
mv sources.tmp sources
2f50aa1
2f50aa1
# Grab the tarball
1713b62
if [ ! -f patch-4.$BASE-rc$RC.xz ]; then
7e1781f
	wget -O patch-4.$BASE-rc$RC https://git.kernel.org/torvalds/p/v4.$BASE-rc$RC/v4.$OLDBASE
1713b62
	if [ ! $? -eq 0 ]; then
1713b62
		exit 1
1713b62
	fi
7e1781f
	xz -9 patch-4.$BASE-rc$RC
1713b62
	fedpkg upload patch-4.$BASE-rc$RC.xz
1713b62
fi
2f50aa1
2f50aa1
# bump rcrev in the spec and set git snapshot to 0
4894ff8
RC=$RC perl -p -i -e 's|%global rcrev.*|%global rcrev $ENV{'RC'}|' kernel.spec
2f50aa1
2f50aa1
perl -p -i -e 's|%define gitrev.*|%define gitrev 0|' kernel.spec
1713b62
1713b62
perl -p -i -e 's|%global baserelease.*|%global baserelease 0|' kernel.spec
1713b62
1713b62
rpmdev-bumpspec -c "Linux v4.$BASE-rc$RC" kernel.spec
e338779
e338779
echo "Don't forget to bump kernel-tools"