This is an automated email from the ASF dual-hosted git repository.

abhi pushed a commit to branch ranger_3801_revise
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 9d734f170541790e59393baa03db05b623e0a7a6
Author: Abhishek Kumar <[email protected]>
AuthorDate: Sat Oct 5 16:03:11 2024 -0700

    Download all archives when no arg is passed
---
 dev-support/ranger-docker/download-archives.sh | 49 +++++++++++++++++---------
 1 file changed, 32 insertions(+), 17 deletions(-)

diff --git a/dev-support/ranger-docker/download-archives.sh 
b/dev-support/ranger-docker/download-archives.sh
index 53cce79fc..b073f6f47 100755
--- a/dev-support/ranger-docker/download-archives.sh
+++ b/dev-support/ranger-docker/download-archives.sh
@@ -45,31 +45,46 @@ downloadIfNotPresent postgresql-42.2.16.jre7.jar            
"https://search.mave
 downloadIfNotPresent mysql-connector-java-8.0.28.jar        
"https://search.maven.org/remotecontent?filepath=mysql/mysql-connector-java/8.0.28";
 downloadIfNotPresent log4jdbc-1.2.jar                       
https://repo1.maven.org/maven2/com/googlecode/log4jdbc/log4jdbc/1.2
 
-for arg in "$@"; do
-  if [[ $arg == 'hadoop' ]]
-  then
+if [[ $# -eq 0 ]]
+then
     downloadIfNotPresent hadoop-${HADOOP_VERSION}.tar.gz        
https://archive.apache.org/dist/hadoop/common/hadoop-${HADOOP_VERSION}
-  elif [[ $arg == 'hbase' ]]
-  then
     downloadIfNotPresent hbase-${HBASE_VERSION}-bin.tar.gz      
https://archive.apache.org/dist/hbase/${HBASE_VERSION}
-  elif [[ $arg == 'hive' ]]
-  then
     downloadIfNotPresent apache-hive-${HIVE_VERSION}-bin.tar.gz 
https://archive.apache.org/dist/hive/hive-${HIVE_VERSION}
     downloadIfNotPresent hadoop-${HIVE_HADOOP_VERSION}.tar.gz   
https://archive.apache.org/dist/hadoop/common/hadoop-${HIVE_HADOOP_VERSION}
-  elif [[ $arg == 'kafka' ]]
-  then
     downloadIfNotPresent kafka_2.12-${KAFKA_VERSION}.tgz        
https://archive.apache.org/dist/kafka/${KAFKA_VERSION}
-  elif [[ $arg == 'knox' ]]
-  then
     downloadIfNotPresent knox-${KNOX_VERSION}.tar.gz            
https://archive.apache.org/dist/knox/${KNOX_VERSION}
-  elif [[ $arg == 'ozone' ]]
-  then
     downloadIfNotPresent ozone-${OZONE_VERSION}.tar.gz          
https://archive.apache.org/dist/ozone/${OZONE_VERSION}
     if [ ! -d downloads/ozone-${OZONE_VERSION} ]
     then
       tar xvfz downloads/ozone-${OZONE_VERSION}.tar.gz --directory=downloads/
     fi
-  else
-    echo "Passed argument $arg is invalid!"
-  fi
-done
+else
+  for arg in "$@"; do
+    if [[ $arg == 'hadoop' ]]
+    then
+      downloadIfNotPresent hadoop-${HADOOP_VERSION}.tar.gz        
https://archive.apache.org/dist/hadoop/common/hadoop-${HADOOP_VERSION}
+    elif [[ $arg == 'hbase' ]]
+    then
+      downloadIfNotPresent hbase-${HBASE_VERSION}-bin.tar.gz      
https://archive.apache.org/dist/hbase/${HBASE_VERSION}
+    elif [[ $arg == 'hive' ]]
+    then
+      downloadIfNotPresent apache-hive-${HIVE_VERSION}-bin.tar.gz 
https://archive.apache.org/dist/hive/hive-${HIVE_VERSION}
+      downloadIfNotPresent hadoop-${HIVE_HADOOP_VERSION}.tar.gz   
https://archive.apache.org/dist/hadoop/common/hadoop-${HIVE_HADOOP_VERSION}
+    elif [[ $arg == 'kafka' ]]
+    then
+      downloadIfNotPresent kafka_2.12-${KAFKA_VERSION}.tgz        
https://archive.apache.org/dist/kafka/${KAFKA_VERSION}
+    elif [[ $arg == 'knox' ]]
+    then
+      downloadIfNotPresent knox-${KNOX_VERSION}.tar.gz            
https://archive.apache.org/dist/knox/${KNOX_VERSION}
+    elif [[ $arg == 'ozone' ]]
+    then
+      downloadIfNotPresent ozone-${OZONE_VERSION}.tar.gz          
https://archive.apache.org/dist/ozone/${OZONE_VERSION}
+      if [ ! -d downloads/ozone-${OZONE_VERSION} ]
+      then
+        tar xvfz downloads/ozone-${OZONE_VERSION}.tar.gz --directory=downloads/
+      fi
+    else
+      echo "Passed argument $arg is invalid!"
+    fi
+  done
+fi

Reply via email to