generate_all_configs.sh 881 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # Adjusts the configuration options to build the variants correctly
  3. test -n "$RHTEST" && exit 0
  4. DEBUGBUILDSENABLED=$1
  5. if [ -z "$DEBUGBUILDSENABLED" ]; then
  6. exit 1
  7. fi
  8. if [ -z "$FLAVOR" ]; then
  9. FLAVOR=rhel
  10. fi
  11. if [ "$FLAVOR" = "fedora" ]; then
  12. SECONDARY=rhel
  13. else
  14. SECONDARY=fedora
  15. fi
  16. # The +1 is to remove the - at the end of the SPECPACKAGE_NAME string
  17. specpackage_name_len=$((${#SPECPACKAGE_NAME} + 1))
  18. for i in "${SPECPACKAGE_NAME}"*-"$FLAVOR".config; do
  19. # shellcheck disable=SC3057
  20. NEW=${SPECPACKAGE_NAME}-"$SPECRPMVERSION"-$(echo "${i:$specpackage_name_len}" | sed s/-"$FLAVOR"//)
  21. mv "$i" "$NEW"
  22. done
  23. rm -f kernel-*-"$SECONDARY".config
  24. if [ "$DEBUGBUILDSENABLED" -eq 0 ]; then
  25. for i in "${SPECPACKAGE_NAME}"-*debug*.config; do
  26. base=$(echo "$i" | sed -r s/-?debug//g)
  27. NEW=${SPECPACKAGE_NAME}-$(echo "$base" | cut -d - -f2-)
  28. mv "$i" "$NEW"
  29. done
  30. fi