OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.1 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: package/.../uclibc/functions.in
  6. # Copyright (C) 2006 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. # $conffiles is a list of patters of the form
  17. # ^[XO-] <pattern> [<value>]
  18. # X means enable, O disable, and - removes it
  19. # pattern can use '*' as a wildcard for [^ #]
  20. # optionaly can set a value different that y
  21. apply_conffiles() {
  22. local file= rule=
  23. local action= prerule= value= x=
  24. if [ ! -f $builddir/config.sed ]; then
  25. for file in $conffiles $extraconffiles; do if [ -f "$file" ]; then
  26. sed -e '/^[ \t]*$/d;' -e '/^[ \t]*#.*/d;' "$file" |
  27. while read action prerule value x; do
  28. rule="$(echo $prerule | sed 's/\*/[^ #]*/')"
  29. rule="^\(# \)\?\($rule\)[= ].*\$"
  30. if [ -z "$value" ]; then
  31. value='y'
  32. fi
  33. case "$action" in
  34. X) echo "apply_conffiles: rule $prerule=$value."
  35. echo "s,$rule,\2=$value,g" >> $builddir/config.sed
  36. ;;
  37. O) echo "apply_conffiles: rule unset $prerule."
  38. echo "s,$rule,# \2 is not set,g" >> $builddir/config.sed
  39. ;;
  40. -) echo "apply_conffiles: rule remove $prerule."
  41. echo "s,$rule,,g" >> $builddir/config.sed
  42. ;;
  43. *)
  44. abort "apply_conffiles: bad rule $action $prerule $value"
  45. ;;
  46. esac
  47. done
  48. fi ; done
  49. fi
  50. sed -f $builddir/config.sed .config > $1
  51. }
  52. # get default config, and filter considering <n>
  53. # levels, because new options can appear and other disappear
  54. auto_config() {
  55. local j=1 n="${1:-1}"
  56. # defconfig
  57. eval "$MAKE defconfig"
  58. cp -v .config .config.$j
  59. j=2 ; for (( i=1 ; i<n ; i++, j++ )) {
  60. apply_conffiles .config.$j
  61. cp -v .config.$j .config
  62. yes '' | eval $MAKE oldconfig
  63. (( j++ )) ; cp -v .config .config.$j
  64. }
  65. }