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