Justin Vreeland 794355
#!/bin/sh
Justin Vreeland 794355
Justin Vreeland 794355
# Adjusts the configuration options to build the variants correctly
Justin Vreeland 794355
bde051
test -n "$RHTEST" && exit 0
Justin Vreeland 794355
bde051
DEBUGBUILDSENABLED=$1
bde051
if [ -z "$DEBUGBUILDSENABLED" ]; then
Justin Vreeland 794355
	exit 1
Justin Vreeland 794355
fi
Justin Vreeland 794355
bde051
if [ -z "$FLAVOR" ]; then
bde051
	FLAVOR=rhel
Justin Vreeland 794355
fi
Justin Vreeland 794355
bde051
if [ "$FLAVOR" = "fedora" ]; then
Justin Vreeland 794355
	SECONDARY=rhel
Justin Vreeland 794355
else
Justin Vreeland 794355
	SECONDARY=fedora
Justin Vreeland 794355
fi
Justin Vreeland 794355
bde051
for i in kernel-*-"$FLAVOR".config; do
bde051
	NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
Justin Vreeland 794355
	#echo $NEW
Justin Vreeland 794355
	mv "$i" "$NEW"
Justin Vreeland 794355
done
Justin Vreeland 794355
Justin Vreeland 794355
rm -f kernel-*-"$SECONDARY".config
Justin Vreeland 794355
Justin Vreeland 794355
if [ "$DEBUGBUILDSENABLED" -eq 0 ]; then
Justin Vreeland 794355
	for i in kernel-*debug*.config; do
Justin Vreeland 794355
		base=$(echo "$i" | sed -r s/-?debug//g)
Justin Vreeland 794355
		NEW=kernel-$(echo "$base" | cut -d - -f2-)
Justin Vreeland 794355
		mv "$i" "$NEW"
Justin Vreeland 794355
	done
Justin Vreeland 794355
fi