From 6e31ef7aa450c2e557ba035c8bc7450c6ee4b9b9 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Wed, 12 Oct 2005 10:07:29 +0000 Subject: [PATCH] Added some command-line sanity checks. Started support for timezone setting. --- jhalfs | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/jhalfs b/jhalfs index 25b6492..bf579ee 100755 --- a/jhalfs +++ b/jhalfs @@ -37,9 +37,12 @@ Options: --no-toolchain-test don't run the toolchain testsuites. This disables also the build of TCL, Expect and DejaGNU + + --timezone TIMEZONE set TIMEZONE as the local timezone. If not + specified, Europe/London will be used. - --page_size PAGE set PAGE as the default page size (letter, - A4, or others). This setting is required to + --page_size PAGE set PAGE as the default page size (letter + or A4). This setting is required to build Groff. If not specified, \"letter\" will be used. @@ -107,8 +110,14 @@ while test $# -gt 0 ; do --working-copy | -W ) test $# = 1 && eval "$exit_missing_arg" shift + if [ -f $1/patches.ent ] ; then WC=1 BOOK=$1 + else + echo -e "\nLook like $1 isn't a supported working copy." + echo -e "Verify your selection and the command line.\n" + exit 1 + fi shift ;; @@ -130,7 +139,15 @@ while test $# -gt 0 ; do --page_size ) test $# = 1 && eval "$exit_missing_arg" shift - PAGE=$1 + case $1 in + letter | A4 ) + PAGE=$1 + ;; + * ) + echo "$1 isn't a supported page size." + exit 1 + ;; + esac shift ;; @@ -139,13 +156,27 @@ while test $# -gt 0 ; do shift ;; + --timezone | -C ) + test $# = 1 && eval "$exit_missing_arg" + shift + if [ -f /usr/share/zoneinfo/$1 ] ; then + TIMEZONE=$1 + else + echo -e "\nLook like $1 isn't a valid timezone description." + echo -e "Verify your selection and the command line.\n" + exit 1 + fi + shift + ;; + --kernel-config | -C ) test $# = 1 && eval "$exit_missing_arg" shift if [ -f $1 ] ; then CONFIG=$1 else - echo -e "\nFile $1 not found, Skipping kernel build.\n" + echo -e "\nFile $1 not found. Verify your command line.\n" + exit 1 fi shift ;; @@ -188,6 +219,7 @@ FNC=functions if [ -z $TEST ] ; then TEST=0 ; fi if [ -z $TOOLCHAINTEST ] ; then TOOLCHAINTEST=1 ; fi if [ -z $PAGE ] ; then PAGE=letter ; fi +if [ -z $TIMEZONE ] ; then TIMEZONE=Europe/London ; fi HEADER="# This file is automatically generated by jhalfs # DO NOT EDIT THIS FILE MANUALLY @@ -821,7 +853,7 @@ clean-chapter5: echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\ echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\ echo "export LFS LC_ALL PATH" >> /home/lfs/.bashrc && \\ - echo ". $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\ + echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\ chown lfs:lfs /home/lfs/.bash* && \\ touch envars && \\ touch \$@ @@ -847,17 +879,17 @@ run_make() { } if [ ! -d $JHALFSDIR ] ; then - mkdir -p $JHALFSDIR + mkdir -pv $JHALFSDIR fi if [ ! -d $LOGDIR ] ; then - mkdir $LOGDIR + mkdir -v $LOGDIR fi >$LOGDIR/$LOG if [ "$PWD" != "$JHALFSDIR" ] ; then - cp $0 $XSL $FNC $JHALFSDIR/ + cp -v $0 $XSL $FNC $JHALFSDIR/ fi get_book