l30013671 / rpms / kernel

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