From c7b535b488773a93b17f05ae79d3796be750b7fe Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 3 Feb 2018 16:37:32 +0000 Subject: [PATCH] Remove the need to have write access to BUILDDIR, using sudi, which is required anyway. ticket #1715 --- common/libs/func_install_blfs | 5 ++++- common/libs/func_validate_configs.sh | 2 +- jhalfs | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/libs/func_install_blfs b/common/libs/func_install_blfs index e86d9e2..4b728af 100644 --- a/common/libs/func_install_blfs +++ b/common/libs/func_install_blfs @@ -7,7 +7,10 @@ install_blfs_tools() { # the scriptlets to build #----------------------------# the dependency tools set -e # Install the files -[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -pv ${BUILDDIR}${BLFS_ROOT} +[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && { + sudo mkdir -pv ${BUILDDIR}${BLFS_ROOT} + sudo chown $USER:$USER ${BUILDDIR}${BLFS_ROOT} +} cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT} cp -r menu ${BUILDDIR}${BLFS_ROOT} cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT} diff --git a/common/libs/func_validate_configs.sh b/common/libs/func_validate_configs.sh index 8c59c97..14bbc6c 100644 --- a/common/libs/func_validate_configs.sh +++ b/common/libs/func_validate_configs.sh @@ -177,7 +177,7 @@ inline_doc # warning -z+ -w+ SRC_ARCHIVE) [[ "$GETPKG" = "y" ]] && validate_dir -z+ -d -w+ ;; # The build directory/partition MUST exist and be writable by the user - BUILDDIR) validate_dir -z -d -w + BUILDDIR) validate_dir -z -d [[ "xx x/x" =~ x${!config_param}x ]] && write_error_and_die ;; LHOME) validate_dir -z -d ;; diff --git a/jhalfs b/jhalfs index a5dc2d6..ebe1ad6 100755 --- a/jhalfs +++ b/jhalfs @@ -358,12 +358,14 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then clean_builddir if [[ ! -d $JHALFSDIR ]]; then - mkdir -p $JHALFSDIR + sudo mkdir -p $JHALFSDIR + sudo chown $USER:$USER $JHALFSDIR fi # Create $BUILDDIR/sources even though it could be created by get_sources() if [[ ! -d $BUILDDIR/sources ]]; then - mkdir -p $BUILDDIR/sources + sudo mkdir -p $BUILDDIR/sources + sudo chmod a+wt $BUILDDIR/sources fi # Create the log directory