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