r2107 - jhalfs/trunk

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Wed Oct 12 03:07:31 PDT 2005


Author: manuel
Date: 2005-10-12 04:07:29 -0600 (Wed, 12 Oct 2005)
New Revision: 2107

Modified:
   jhalfs/trunk/jhalfs
Log:
Added some command-line sanity checks.
Started support for timezone setting.

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2005-10-10 19:05:29 UTC (rev 2106)
+++ jhalfs/trunk/jhalfs	2005-10-12 10:07:29 UTC (rev 2107)
@@ -37,9 +37,12 @@
   --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 @@
     --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 @@
     --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 @@
       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 @@
 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 @@
 	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 @@
 }
 
 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




More information about the alfs-log mailing list