Ignore:
Timestamp:
02/18/2007 12:37:10 PM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
3cb432a0
Parents:
e4f732c
Message:

Fixed clean_buildir function to handle properly dev, proc, and sys directories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/common-functions

    re4f732c ra5e3400  
    1313${tab_}${tab_}${BOLD}${RED}W A R N I N G${OFF}
    1414    Looks like the \$BUILDDIR directory contains subdirectories
    15     from a previous HLFS build.
     15    from a previous build.
    1616
    1717    Please format the partition mounted on \$BUILDDIR or set
     
    5353      echo "Looks like $BUILDDIR was not populated by a previous jhalfs run."
    5454      exit 1
     55    # Test that dev filesystems are not mounted in $BUILDDIR
     56    elif mount | grep $BUILDDIR/dev > /dev/null ; then
     57      echo "Looks like kernel fylesystems are yet mounted on $BUILDDIR."
     58      exit 1
    5559    else
    5660      # Clean the build directory
    5761      echo -n "Cleaning $BUILDDIR ..."
    58       sudo rm -rf $BUILDDIR/{bin,boot,etc,home,lib,media,mnt,opt,root,sbin,srv,tmp,tools,cross-tools,usr,var}
     62      # First delete proc and sys directories, if exit.
     63      # Both should be empty, if not be sure to exit.
     64      if [ -d $BUILDDIR/proc ] ; then
     65        sudo rmdir $BUILDDIR/proc || exit 1
     66      fi
     67      if [ -d $BUILDDIR/sys ] ; then
     68        sudo rmdir $BUILDDIR/sys || exit 1
     69      fi
     70      sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,root,sbin,srv,tmp,tools,cross-tools,usr,var}
    5971      echo "done"
    6072      echo -n "Cleaning $JHALFSDIR ..."
Note: See TracChangeset for help on using the changeset viewer.