Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/145#discussion_r42924206
  
    --- Diff: install/traf_tools_setup.sh ---
    @@ -62,9 +62,43 @@ function Usage {
        echo
     }
     
    -  VERBOSE=0
    -  TOOLSDIR=
    -  BASEDIR=
    +# 
-----------------------------------------------------------------------------
    +# function: downloadSource - downloads and un-tars the requested file
    +#    $1 - tar file to download 
    +#    $2 - directory where source is untarred
    +# 
-----------------------------------------------------------------------------
    +function downloadSource
    +{
    +  # currently only tar files ending in "tar.gz" and "tgz" are recognized
    +  TARSUFFIX="tar.gz"
    +  if [[ ! $1 == *$"$TARSUFFIX" ]]; then
    +    TARSUFFIX="tgz"
    +  fi
    +
    +  if [ ! -e $BASEDIR/$2.$TARSUFFIX ]; then
    +    wget $1  >>$LOGFILE 2>&1
    --- End diff --
    
    The function takes two arguments, the URL and the name of the extracted 
directory. It would misbehave, however, if the name of the extracted directory 
would not match what's in the file. Wouldn't it be easier to just use a single 
argument $1 and to figure out the name of the file to extract with `basename 
$1`. I think that would be consistent with the way wget behaves. If the 
function takes a second argument, then maybe that second argument should be the 
name of the tar file to extract, including the suffix?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to