Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/1082#discussion_r164325226 --- Diff: distribution/src/resources/drill-config.sh --- @@ -180,18 +251,61 @@ else fi fi -# Default memory settings if none provided by the environment or +# Execute distrib-setup.sh for any distribution-specific setup (e.g. checks). +# distrib-setup.sh is optional; it is created by some distribution installers +# that need additional distribution-specific setup to be done. +# Because installers will have site-specific steps, the file +# should be moved into the site directory, if the user employs one. + +# Checking if being executed in context of Drillbit and not SQLLine +if [ "$DRILLBIT_CONTEXT" == "1" ]; then + # Check whether to run exclusively distrib-setup.sh OR auto-setup.sh + distribSetup="$DRILL_CONF_DIR/distrib-setup.sh" ; #Site-based distrib-setup.sh + if [ $(checkExecutableLineCount $distribSetup) -eq 0 ]; then --- End diff -- Honestly, this seems overly complex. First, if we simply omit `distrib-setup.sh` then we only need to check for existence, as we did for `distrib-env.sh` in the original file. There is no need at all to check the executable line count: this is just asking for problems. Just source the file if it exists. If the file contains only comments (as in the out-of-the-box `drill-env.sh`), then the shell is perfectly capable of doing nothing. There is no time savings either because the file will be read by the executable line check or the shell. In short, let's apply the KISS principle here.
---