Do some housekeeping in ./master.sh
This commit is contained in:
parent
5a733a4aca
commit
a0f0bee1e4
1 changed files with 27 additions and 30 deletions
53
master.sh
53
master.sh
|
@ -446,7 +446,6 @@ echo "${SD_BORDER}${nl_}"
|
||||||
|
|
||||||
validate_config
|
validate_config
|
||||||
echo "${SD_BORDER}${nl_}"
|
echo "${SD_BORDER}${nl_}"
|
||||||
|
|
||||||
echo -n "Are you happy with these settings? yes/no (no): "
|
echo -n "Are you happy with these settings? yes/no (no): "
|
||||||
read ANSWER
|
read ANSWER
|
||||||
if [ x$ANSWER != "xyes" ] ; then
|
if [ x$ANSWER != "xyes" ] ; then
|
||||||
|
@ -455,7 +454,7 @@ if [ x$ANSWER != "xyes" ] ; then
|
||||||
fi
|
fi
|
||||||
echo "${nl_}${SD_BORDER}${nl_}"
|
echo "${nl_}${SD_BORDER}${nl_}"
|
||||||
|
|
||||||
# Loadd additional modules or configuration files based on global settings
|
# Load additional modules or configuration files based on global settings
|
||||||
# compare module
|
# compare module
|
||||||
if [[ "$COMPARE" = "1" ]]; then
|
if [[ "$COMPARE" = "1" ]]; then
|
||||||
[[ $VERBOSITY > 0 ]] && echo -n "Loading compare module..."
|
[[ $VERBOSITY > 0 ]] && echo -n "Loading compare module..."
|
||||||
|
@ -470,30 +469,19 @@ if [[ "$OPTIMIZE" != "0" ]]; then
|
||||||
source optimize/optimize_functions
|
source optimize/optimize_functions
|
||||||
[[ $? > 0 ]] && echo " optimize/optimize_functions did not load.." && exit
|
[[ $? > 0 ]] && echo " optimize/optimize_functions did not load.." && exit
|
||||||
[[ $VERBOSITY > 0 ]] && echo "OK"
|
[[ $VERBOSITY > 0 ]] && echo "OK"
|
||||||
fi
|
|
||||||
#
|
#
|
||||||
# optimize configurations
|
# optimize configurations
|
||||||
if [[ "$OPTIMIZE" != "0" ]]; then
|
|
||||||
[[ $VERBOSITY > 0 ]] && echo -n "Loading optimization config..."
|
[[ $VERBOSITY > 0 ]] && echo -n "Loading optimization config..."
|
||||||
source optimize/opt_config
|
source optimize/opt_config
|
||||||
[[ $? > 0 ]] && echo " optimize/opt_config did not load.." && exit
|
[[ $? > 0 ]] && echo " optimize/opt_config did not load.." && exit
|
||||||
[[ $VERBOSITY > 0 ]] && echo "OK"
|
[[ $VERBOSITY > 0 ]] && echo "OK"
|
||||||
|
# Validate optimize settings, if required
|
||||||
|
validate_opt_settings
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
|
||||||
# Validate optimize settings, if required
|
|
||||||
[[ "$OPTIMIZE" != "0" ]] && validate_opt_settings
|
|
||||||
|
|
||||||
# Prevents setting "-d /" by mistake.
|
|
||||||
|
|
||||||
if [ $BUILDDIR = / ] ; then
|
|
||||||
echo -ne "\nThe root directory can't be used to build LFS.\n\n"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
|
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
|
||||||
# and notify the user about that.
|
# and notify the user about that.
|
||||||
|
|
||||||
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
|
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
|
||||||
eval "$no_empty_builddir"
|
eval "$no_empty_builddir"
|
||||||
fi
|
fi
|
||||||
|
@ -504,7 +492,19 @@ clean_builddir
|
||||||
if [[ ! -d $JHALFSDIR ]]; then
|
if [[ ! -d $JHALFSDIR ]]; then
|
||||||
mkdir -p $JHALFSDIR
|
mkdir -p $JHALFSDIR
|
||||||
fi
|
fi
|
||||||
|
#
|
||||||
|
# Create $BUILDDIR/sources even though it could be created by get_sources()
|
||||||
|
if [[ ! -d $BUILDDIR/sources ]]; then
|
||||||
|
mkdir -p $BUILDDIR/sources
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
# Create the log directory
|
||||||
|
if [[ ! -d $LOGDIR ]]; then
|
||||||
|
mkdir $LOGDIR
|
||||||
|
fi
|
||||||
|
>$LOGDIR/$LOG
|
||||||
|
#
|
||||||
|
#
|
||||||
if [[ "$PWD" != "$JHALFSDIR" ]]; then
|
if [[ "$PWD" != "$JHALFSDIR" ]]; then
|
||||||
cp $COMMON_DIR/makefile-functions $JHALFSDIR/
|
cp $COMMON_DIR/makefile-functions $JHALFSDIR/
|
||||||
[[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
|
[[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
|
||||||
|
@ -512,35 +512,32 @@ if [[ "$PWD" != "$JHALFSDIR" ]]; then
|
||||||
mkdir -p $JHALFSDIR/extras
|
mkdir -p $JHALFSDIR/extras
|
||||||
cp extras/* $JHALFSDIR/extras
|
cp extras/* $JHALFSDIR/extras
|
||||||
fi
|
fi
|
||||||
|
#
|
||||||
if [[ -n "$FILES" ]]; then
|
if [[ -n "$FILES" ]]; then
|
||||||
# pushd/popd necessary to deal with mulitiple files
|
# pushd/popd necessary to deal with mulitiple files
|
||||||
pushd $PACKAGE_DIR 1> /dev/null
|
pushd $PACKAGE_DIR 1> /dev/null
|
||||||
cp $FILES $JHALFSDIR/
|
cp $FILES $JHALFSDIR/
|
||||||
popd 1> /dev/null
|
popd 1> /dev/null
|
||||||
fi
|
fi
|
||||||
|
#
|
||||||
if [[ "$PROGNAME" != "blfs" ]]; then
|
if [[ "$PROGNAME" != "blfs" ]]; then
|
||||||
[[ "$REPORT" = "1" ]] && cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
|
if [[ "$REPORT" = "1" ]]; then
|
||||||
|
cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
|
||||||
|
# After be sure that all look sane and if REPORT=1, dump the settings to a file
|
||||||
|
# This file will be used to create the REPORT header
|
||||||
|
validate_config > $JHALFSDIR/jhalfs.config
|
||||||
|
fi
|
||||||
[[ "$GETPKG" = "1" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/
|
[[ "$GETPKG" = "1" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/
|
||||||
fi
|
fi
|
||||||
|
#
|
||||||
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
|
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
|
||||||
export XSL=$JHALFSDIR/${XSL}
|
export XSL=$JHALFSDIR/${XSL}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d $LOGDIR ]]; then
|
|
||||||
mkdir $LOGDIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
# After be sure that all look sane and if REPORT=1, dump the settings to a file
|
|
||||||
# This file will be used to create the REPORT header
|
|
||||||
[[ "$PROGNAME" != "blfs" ]] && [[ "$REPORT" = "1" ]] && validate_config > $JHALFSDIR/jhalfs.config
|
|
||||||
|
|
||||||
>$LOGDIR/$LOG
|
|
||||||
|
|
||||||
get_book
|
get_book
|
||||||
echo "${SD_BORDER}${nl_}"
|
echo "${SD_BORDER}${nl_}"
|
||||||
|
|
||||||
# If $BUILDDIR/sources hasn't been created yet at this point, create it.
|
|
||||||
[[ ! -d $BUILDDIR/sources ]] && mkdir $BUILDDIR/sources
|
|
||||||
|
|
||||||
build_Makefile
|
build_Makefile
|
||||||
echo "${SD_BORDER}${nl_}"
|
echo "${SD_BORDER}${nl_}"
|
||||||
|
|
Reference in a new issue