|
762 | 762 | [[ ${VERBOSE} -eq 1 ]] && echo "add fusemount options for CVMFS repo '${cvmfs_repo}'" |
763 | 763 | # split into name, access mode, and mount mode |
764 | 764 | readarray -td, cvmfs_repo_args <<<"$cvmfs_repo" |
765 | | - cvmfs_repo_name=$(sed -e 's/\\n//g' <<< "${cvmfs_repo_args[0]}") |
| 765 | + cvmfs_repo_name=${cvmfs_repo_args[0]%$'\n'} # remove possible trailing newline |
766 | 766 | cvmfs_repo_access="${ACCESS}" # initialize to the default access mode |
| 767 | + cvmfs_repo_mount="fuse" # use fuse mounts by default |
767 | 768 | for arg in ${cvmfs_repo_args[@]:1}; do |
768 | 769 | if [[ $arg == "access="* ]]; then |
769 | 770 | cvmfs_repo_access=${arg/access=} |
| 771 | + # remove possible trailing newline |
| 772 | + cvmfs_repo_access=${cvmfs_repo_access%$'\n'} |
770 | 773 | fi |
771 | 774 | if [[ $arg == "mount="* ]]; then |
772 | 775 | cvmfs_repo_mount=${arg/mount=} |
773 | | - # check if the specified mount mode is a valid one |
774 | | - if [[ ${cvmfs_repo_mount} != "bind" ]] && [[ ${cvmfs_repo_mount} != "fuse" ]]; then |
775 | | - echo -e "ERROR: mount mode '${cvmfs_repo_mount}' for CVMFS repository\n '${cvmfs_repo_name}' is not known" |
776 | | - exit ${REPOSITORY_ERROR_EXITCODE} |
777 | | - fi |
| 776 | + # remove possible trailing newline |
| 777 | + cvmfs_repo_mount=${cvmfs_repo_mount%$'\n'} |
778 | 778 | fi |
779 | 779 | done |
780 | 780 |
|
| 781 | + # check if the specified mount mode is a valid one |
| 782 | + if [[ ${cvmfs_repo_mount} != "bind" ]] && [[ ${cvmfs_repo_mount} != "fuse" ]]; then |
| 783 | + echo -e "ERROR: mount mode '${cvmfs_repo_mount}' for CVMFS repository\n '${cvmfs_repo_name}' is not known" |
| 784 | + exit ${REPOSITORY_ERROR_EXITCODE} |
| 785 | + fi |
| 786 | + [[ ${VERBOSE} -eq 1 ]] && echo "Using a ${cvmfs_repo_mount} mount for /cvmfs/${cvmfs_repo_name}" |
| 787 | + |
781 | 788 | # obtain cvmfs_repo_name from EESSI_REPOS_CFG_FILE if cvmfs_repo is in cfg_cvmfs_repos |
782 | 789 | if [[ ${cfg_cvmfs_repos[${cvmfs_repo_name}]} ]]; then |
783 | 790 | [[ ${VERBOSE} -eq 1 ]] && echo "repo '${cvmfs_repo_name}' is not an EESSI CVMFS repository..." |
|
791 | 798 | # remove project subdir in container |
792 | 799 | cvmfs_repo_name=${cvmfs_repo_name%"/${EESSI_DEV_PROJECT}"} |
793 | 800 |
|
794 | | - # if a mount mode was not specified, we use a bind mount if the repository is available on the host, |
795 | | - # and otherwise we use a fuse mount |
796 | | - if [[ -z ${cvmfs_repo_mount} ]]; then |
797 | | - cvmfs_repo_mount="fuse" |
798 | | - if [[ -x $(command -v cvmfs_config) ]] && cvmfs_config probe ${cvmfs_repo_name} >& /dev/null; then |
799 | | - cvmfs_repo_mount="bind" |
800 | | - fi |
801 | | - fi |
802 | | - [[ ${VERBOSE} -eq 1 ]] && echo "Using a ${cvmfs_repo_mount} mount for /cvmfs/${cvmfs_repo_name}" |
803 | 801 | # if a bind mount was requested, check if the repository is really available on the host |
804 | 802 | if [[ ${cvmfs_repo_mount} == "bind" ]]; then |
805 | 803 | if [[ ! -x $(command -v cvmfs_config) ]] || ! cvmfs_config probe ${cvmfs_repo_name} >& /dev/null; then |
|
0 commit comments