#!/bin/bash # # $Id$ # set -e #-----------------------# generate_packages() { # Master packages file #-----------------------# local pkg_id file > packages.tmp # Extract Id and path for sect1 files for file in `find $BLFS_XML -name "*.xml"` ; do pkg_id=`grep "sect1 id" $file | sed -e 's/> packages.tmp done # IDs clean-up (unuseful pages or commented-out packages, could be more) sed -i '/template/d;/ntroduction/d;/preface/d' packages.tmp sed -i '/courier.xml/d' packages.tmp sed -i '/nautilus-media.xml/d;/gal.xml/d;/gpdf.xml/d;/gv.xml/d' packages.tmp # Add header with meta-packages pseudo Id { cat << EOF === GNOME META-PACKAGES === # GNOME base packages gnome-core $BLFS_XML # All GNOME packages gnome-full $BLFS_XML === KDE META-PACKAGES === # KDE base packages kde-core $BLFS_XML # All KDE packages kde-full $BLFS_XML # All KDE packages plus Koffice kde-koffice $BLFS_XML === INDIVIDUAL PACKAGES === EOF } > packages # Dump packages list sort packages.tmp >> packages # Clean up rm packages.tmp } # Pre-made *.dep files for meta-packages #--------------------------# generate_gnome_core() { # GNOME core #--------------------------# local line base_xml package > gnome-core.dep.tmp for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` package=`grep "gnome/core/$base_xml" packages | cut -f1` [[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp done tac gnome-core.dep.tmp > gnome-core.dep rm gnome-core.dep.tmp } #--------------------------# generate_gnome_full() { # GNOME full #--------------------------# local line base_xml package echo "gnome-core" > gnome-full.dep.tmp for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` package=`grep "gnome/add/$base_xml" packages | cut -f1` [[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp done tac gnome-full.dep.tmp > gnome-full.dep rm gnome-full.dep.tmp } #--------------------------# generate_kde_core() { # KDE core #--------------------------# local line base_xml package > kde-core.dep.tmp for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` package=`grep "kde/core/$base_xml" packages | cut -f1` [[ -n "$package" ]] && echo $package >> kde-core.dep.tmp done tac kde-core.dep.tmp > kde-core.dep rm kde-core.dep.tmp } #--------------------------# generate_kde_full() { # KDE full #--------------------------# local line base_xml package echo "kde-core" > kde-full.dep.tmp for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` package=`grep "kde/add/$base_xml" packages | cut -f1` [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp done for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do base_xml=`echo $line | sed 's/^.*href="//;s/".*//'` package=`grep "kde/devel/$base_xml" packages | cut -f1` [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp done tac kde-full.dep.tmp > kde-full.dep rm kde-full.dep.tmp }