#! /bin/sh #---------------------------------------------------------------------------- # /var/install/bin/pre-setup-packages-section-menu # # Creation: 2009-08-25 hbfl # Last Update: $Id$ # # Copyright (c) 2001-2011 the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # Definition valid_sections and check_section () copied from list-packages # check_section () modified # --------------------------------------------------------------------------- # Define list of valid sections # --------------------------------------------------------------------------- _valid_sections="backup base chat communication contrib database devel drivers game lib libdev mail misc multimedia netservices netutils news plang printer-file security system utils web" # --------------------------------------------------------------------------- # check_section # # check if the section is valid an writes the result to $section_invalid # --------------------------------------------------------------------------- check_section () { _section_invalid="true" if echo "${_valid_sections}" | grep -q "^${_sec}$" then _section_invalid="false" fi } # create a packages-section menu with all section entries # that was found in the packages-root from the system folders=/var/install/packages { echo "List packages by section" echo "base" echo "" echo "" _section=`grep -r "section>" ${folders} | sed 's#.*:##; s###g; s# ##g' | sort -u` echo "" echo "" echo "" for _sec in ${_section} do _sec_first=`echo ${_sec} | cut -c1 | tr [:lower:] [:upper:]` _sec_secon=`echo ${_sec} | cut -c2-` check_section if ${_section_invalid} then echo "" else echo "" fi done echo "" } > /var/install/menu/setup.packages.section.menu chmod 0640 /var/install/menu/setup.packages.section.menu exit 0