From 5468631e314c575a168081e72a1bf32a5e0e5eb8 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sat, 7 Oct 2006 19:11:58 +0000 Subject: [PATCH] Fixed clean_builddir() --- common/common-functions | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/common/common-functions b/common/common-functions index 829d813..6667aff 100644 --- a/common/common-functions +++ b/common/common-functions @@ -55,7 +55,7 @@ get_package_tarball_name() { # 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 @@ clean_builddir() { # #----------------------------# # 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 }