jfaracco / rpms / kernel-auto

Forked from rpms/kernel-auto 3 years ago
Clone

Blame SOURCES/generate_all_configs.sh

6bca4c
#!/bin/sh
6bca4c
6bca4c
# Adjusts the configuration options to build the variants correctly
6bca4c
#
6bca4c
# arg1: configuration to go in the primary variant
6bca4c
# arg2: are we only generating debug configs
6bca4c
6bca4c
6bca4c
PRIMARY=$1
6bca4c
DEBUGBUILDSENABLED=$2
6bca4c
6bca4c
if [ -z "$2" ]; then
6bca4c
	exit 1
6bca4c
fi
6bca4c
6bca4c
if [ -z "$PRIMARY" ]; then
6bca4c
	PRIMARY=rhel
6bca4c
fi
6bca4c
6bca4c
if [ "$PRIMARY" = "fedora" ]; then
6bca4c
	SECONDARY=rhel
6bca4c
else
6bca4c
	SECONDARY=fedora
6bca4c
fi
6bca4c
6bca4c
for i in kernel-auto-*-"$PRIMARY".config; do
6bca4c
	NEW=kernel-auto-"$VERSION"-$(echo "$i" | cut -d - -f3- | sed s/-"$PRIMARY"//)
6bca4c
	#echo $NEW
6bca4c
	mv "$i" "$NEW"
6bca4c
done
6bca4c
6bca4c
rm -f kernel-auto-*-"$SECONDARY".config
6bca4c
6bca4c
if [ "$DEBUGBUILDSENABLED" -eq 0 ]; then
6bca4c
	for i in kernel-auto-*debug*.config; do
6bca4c
		base=$(echo "$i" | sed -r s/-?debug//g)
6bca4c
		NEW=kernel-auto-$(echo "$base" | cut -d - -f3-)
6bca4c
		mv "$i" "$NEW"
6bca4c
	done
6bca4c
fi