From d3ce1732ecd72a5dd183c1d83a95795a4d52b08b Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sun, 13 Aug 2006 14:38:12 +0000 Subject: [PATCH] Created BLFS master script code. --- BLFS/libs/book.xsl | 4 +-- Config.in | 28 ++++++++++++++++--- blfs | 67 ++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 92 insertions(+), 7 deletions(-) diff --git a/BLFS/libs/book.xsl b/BLFS/libs/book.xsl index bfc6a1c..1a1c6b5 100644 --- a/BLFS/libs/book.xsl +++ b/BLFS/libs/book.xsl @@ -6,8 +6,8 @@ - + diff --git a/Config.in b/Config.in index 97dc0a9..31f0c4a 100644 --- a/Config.in +++ b/Config.in @@ -22,8 +22,8 @@ menu "--- BOOK Settings" config BOOK_HLFS bool "Hardened Linux From Scratch" -# config BOOK_BLFS -# bool "Beyond Linux From Scratch" + config BOOK_BLFS + bool "Beyond Linux From Scratch" endchoice config RUN_ME @@ -33,7 +33,7 @@ menu "--- BOOK Settings" default "./clfs2" if BOOK_CLFS2 # default "./clfs3" if BOOK_CLFS3 default "./hlfs" if BOOK_HLFS -# default "./blfs" if BOOK_BLFS + default "./blfs" if BOOK_BLFS #--- End BOOK/script #--- Book version @@ -47,6 +47,7 @@ menu "--- BOOK Settings" config WORKING_COPY bool "Working Copy" + depends on !BOOK_BLFS help #-- A local working copy @@ -277,10 +278,29 @@ menu "--- BOOK Settings" default "uclibc" if LIB_UCLIBC #--- End HLFS specific params + #--- BLFS specific params + config BLFS_ROOT + string "Directory root" + default "$HOME/blfs_root" + depends on BOOK_BLFS + help + #-- Full path to the directory where all required + # files and scripts will be stored. + + config BLFS_XML + string "BLFS sources directory" + default "blfs-xml" + depends on BOOK_BLFS + help + #-- The directory name where BLFS book sources + # will be checkout. + #--- End BLFS specific params + #--- End BOOK Settings endmenu menu "--- General Settings" + depends on !BOOK_BLFS #--- Set User Account config CONFIG_USER @@ -383,6 +403,7 @@ menu "--- General Settings" endmenu menu "--- Build Settings" + depends on !BOOK_BLFS #--- Test Suites config CONFIG_TESTS @@ -548,6 +569,7 @@ menu "--- Build Settings" endmenu menu "--- Advanced Features" + depends on !BOOK_BLFS config CONFIG_REPORT bool "Create SBU and disk usage report" diff --git a/blfs b/blfs index 19dc883..d522792 100755 --- a/blfs +++ b/blfs @@ -1,6 +1,69 @@ #!/bin/bash +# $Id$ + set -e -echo -e "\n BLFS support has been dissabled for now.\n" -exit 0 +#>>>>>>>>>>>>>>>ERROR TRAPPING >>>>>>>>>>>>>>>>>>>> +#-----------------------# +simple_error() { # Basic error trap.... JUST DIE +#-----------------------# + # If +e then disable text output + if [[ "$-" =~ "e" ]]; then + echo -e "\n${RED}ERROR:${GREEN} basic error trapped!${OFF}\n" >&2 + fi +} + +see_ya() { + echo -e "\n\t${BOLD}Goodbye and thank you for choosing ${L_arrow}jhalfs${R_arrow}\n" +} +##### Simple error TRAPS +# ctrl-c SIGINT +# ctrl-y +# ctrl-z SIGTSTP +# SIGHUP 1 HANGUP +# SIGINT 2 INTRERRUPT FROM KEYBOARD Ctrl-C +# SIGQUIT 3 +# SIGKILL 9 KILL +# SIGTERM 15 TERMINATION +# SIGSTOP 17,18,23 STOP THE PROCESS +##### +set -e +trap see_ya 0 +trap simple_error ERR +trap 'echo -e "\n\n${RED}INTERRUPT${OFF} trapped\n" && exit 2' 1 2 3 15 17 18 23 +#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +VERBOSITY=1 + +[[ $VERBOSITY > 0 ]] && echo -n "Loading config params from ..." +source configuration +[[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1 +[[ $VERBOSITY > 0 ]] && echo "OK" + +[[ -z $BOOK_BLFS ]] && echo -e "\nNo BLFS configuration found. Please configure it." && exit 1 + +TREE=trunk/BOOK + +if [[ ! -z ${BRANCH_ID} ]]; then + case $BRANCH_ID in + dev* | SVN | trunk ) TREE=trunk/BOOK ;; + branch-* ) TREE=branches/${BRANCH_ID#branch-}/BOOK ;; + * ) TREE=tags/${BRANCH_ID}/BOOK ;; + esac +fi + +[[ ! -d $BLFS_ROOT ]] && mkdir -p $BLFS_ROOT + +cp -r BLFS/* $BLFS_ROOT +cp common/progress_bar.sh $BLFS_ROOT +# cp -r menu $BLFS_ROOT + +cd $BLFS_ROOT + +sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh +sed -i 's,blfs-xml,'$BLFS_XML',' libs/book.xsl + +./update_book.sh $BLFS_XML get $TREE +# make +