source: BLFS/gen_pkg_book.sh@ fc62e52

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

TRACKING_DIR isn't used here.
Trailing spaces clean-up.

  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/bash
2
3#
4# Read and parse the configuration parameters..
5#
6ConfigFile="configuration"
7while [ 0 ]; do
8 read || break 1
9
10 # Garbage collection
11 case ${REPLY} in
12 \#* | '') continue ;;
13 esac
14
15 case "${REPLY}" in
16 CONFIG_ALSA=* | \
17 CONFIG_GNOME-CORE=* | \
18 CONFIG_GNOME-FULL=* | \
19 CONFIG_KDE-CORE=* | \
20 CONFIG_KDE-FULL=* | \
21 CONFIG_KDE-KOFFICE=* | \
22 CONFIG_XORG7=* ) REPLY=${REPLY%=*} # Strip the trailing '=y' test.. unecessary
23 echo -n "${REPLY}"
24 if [[ $((++cntr)) > 1 ]]; then
25 echo " <<-- ERROR:: SELECT ONLY 1 PACKAGE AT A TIME, META-PACKAGE NOT SELECTED"
26 else
27 echo ""
28 optTARGET=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z])
29 fi
30 continue ;;
31
32 # Create global variables for these parameters.
33 optDependency=* | \
34 PRINT_SERVER=* | \
35 MAIL_SERVER=* | \
36 GHOSTSCRIPT=* | \
37 KBR5=* | \
38 X11=* | \
39 SUDO=* ) eval ${REPLY} # Define/set a global variable..
40 continue ;;
41 esac
42
43 if [[ "${REPLY}" =~ "^CONFIG_" ]]; then
44 echo -n "$REPLY"
45 if [[ $((++cntr)) > 1 ]]; then
46 echo " <<-- ERROR SELECT ONLY 1 PACKAGE AT A TIME, WILL NOT BUILD"
47 else
48 echo ""
49 optTARGET=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' )
50 fi
51 fi
52done <$ConfigFile
53if [[ $optTARGET = "" ]]; then
54 echo -e "\n>>> NO TARGET SELECTED.. applicaton terminated"
55 echo -e " Run <make> again and select a package to build\n"
56 exit 0
57fi
58
59#
60# Regenerate the META-package dependencies from the configuration file
61#
62rm -f libs/*.dep-MOD
63while [ 0 ]; do
64 read || break 1
65 case ${REPLY} in
66 \#* | '') continue ;;
67 esac
68
69 # Drop the "=y"
70 REPLY=${REPLY%=*}
71 if [[ "${REPLY}" =~ "^DEP_" ]]; then
72 META_PACKAGE=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z])
73 DEP_FNAME=$(echo $REPLY | cut -d "_" -f3)
74 echo "${DEP_FNAME}" >>libs/${META_PACKAGE}.dep-MOD
75 fi
76
77done <$ConfigFile
78#
79# Replace to 'old' dependency file with a new one.
80#
81for dst in `ls ./libs/*.dep-MOD 2>/dev/null`; do
82 cp -vf $dst ${dst%-MOD}
83done
84
85
86set -e
87declare TARGET=$optTARGET
88declare DEP_LEVEL=$optDependency
89declare PKGXML
90declare BLFS_XML
91declare VERBOSITY=1
92[[ -z $SUDO ]] && SUDO=y
93
94#---------------------
95# Constants
96source libs/constants.inc
97[[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit
98
99#---------------------
100# Dependencies module
101source libs/func_dependencies
102[[ $? > 0 ]] && echo -e "\n\tERROR: func_dependencies did not load..\n" && exit
103
104#---------------------
105# parser module
106source libs/func_parser
107[[ $? > 0 ]] && echo -e "\n\tERROR: func_parser did not load..\n" && exit
108
109
110#------- MAIN --------
111if [[ ! -f packages ]] ; then
112 echo -e "\tNo packages file has been found.\n"
113 echo -e "\tExecution aborted.\n"
114 exit 1
115fi
116
117generate_dependency_tree
118generate_TARGET_xml
119generate_target_book
120create_build_scripts "${SUDO}"
Note: See TracBrowser for help on using the repository browser.