source: BLFS/libs/func_packages@ 69d25ea

experimental
Last change on this file since 69d25ea was ee8dc26, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Sort BLFS packages file by XML filename.

  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[5769ccd]1#!/bin/bash
2#
3# $Id$
4#
5set -e
6
7#-----------------------#
8generate_packages() { # Master packages file
9#-----------------------#
10 local pkg_id file
11
12 > packages.tmp
13
14 # Extract Id and path for sect1 files
15 for file in `find $BLFS_XML -name "*.xml"` ; do
16 pkg_id=`grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//'`
17 [[ ! -z "$pkg_id" ]] && echo -e "$pkg_id\t$file" >> packages.tmp
18 done
19
20 # IDs clean-up (unuseful pages or commented-out packages, could be more)
[323f805]21 sed -i '/template/d;/ntroduction/d;/preface/d;/alsa.xml/d' packages.tmp
22 sed -i '/obsolete/d;/postlfs-/d;/-client.xml/d;/xorg7.xml/d' packages.tmp
[de14f6a]23 sed -i '/courier.xml/d;/-other\t/d;/others-/d;/other-/d' packages.tmp
24 sed -i '/fw-firewall/d;/gcc2/d;/cvsserver/d;/svnserver/d' packages.tmp
[5769ccd]25
26 # Add header with meta-packages pseudo Id
27{
28 cat << EOF
[323f805]29alsa $BLFS_XML
[5769ccd]30gnome-core $BLFS_XML
31gnome-full $BLFS_XML
32kde-core $BLFS_XML
33kde-full $BLFS_XML
[ea72d77]34kde-koffice $BLFS_XML
[323f805]35xorg7 $BLFS_XML
[5769ccd]36EOF
[ee8dc26]37} >> packages.tmp
[5769ccd]38
39 # Dump packages list
[ee8dc26]40 sort packages.tmp -b --key=2 --field-separator=/ --output=packages
[5769ccd]41
42 # Clean up
43 rm packages.tmp
44}
45
46# Pre-made *.dep files for meta-packages
47
48#--------------------------#
49generate_gnome_core() { # GNOME core
50#--------------------------#
51 local line base_xml package
52
53 > gnome-core.dep.tmp
54
55 for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do
56 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
57 package=`grep "gnome/core/$base_xml" packages | cut -f1`
58 [[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp
59 done
60
[2ca2992]61 tac gnome-core.dep.tmp > libs/gnome-core.dep
[5769ccd]62 rm gnome-core.dep.tmp
63}
64
[ea72d77]65#--------------------------#
66generate_gnome_full() { # GNOME full
67#--------------------------#
68 local line base_xml package
69
70 echo "gnome-core" > gnome-full.dep.tmp
71
72 for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do
73 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
74 package=`grep "gnome/add/$base_xml" packages | cut -f1`
75 [[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp
76 done
77
[2ca2992]78 tac gnome-full.dep.tmp > libs/gnome-full.dep
[ea72d77]79 rm gnome-full.dep.tmp
80}
81
82#--------------------------#
83generate_kde_core() { # KDE core
84#--------------------------#
85 local line base_xml package
86
87 > kde-core.dep.tmp
88
89 for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do
90 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
91 package=`grep "kde/core/$base_xml" packages | cut -f1`
92 [[ -n "$package" ]] && echo $package >> kde-core.dep.tmp
93 done
94
[2ca2992]95 tac kde-core.dep.tmp > libs/kde-core.dep
[ea72d77]96 rm kde-core.dep.tmp
97}
98
99#--------------------------#
100generate_kde_full() { # KDE full
101#--------------------------#
102 local line base_xml package
103
104 echo "kde-core" > kde-full.dep.tmp
105
106 for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do
107 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
108 package=`grep "kde/add/$base_xml" packages | cut -f1`
109 [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
110 done
111
112 for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do
113 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
114 package=`grep "kde/devel/$base_xml" packages | cut -f1`
115 [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
116 done
117
[2ca2992]118 tac kde-full.dep.tmp > libs/kde-full.dep
[ea72d77]119 rm kde-full.dep.tmp
120}
[323f805]121
122#--------------------------#
123generate_kde_koffice() { # KDE full + Koffice
124#--------------------------#
125 echo -e "koffice\nkde-full\nkde-core" > libs/kde-koffice.dep
126}
127
128#--------------------------#
129generate_alsa() { # ALSA packages
130#--------------------------#
[2f16dbe]131 echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n\
[323f805]132alsa-plugins\nalsa-lib" > libs/alsa.dep
133}
134
135#--------------------------#
136generate_xorg7() { # Xorg7 packages
137#--------------------------#
[2f16dbe]138 echo -e "x-config\nx-setup\nrman\nxterm2\nxorg7-driver\nxorg7-server\nluit\n\
139xorg7-font\nxorg7-data\nxorg7-app\nxbitmaps\nmesalib\nlibdrm\n\
[323f805]140xorg7-lib\nxorg7-util\nxorg7-proto" > libs/xorg7.dep
141}
Note: See TracBrowser for help on using the repository browser.