Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-7159

impala-config.sh fails when running with set -euo pipefail if IMPALA_HOME is not set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Impala 2.13.0, Impala 3.1.0
    • None
    • Infrastructure
    • None
    • ghx-label-9

    Description

      bin/impala-config.sh contain these two comments:

       

      # Source this file from the $IMPALA_HOME directory to
      # setup your environment. If $IMPALA_HOME is undefined
      # this script will set it to the current working directory.
      ...
      # This file must be kept compatible with bash options "set -euo pipefail".

      However, starting with a clean shell, the following fails:

      cd ~/Impala
      set -euo pipefail
      source bin/impala-config.sh

      bin/impala-config.sh uses $IMPALA_HOME when IMPALA_HOME is unbound:

      if ! [[ "'$IMPALA_HOME'" =~ [[:blank:]] ]]; then
        if [ -z "$IMPALA_HOME" ]; then
          if [[ ! -z "$ZSH_NAME" ]]; then
            export IMPALA_HOME=$(dirname "$(cd $(dirname ${(%):-%x}) >/dev/null && pwd)")
          else
            export IMPALA_HOME=$(dirname "$(cd $(dirname "${BASH_SOURCE[0]}") >/dev/null && pwd)")
          fi
        fi
      fi

      It looks like this has been this way for a long time.

       

      Attachments

        Activity

          People

            joemcdonnell Joe McDonnell
            joemcdonnell Joe McDonnell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: