#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/pre-setup-packages-section-menu # # Creation: 2009-08-25 hbfl # Last Update: $Id$ # # Copyright (c) 2001-@@YEAR@@ 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" if [ -f /run/eisman-installed ] then echo mecho -n --warn "Found new eisfair package manager " mecho --std "'eisman'." mecho --warn "Please restart the package menu," mecho --warn "to make the changes take effect." echo anykey exit 127 fi # --------------------------------------------------------------------------- # 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 { echo "List packages by section" echo "base" echo "" echo "" _section=$(grep -E "^\[.*\]\[.*\]\[.*\]\[.*\]\[.*\](section)" \ "/var/lib/eisman/installed.db" | sed 's#^.*section##; s# ##g' | sort -u) echo "" echo "" 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