Changeset fb6913a for BLFS/gen_pkg_book.sh
- Timestamp:
- 08/22/2006 08:33:33 PM (18 years ago)
- Branches:
- experimental
- Children:
- bcdbeef
- Parents:
- b6f18566
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BLFS/gen_pkg_book.sh
rb6f18566 rfb6913a 5 5 # Read and parse the configuration parameters.. 6 6 # 7 ConfigFile="configuration" 8 while [ 0 ]; do 9 read || break 1 7 set -e 10 8 11 # Garbage collection 12 case ${REPLY} in 13 \#* | '') continue ;; 14 esac 9 declare -r ConfigFile="configuration" 10 declare TARGET 11 declare DEP_LEVEL 12 declare SUDO 13 declare PKGXML 14 declare BLFS_XML 15 declare VERBOSITY=1 15 16 16 case "${REPLY}" in 17 CONFIG_ALSA=* | \ 18 CONFIG_GNOME-CORE=* | \ 19 CONFIG_GNOME-FULL=* | \ 20 CONFIG_KDE-CORE=* | \ 21 CONFIG_KDE-FULL=* | \ 22 CONFIG_KDE-KOFFICE=* | \ 23 CONFIG_XORG7=* ) REPLY=${REPLY%=*} # Strip the trailing '=y' test.. unecessary 24 echo -n "${REPLY}" 25 if [[ $((++cntr)) > 1 ]]; then 26 echo " <<-- ERROR:: SELECT ONLY 1 PACKAGE AT A TIME, META-PACKAGE NOT SELECTED" 27 else 28 echo "" 29 optTARGET=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z]) 30 fi 31 continue ;; 17 #--------------------------# 18 parse_configuration() { # 19 #--------------------------# 20 local cntr 21 local optTARGET 22 23 while [ 0 ]; do 24 read || break 1 32 25 33 # Create global variables for these parameters. 34 optDependency=* | \ 35 PRINT_SERVER=* | \ 36 MAIL_SERVER=* | \ 37 GHOSTSCRIPT=* | \ 38 KBR5=* | \ 39 X11=* | \ 40 SUDO=* ) eval ${REPLY} # Define/set a global variable.. 26 # Garbage collection 27 case ${REPLY} in 28 \#* | '') continue ;; 29 esac 30 31 case "${REPLY}" in 32 CONFIG_ALSA=* | \ 33 CONFIG_GNOME-CORE=* | \ 34 CONFIG_GNOME-FULL=* | \ 35 CONFIG_KDE-CORE=* | \ 36 CONFIG_KDE-FULL=* | \ 37 CONFIG_KDE-KOFFICE=* | \ 38 CONFIG_XORG7=* ) REPLY=${REPLY%=*} # Strip the trailing '=y' test.. unecessary 39 echo -n "${REPLY}" 40 if [[ $((++cntr)) > 1 ]]; then 41 echo " <<-- ERROR:: SELECT ONLY 1 PACKAGE AT A TIME, META-PACKAGE NOT SELECTED" 42 else 43 echo "" 44 optTARGET=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z]) 45 fi 46 continue ;; 47 48 # Create global variables for these parameters. 49 optDependency=* | \ 50 PRINT_SERVER=* | \ 51 MAIL_SERVER=* | \ 52 GHOSTSCRIPT=* | \ 53 KBR5=* | \ 54 X11=* | \ 55 SUDO=* ) eval ${REPLY} # Define/set a global variable.. 41 56 continue ;; 42 esac57 esac 43 58 44 if [[ "${REPLY}" =~ "^CONFIG_" ]]; then 45 echo -n "$REPLY" 46 if [[ $((++cntr)) > 1 ]]; then 47 echo " <<-- ERROR SELECT ONLY 1 PACKAGE AT A TIME, WILL NOT BUILD" 48 else 49 echo "" 50 optTARGET=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' ) 59 if [[ "${REPLY}" =~ "^CONFIG_" ]]; then 60 echo -n "$REPLY" 61 if [[ $((++cntr)) > 1 ]]; then 62 echo " <<-- ERROR SELECT ONLY 1 PACKAGE AT A TIME, WILL NOT BUILD" 63 else 64 echo "" 65 optTARGET=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' ) 66 fi 51 67 fi 68 done <$ConfigFile 69 70 if [[ $optTARGET = "" ]]; then 71 echo -e "\n>>> NO TARGET SELECTED.. applicaton terminated" 72 echo -e " Run <make> again and select a package to build\n" 73 exit 0 52 74 fi 53 done <$ConfigFile 54 if [[ $optTARGET = "" ]]; then 55 echo -e "\n>>> NO TARGET SELECTED.. applicaton terminated"56 echo -e " Run <make> again and select a package to build\n"57 exit 0 58 fi 75 76 TARGET=$optTARGET 77 DEP_LEVEL=$optDependency 78 SUDO=${SUDO:-y} 79 } 80 59 81 60 82 # 61 83 # Regenerate the META-package dependencies from the configuration file 62 84 # 63 rm -f libs/*.dep-MOD 64 while [ 0 ]; do 65 read || break 1 66 case ${REPLY} in 67 \#* | '') continue ;; 68 esac 85 #--------------------------# 86 regenerate_deps() { # 87 #--------------------------# 88 89 rm -f libs/*.dep-MOD 90 while [ 0 ]; do 91 read || break 1 92 case ${REPLY} in 93 \#* | '') continue ;; 94 esac 69 95 70 96 # Drop the "=y" 71 REPLY=${REPLY%=*}72 if [[ "${REPLY}" =~ "^DEP_" ]]; then73 META_PACKAGE=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z])74 DEP_FNAME=$(echo $REPLY | cut -d "_" -f3)75 echo "${DEP_FNAME}" >>libs/${META_PACKAGE}.dep-MOD76 fi97 REPLY=${REPLY%=*} 98 if [[ "${REPLY}" =~ "^DEP_" ]]; then 99 META_PACKAGE=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z]) 100 DEP_FNAME=$(echo $REPLY | cut -d "_" -f3) 101 echo "${DEP_FNAME}" >>libs/${META_PACKAGE}.dep-MOD 102 fi 77 103 78 done <$ConfigFile79 #80 # Replace to 'old' dependency file with a new one.81 #82 for dst in `ls ./libs/*.dep-MOD 2>/dev/null`; do104 done <$ConfigFile 105 # 106 # Replace to 'old' dependency file with a new one. 107 # 108 for dst in `ls ./libs/*.dep-MOD 2>/dev/null`; do 83 109 cp -vf $dst ${dst%-MOD} 84 done 110 done 111 } 85 112 86 87 set -e88 declare TARGET=$optTARGET89 declare DEP_LEVEL=$optDependency90 declare PKGXML91 declare BLFS_XML92 declare VERBOSITY=193 [[ -z $SUDO ]] && SUDO=y94 113 95 114 #--------------------- … … 116 135 fi 117 136 137 138 parse_configuration 139 regenerate_deps 118 140 generate_dependency_tree 119 141 generate_TARGET_xml
Note:
See TracChangeset
for help on using the changeset viewer.