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