source: BLFS/libs/func_packages@ d3f24df

experimental
Last change on this file since d3f24df was 2ca2992, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Moved function, XSL, and pre-made dependencies files to libs directory.

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