9423bd
#!/bin/sh
9423bd
9423bd
# Adjusts the configuration options to build the variants correctly
9423bd
d859dd
test -n "$RHTEST" && exit 0
9423bd
d859dd
DEBUGBUILDSENABLED=$1
d859dd
if [ -z "$DEBUGBUILDSENABLED" ]; then
9423bd
	exit 1
9423bd
fi
9423bd
d859dd
if [ -z "$FLAVOR" ]; then
d859dd
	FLAVOR=rhel
9423bd
fi
9423bd
d859dd
if [ "$FLAVOR" = "fedora" ]; then
9423bd
	SECONDARY=rhel
9423bd
else
9423bd
	SECONDARY=fedora
9423bd
fi
9423bd
d859dd
for i in kernel-*-"$FLAVOR".config; do
d859dd
	NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
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