2016-11-10 18:16:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-11-05 22:10:53 +00:00
|
|
|
# Adjusts the configuration options to build the variants correctly
|
|
|
|
|
2022-05-09 13:31:19 +00:00
|
|
|
test -n "$RHTEST" && exit 0
|
|
|
|
|
2022-04-20 13:35:44 +00:00
|
|
|
DEBUGBUILDSENABLED=$1
|
|
|
|
if [ -z "$DEBUGBUILDSENABLED" ]; then
|
2019-11-05 22:10:53 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-04-20 13:35:44 +00:00
|
|
|
if [ -z "$FLAVOR" ]; then
|
|
|
|
FLAVOR=rhel
|
2020-08-24 14:10:00 +00:00
|
|
|
fi
|
|
|
|
|
2022-04-20 13:35:44 +00:00
|
|
|
if [ "$FLAVOR" = "fedora" ]; then
|
2019-11-05 22:10:53 +00:00
|
|
|
SECONDARY=rhel
|
|
|
|
else
|
|
|
|
SECONDARY=fedora
|
|
|
|
fi
|
|
|
|
|
2023-03-09 17:28:11 +00:00
|
|
|
# The +1 is to remove the - at the end of the SPECPACKAGE_NAME string
|
|
|
|
specpackage_name_len=$((${#SPECPACKAGE_NAME} + 1))
|
|
|
|
for i in ${SPECPACKAGE_NAME}*-"$FLAVOR".config; do
|
2023-04-12 14:35:24 +00:00
|
|
|
NEW=${SPECPACKAGE_NAME}-"$SPECRPMVERSION"-$(echo ${i:$specpackage_name_len} | sed s/-"$FLAVOR"//)
|
2020-10-12 13:20:43 +00:00
|
|
|
mv "$i" "$NEW"
|
2016-11-10 18:16:25 +00:00
|
|
|
done
|
2019-11-05 22:10:53 +00:00
|
|
|
|
2020-10-12 13:20:43 +00:00
|
|
|
rm -f kernel-*-"$SECONDARY".config
|
2019-11-05 22:10:53 +00:00
|
|
|
|
2020-10-12 13:20:43 +00:00
|
|
|
if [ "$DEBUGBUILDSENABLED" -eq 0 ]; then
|
2023-03-09 17:28:11 +00:00
|
|
|
for i in ${SPECPACKAGE_NAME}-*debug*.config; do
|
2020-10-12 13:20:43 +00:00
|
|
|
base=$(echo "$i" | sed -r s/-?debug//g)
|
2023-03-09 17:28:11 +00:00
|
|
|
NEW=${SPECPACKAGE_NAME}-$(echo "$base" | cut -d - -f2-)
|
2020-10-12 13:20:43 +00:00
|
|
|
mv "$i" "$NEW"
|
2019-11-05 22:10:53 +00:00
|
|
|
done
|
|
|
|
fi
|