linuxtorvalds / rpms / kernel

Forked from rpms/kernel 2 years ago
Clone
Justin Vreeland 794d92
#!/bin/sh
Justin Vreeland 794d92
Justin Vreeland 794d92
# Adjusts the configuration options to build the variants correctly
Justin Vreeland 794d92
#
Justin Vreeland 794d92
# arg1: configuration to go in the primary variant
Justin Vreeland 794d92
# arg2: are we only generating debug configs
Justin Vreeland 794d92
Justin Vreeland 794d92
Justin Vreeland 794d92
PRIMARY=$1
Justin Vreeland 794d92
DEBUGBUILDSENABLED=$2
Justin Vreeland 794d92
Justin Vreeland 794d92
if [ -z $2 ]; then
Justin Vreeland 794d92
	exit 1
Justin Vreeland 794d92
fi
Justin Vreeland 794d92
Justin Vreeland 794d92
if [ $PRIMARY == "fedora" ]; then
Justin Vreeland 794d92
	SECONDARY=rhel
Justin Vreeland 794d92
else
Justin Vreeland 794d92
	SECONDARY=fedora
Justin Vreeland 794d92
fi
Justin Vreeland 794d92
Justin Vreeland 794d92
for i in kernel-*-$PRIMARY.config; do
Justin Vreeland 794d92
	NEW=kernel-$VERSION-`echo $i | cut -d - -f2- | sed s/-$PRIMARY//`
Justin Vreeland 794d92
	#echo $NEW
Justin Vreeland 794d92
	mv $i $NEW
Justin Vreeland 794d92
done
Justin Vreeland 794d92
Justin Vreeland 794d92
rm kernel-*-$SECONDARY.config
Justin Vreeland 794d92
Justin Vreeland 794d92
if [ $DEBUGBUILDSENABLED -eq 0 ]; then
Justin Vreeland 794d92
	for i in kernel-*debug*.config; do
Justin Vreeland 794d92
		base=`echo $i | sed -r s/-?debug//g`
Justin Vreeland 794d92
		NEW=kernel-`echo $base | cut -d - -f2-`
Justin Vreeland 794d92
		mv $i $NEW
Justin Vreeland 794d92
	done
Justin Vreeland 794d92
fi