Changeset 1db9dca


Ignore:
Timestamp:
11/24/2005 07:19:16 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
0.2
Children:
61784cd
Parents:
b6ca323
Message:

Merged r2204 and r2205 from trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jhalfs

    rb6ca323 r1db9dca  
    2727                                jhalfs produces will be in the directory
    2828                                DIR/jhalfs. Default is \"/mnt/lfs\".
     29
     30  --rebuild                     clean the build directory before to perfom
     31                                any other task. The directory is cleaned
     32                                only if it was populated by a previous
     33                                jhalfs run.
    2934
    3035  -P, --get-packages            download the packages and patches. This
     
    113118###################################
    114119
     120
     121#----------------------------#
     122clean_builddir() {
     123#----------------------------#
     124  # Test if the clean must be done.
     125  if [ "$CLEAN" = "1" ] ; then
     126    # Test to make sure we're running the clean as root
     127    if [ "$UID" != "0" ] ; then
     128      echo "You must be logged in as root to clean the build directory."
     129      exit 1
     130    fi
     131    # Test to make sure that the build directory was populated by jhalfs
     132    if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then
     133      echo "Look like $BUILDDIR was not populated by a previous jhalfs run."
     134      exit 1
     135    else
     136      # Clean the build directory
     137      echo -ne "Cleaning $BUILDDIR...\n"
     138      rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,usr,var}
     139      echo -ne "Cleaning $JHALFSDIR...\n"
     140      rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,commands,logs,Makefile,dump-lfs-scripts.xsl,functions,packages,patches}
     141      echo -ne "Cleaning remainig extracted sources in $BUILDDIR/sources...\n"
     142      rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d`
     143      echo -ne "done\n"
     144    fi
     145  fi
     146}
    115147
    116148#----------------------------#
     
    963995      ;;
    964996
     997    --rebuild )   CLEAN=1 ;;
     998
    965999    --download-client | -D )
    9661000      test $# = 1 && eval "$exit_missing_arg"
     
    10511085done
    10521086
     1087# Prevents setting "-d /" by mistake.
     1088
     1089if [ $BUILDDIR = / ] ; then
     1090  echo -ne "\nThe root directory can't be used to build LFS.\n\n"
     1091  exit 1
     1092fi
     1093
    10531094# If $BUILDDIR have subdirectories like tools/ or bin/, stop the run
    1054 # and notify the user about that. This also prevents setting "-d /"
    1055 # by mistake.
    1056 
    1057 if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] ; then
     1095# and notify the user about that.
     1096
     1097if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
    10581098  eval "$no_empty_builddir"
    10591099fi
     1100
     1101# If requested, clean the build directory
     1102clean_builddir
    10601103
    10611104# Find the download client to use, if not already specified.
Note: See TracChangeset for help on using the changeset viewer.