Changeset c59f9a0


Ignore:
Timestamp:
08/14/2006 08:19:15 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
356f5bb
Parents:
8b57785
Message:

BLFS: Added validate_config support.
Added support to update an existing files and book sources installation.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • blfs

    r8b57785 rc59f9a0  
    33
    44set -e
     5
     6# From common/common-functions
     7# VT100 colors
     8declare -r  BLACK=$'\e[1;30m'
     9declare -r  DK_GRAY=$'\e[0;30m'
     10
     11declare -r  RED=$'\e[31m'
     12declare -r  GREEN=$'\e[32m'
     13declare -r  YELLOW=$'\e[33m'
     14declare -r  BLUE=$'\e[34m'
     15declare -r  MAGENTA=$'\e[35m'
     16declare -r  CYAN=$'\e[36m'
     17declare -r  WHITE=$'\e[37m'
     18
     19declare -r  OFF=$'\e[0m'
     20declare -r  BOLD=$'\e[1m'
     21declare -r  REVERSE=$'\e[7m'
     22declare -r  HIDDEN=$'\e[8m'
     23
     24declare -r  tab_=$'\t'
     25declare -r  nl_=$'\n'
     26
     27declare -r   DD_BORDER="${BOLD}==============================================================================${OFF}"
     28declare -r   SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
     29declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
     30
     31# bold yellow > <  pair
     32declare -r R_arrow=$'\e[1;33m>\e[0m'
     33declare -r L_arrow=$'\e[1;33m<\e[0m'
    534
    635
     
    3564#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    3665
    37 VERBOSITY=1
     66# envars not sourced from configuration file
     67  PROGNAME=$(basename $0)
     68COMMON_DIR="common"
     69 VERBOSITY=1
    3870
    3971[[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..."
     
    4274[[ $VERBOSITY > 0 ]] && echo "OK"
    4375
     76[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
     77source $COMMON_DIR/func_validate_configs.sh
     78[[ $? > 0 ]] && echo " function module did not load.." && exit 2
     79[[ $VERBOSITY > 0 ]] && echo "OK"
     80[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
     81
     82# Be sure that we have a configuration file
    4483[[ -z $BOOK_BLFS ]] && echo -e "\nNo BLFS configuration found. Please configure it." && exit 1
    4584
    46 TREE=trunk/BOOK
     85# Set default book version
     86BRANCH_ID=${BRANCH_ID:=development}
    4787
    48 if [[ ! -z ${BRANCH_ID} ]]; then
    49   case $BRANCH_ID in
    50     dev* | SVN | trunk )  TREE=trunk/BOOK ;;
    51               branch-* )  TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
    52                      * )  TREE=tags/${BRANCH_ID}/BOOK ;;
    53   esac
     88# Set the SVN tree
     89case $BRANCH_ID in
     90  dev* | SVN | trunk )  TREE=trunk/BOOK ;;
     91              *EDIT* )  echo " You forgot to set the branch or stable book version."
     92                        echo " Please rerun make and fix the configuration."
     93                        exit 2
     94                        ;;
     95            branch-* )  TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
     96                   * )  TREE=tags/${BRANCH_ID}/BOOK ;;
     97esac
     98
     99# For consistency with other books
     100validate_config
     101echo "${SD_BORDER}${nl_}"
     102echo -n "Are you happy with these settings? yes/no (no): "
     103read ANSWER
     104if [ x$ANSWER != "xyes" ] ; then
     105  echo "${nl_}Fix the configuration options and rerun the script.${nl_}"
     106  exit 1
    54107fi
     108echo "${nl_}${SD_BORDER}${nl_}"
    55109
     110# Install the files
    56111[[ ! -d $BLFS_ROOT ]] && mkdir -p $BLFS_ROOT
    57112
    58113cp -r BLFS/* $BLFS_ROOT
    59 cp common/progress_bar.sh $BLFS_ROOT
     114cp $COMMON_DIR/progress_bar.sh $BLFS_ROOT
    60115# cp -r menu $BLFS_ROOT
    61116
     117# Start the work
    62118cd $BLFS_ROOT
    63119
     120# Clean-up
     121rm -rf libs/.svn
     122
     123# Fix BLFS_XML harcoded values
    64124sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh
    65125sed -i 's,blfs-xml,'$BLFS_XML',' libs/book.xsl
    66126
    67 ./update_book.sh $BLFS_XML get $TREE
     127# Fetch book sources and create packages and GNOME/KDE dependencies files
     128if [[ -d $BLFS_XML ]] ; then
     129  ./update_book.sh
     130else
     131  ./update_book.sh $BLFS_XML get $TREE
     132fi
     133
     134# Generate Config.in and run the menuconfig interfaz
     135# ./gen_config.sh
    68136# make
    69137
  • common/func_validate_configs.sh

    r8b57785 rc59f9a0  
    9393  local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE         ARCH  TARGET                 OPTIMIZE REPORT                                      STRIP FSTAB             CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
    9494  local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                       TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL        VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP"
     95  local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML"
    9596
    9697  local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
     
    265266               KEYMAP=${save_param}
    266267               ;;
     268
     269      # BLFS params. No validation is required/allowed, IMHO
     270      BRANCH_ID | BLFS_ROOT | BLFS_XML)  echo "`eval echo $PARAM_VALS`" ;;
     271
    267272    esac
    268273  done
Note: See TracChangeset for help on using the changeset viewer.