From: Ivan K. <ch...@us...> - 2006-07-31 01:04:28
|
Update of /cvsroot/ipcop/ipcop In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv12153 Modified Files: make.sh Log Message: Let's also settle on the usage of shorthand if conditionals. [ !-f .config ] && exit 1 is a good usage [ !-f .config ] && { commands commands if [ condition ]; then commands commands fi more commands } is not a good usage. So I suggest we limit the use of shorthand ifs to one-lines only. Index: make.sh =================================================================== RCS file: /cvsroot/ipcop/ipcop/make.sh,v retrieving revision 1.265 retrieving revision 1.266 diff -C2 -d -r1.265 -r1.266 *** make.sh 31 Jul 2006 00:42:38 -0000 1.265 --- make.sh 31 Jul 2006 01:04:24 -0000 1.266 *************** *** 294,298 **** do ask_for_input "Do you want to use a link to a common cache directory" "no yes" ! [ "$ANSWER" == "yes" ] && { echo -n "Enter dir location:" read DIR --- 294,298 ---- do ask_for_input "Do you want to use a link to a common cache directory" "no yes" ! if [ "$ANSWER" == "yes" ]; then echo -n "Enter dir location:" read DIR *************** *** 303,307 **** echo -n "Dir doesn't exist! " ! } done --- 303,307 ---- echo -n "Dir doesn't exist! " ! fi done *************** *** 324,328 **** ask_for_input "Do you want to copy pxe files to your tftpserver and ipcop.tgz to your web server" "no yes" ! [ "$ANSWER" == "yes" ] && { echo -n "Enter scp location for tftp server:" read DIR --- 324,328 ---- ask_for_input "Do you want to copy pxe files to your tftpserver and ipcop.tgz to your web server" "no yes" ! if [ "$ANSWER" == "yes" ]; then echo -n "Enter scp location for tftp server:" read DIR *************** *** 334,338 **** echo "#PXE: use export PXE_WWW=a_destination_for_scp to copy files at end of job" >> $IPCOP_CONFIG [ ! -z $DIR ] && echo "PXE_WWW=$DIR" >> $IPCOP_CONFIG ! } echo >> $IPCOP_CONFIG --- 334,338 ---- echo "#PXE: use export PXE_WWW=a_destination_for_scp to copy files at end of job" >> $IPCOP_CONFIG [ ! -z $DIR ] && echo "PXE_WWW=$DIR" >> $IPCOP_CONFIG ! fi echo >> $IPCOP_CONFIG *************** *** 357,362 **** . $IPCOP_CONFIG # some variable have to be present, some other not. Check here. ! [ -z $MACHINE ] && echo -n "MACHINE is not set." && beautify message FAIL && exit ! [ -z $USE_LIBC ] && echo -n "USE_LIBC is not set." && beautify message FAIL && exit return # success! --- 357,371 ---- . $IPCOP_CONFIG # some variable have to be present, some other not. Check here. ! if [ -z $MACHINE ]; then ! echo -n "MACHINE is not set." ! beautify message FAIL ! exit 1 ! fi ! ! if [ -z $USE_LIBC ]; then ! echo -n "USE_LIBC is not set." ! beautify message FAIL ! exit 1 ! fi return # success! *************** *** 1336,1343 **** # First, check we have configuration data and read them or evaluate them ! [ "$1" == "configure" ] && { ! configurereal ! exit ! } configure set_toolchain_variables --- 1345,1353 ---- # First, check we have configuration data and read them or evaluate them ! if [ "$1" == "configure" ]; then ! configurereal ! exit 0 ! fi ! configure set_toolchain_variables *************** *** 1347,1351 **** build) # delete some log files to force rebuild of corresponding package ! [ ! -z "$FORCE_REBUILD_LIST" ] && { cd $BASEDIR/log_${MACHINE}_${USE_LIBC} for i in $FORCE_REBUILD_LIST --- 1357,1361 ---- build) # delete some log files to force rebuild of corresponding package ! if [ ! -z "$FORCE_REBUILD_LIST" ]; then cd $BASEDIR/log_${MACHINE}_${USE_LIBC} for i in $FORCE_REBUILD_LIST *************** *** 1353,1357 **** rm -f $i done ! } #a prebuilt toolchain package is only used if found in cache --- 1363,1367 ---- rm -f $i done ! fi #a prebuilt toolchain package is only used if found in cache *************** *** 1387,1415 **** fi ! [ "$BUILD_BASE" == "yes" ] && { beautify build_stage "Building base ($USE_LIBC)" buildbase ! } ! [ "$BUILD_IPCOP" == "yes" ] && { beautify build_stage "Building ipcop ($USE_LIBC)" buildipcop ! } ! [ "$BUILD_INSTALLER" == "yes" ] && { beautify build_stage "Building installer ($USE_LIBC)" buildinstaller ! } ! [ "$BUILD_PACKAGES" == "yes" ] && { beautify build_stage "Building packages ($USE_LIBC)" buildpackages ! } # when developping/debugging, PXE + web server is much more rapid than burning CD or USb key ! [ ! -z $PXE_TFTP ] && scp $BASEDIR/build_${MACHINE}_${USE_LIBC}$INSTALLER_DIR/cdrom/boot/isolinux/{instroot,vmlinuz} $PXE_TFTP/ ! [ ! -z $PXE_WWW ] && scp $BASEDIR/build_${MACHINE}_${USE_LIBC}$INSTALLER_DIR/cdrom/${SNAME}-${VERSION}.tar.lzma $PXE_WWW ! [ ! -z $PXE_WWW ] && scp $BASEDIR/build_${MACHINE}_${USE_LIBC}$INSTALLER_DIR/cdrom/${SNAME}-${VERSION}-config.tar.lzma $PXE_WWW ! [ ! -z $PXE_WWW ] && scp $BASEDIR/build_${MACHINE}_${USE_LIBC}$INSTALLER_DIR/cdrom/${SNAME}-${VERSION}.squashfs $PXE_WWW #temporary comment while alpha stage: --- 1397,1436 ---- fi ! if [ "$BUILD_BASE" == "yes" ]; then beautify build_stage "Building base ($USE_LIBC)" buildbase ! fi ! if [ "$BUILD_IPCOP" == "yes" ]; then beautify build_stage "Building ipcop ($USE_LIBC)" buildipcop ! fi ! if [ "$BUILD_INSTALLER" == "yes" ]; then beautify build_stage "Building installer ($USE_LIBC)" buildinstaller ! fi ! if [ "$BUILD_PACKAGES" == "yes" ]; then beautify build_stage "Building packages ($USE_LIBC)" buildpackages ! fi # when developping/debugging, PXE + web server is much more rapid than burning CD or USb key ! if [ ! -z $PXE_TFTP ]; then ! scp $BASEDIR/build_${MACHINE}_${USE_LIBC}$INSTALLER_DIR/cdrom/boot/isolinux/{instroot,vmlinuz} $PXE_TFTP/ ! fi ! ! if [ ! -z $PXE_WWW ]; then ! scp $BASEDIR/build_${MACHINE}_${USE_LIBC}$INSTALLER_DIR/cdrom/${SNAME}-${VERSION}.tar.lzma $PXE_WWW ! fi ! ! if [ ! -z $PXE_WWW ]; then ! scp $BASEDIR/build_${MACHINE}_${USE_LIBC}$INSTALLER_DIR/cdrom/${SNAME}-${VERSION}-config.tar.lzma $PXE_WWW ! fi ! ! if [ ! -z $PXE_WWW ]; then ! scp $BASEDIR/build_${MACHINE}_${USE_LIBC}$INSTALLER_DIR/cdrom/${SNAME}-${VERSION}.squashfs $PXE_WWW ! fi #temporary comment while alpha stage: |