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