Fixed clean_builddir()

This commit is contained in:
Manuel Canales Esparcia 2006-10-07 19:11:58 +00:00
parent 640e48be9f
commit 5468631e31

View file

@ -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
}