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