r3173 - jhalfs/trunk/common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Oct 7 12:11:58 PDT 2006


Author: manuel
Date: 2006-10-07 13:11:58 -0600 (Sat, 07 Oct 2006)
New Revision: 3173

Modified:
   jhalfs/trunk/common/common-functions
Log:
Fixed clean_builddir()

Modified: jhalfs/trunk/common/common-functions
===================================================================
--- jhalfs/trunk/common/common-functions	2006-10-07 18:58:05 UTC (rev 3172)
+++ jhalfs/trunk/common/common-functions	2006-10-07 19:11:58 UTC (rev 3173)
@@ -55,7 +55,7 @@
            echo $(grep "^linux-headers-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 )
          fi
          ;;
-     *)  echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) 
+     *)  echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 )
          ;;
    esac
 
@@ -420,24 +420,21 @@
 #----------------------------#
   # Test if the clean must be done.
   if [ "${CLEAN}" = "y" ]; then
-    # Test to make sure we're running the clean as root
-    if [ "$UID" != "0" ] ; then
-      echo "You must be logged in as root to clean the build directory."
-      exit 1
-    fi
     # Test to make sure that the build directory was populated by jhalfs
     if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then
-      echo "Looks like $BUILDDIR was not populated by a previous jhalfs-X run."
+      echo "Looks like $BUILDDIR was not populated by a previous jhalfs run."
       exit 1
     else
       # Clean the build directory
-      echo -ne "Cleaning $BUILDDIR...\n"
-      rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,cross-tools,usr,var}
-      echo -ne "Cleaning $JHALFSDIR...\n"
-      rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,*commands,*logs,Makefile,*.xsl,makefile-functions,pkg_tarball_list,*.config,*.sh}
-      echo -ne "Cleaning remainig extracted sources in $BUILDDIR/sources...\n"
-      rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d`
-      echo -ne "done\n"
+      echo -n "Cleaning $BUILDDIR ..."
+      sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,cross-tools,usr,var}
+      echo "done"
+      echo -n "Cleaning $JHALFSDIR ..."
+      sudo rm -rf $JHALFSDIR
+      echo "done"
+      echo -n "Cleaning remainig extracted sources in $BUILDDIR/sources ..."
+      sudo rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d`
+      echo "done"
     fi
   fi
 }




More information about the alfs-log mailing list