mirror of the now-defunct rocklinux.org
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.

61 lines
2.2 KiB

  1. #!/bin/bash
  2. expert_begin
  3. comment ' '
  4. comment '- Additional Package Selection'
  5. block_begin 3
  6. choice ROCKCFG_PKGSEL_TPL none none 'No package preselection template' \
  7. $( cd misc/pkgsel ; grep -H "^# TITLE: " *.in | \
  8. tr ' ' '_' | sed 's,\.in:#_TITLE:_, ,' )
  9. if [ "$ROCKCFG_EXPERT" == 1 ] ; then
  10. if [ -f misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in ]; then
  11. pkgfilter sed -e "$( . ./misc/pkgsel/macros
  12. . ./misc/pkgsel/${ROCKCFG_PKGSEL_TPL}.in)"
  13. fi
  14. fi
  15. bool 'Custom package selection' ROCKCFG_PKGSEL 0
  16. if [ "$ROCKCFG_PKGSEL" = 1 ] ; then
  17. menu_begin MENU_PKGSEL_RULES 'Edit package selection rules'
  18. editfile ROCKCFG_PKGSEL_FILE config/$config.$swpid/pkgsel \
  19. 'Package selection rules'
  20. menu_end
  21. # Syntax for package selection rules is:
  22. # <action> <patternlist>
  23. # <action> is a single character: x or X enables the packages matching
  24. # <patternlist>, o or O disables them, - omits them in the packages list.
  25. # <patternlist> consists of one or more white-space separated sed patterns.
  26. # <action> is performed on every line in the list matching all patterns of a rule.
  27. # If the first <pattern> of a rule is a !, <action> is performed on every line
  28. # _not_ matching _any_ <pattern> of a rule.
  29. if [ "$ROCKCFG_EXPERT" == 1 ] ; then
  30. filterscript=""
  31. while read action not patternlist ; do
  32. [ "$not" != "!" ] && { patternlist="$not" ; not="" ; }
  33. case "$action" in
  34. [xX]) action='s,^O ,X ,' ;;
  35. [oO]) action='s,^X ,O ,' ;;
  36. -) action='d' ;;
  37. *) continue ;;
  38. esac
  39. while read pattern ; do
  40. filterscript="$filterscript /[ =]$pattern / $not $action ;"
  41. done < <( echo "$patternlist" | tr '\t ' '\n\n' )
  42. done < config/$config.$swpid/pkgsel
  43. pkgfilter sed -e "$filterscript"
  44. fi
  45. fi
  46. startprog ROCKCFG_SHOW_PKGLIST 'Show the current package list' \
  47. "sort -k1,1r -k3,3n \
  48. < config/$config.$swpid/packages \
  49. | cut -f1,2,4,5,8- -d' ' | sed 's, [^ ]*$,,' \
  50. | tr ' ' '\t' | expand -t2,13,30, \
  51. > config/$config.$swpid/packages.txt ; \
  52. ./src/rockdialog.bin --title 'ROCK Linux Config - Package List' \
  53. --backtitle 'ROCK Linux $rockver Configuration' \
  54. --textbox config/$config.$swpid/packages.txt \
  55. $(( $lines - 4 )) $(( $columns - 5 ))"
  56. block_end
  57. expert_end