source: BLFS/libs/func_packages@ de14f6a

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

BLFS: packages file clean-up.

  • Property mode set to 100644
File size: 3.2 KB
Line 
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)
21 sed -i '/template/d;/ntroduction/d;/preface/d' packages.tmp
22 sed -i '/obsolete/d;/postlfs-/d;/-client.xml/d' packages.tmp
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
25
26 # Add header with meta-packages pseudo Id
27{
28 cat << EOF
29gnome-core $BLFS_XML
30gnome-full $BLFS_XML
31kde-core $BLFS_XML
32kde-full $BLFS_XML
33kde-koffice $BLFS_XML
34EOF
35} > packages
36
37 # Dump packages list
38 sort packages.tmp >> packages
39
40 # Clean up
41 rm packages.tmp
42}
43
44# Pre-made *.dep files for meta-packages
45
46#--------------------------#
47generate_gnome_core() { # GNOME core
48#--------------------------#
49 local line base_xml package
50
51 > gnome-core.dep.tmp
52
53 for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do
54 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
55 package=`grep "gnome/core/$base_xml" packages | cut -f1`
56 [[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp
57 done
58
59 tac gnome-core.dep.tmp > libs/gnome-core.dep
60 rm gnome-core.dep.tmp
61}
62
63#--------------------------#
64generate_gnome_full() { # GNOME full
65#--------------------------#
66 local line base_xml package
67
68 echo "gnome-core" > gnome-full.dep.tmp
69
70 for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do
71 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
72 package=`grep "gnome/add/$base_xml" packages | cut -f1`
73 [[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp
74 done
75
76 tac gnome-full.dep.tmp > libs/gnome-full.dep
77 rm gnome-full.dep.tmp
78}
79
80#--------------------------#
81generate_kde_core() { # KDE core
82#--------------------------#
83 local line base_xml package
84
85 > kde-core.dep.tmp
86
87 for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do
88 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
89 package=`grep "kde/core/$base_xml" packages | cut -f1`
90 [[ -n "$package" ]] && echo $package >> kde-core.dep.tmp
91 done
92
93 tac kde-core.dep.tmp > libs/kde-core.dep
94 rm kde-core.dep.tmp
95}
96
97#--------------------------#
98generate_kde_full() { # KDE full
99#--------------------------#
100 local line base_xml package
101
102 echo "kde-core" > kde-full.dep.tmp
103
104 for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do
105 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
106 package=`grep "kde/add/$base_xml" packages | cut -f1`
107 [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
108 done
109
110 for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do
111 base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
112 package=`grep "kde/devel/$base_xml" packages | cut -f1`
113 [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
114 done
115
116 tac kde-full.dep.tmp > libs/kde-full.dep
117 rm kde-full.dep.tmp
118}
Note: See TracBrowser for help on using the repository browser.