adoroszlai commented on code in PR #10513:
URL: https://github.com/apache/ozone/pull/10513#discussion_r3600746620


##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -1348,6 +1349,25 @@ function ozone_os_tricks
           export JAVA_HOME
         fi
       fi
+
+      if [ "$ARCH_TYPE" = "arm64" ]; then
+        TARGET_FILE="libhadoop_osx_aarch_64.dylib"
+      fi
+
+     pushd . > /dev/null && cd lib/native
+      # If no matching file variant was found for the current environment
+      if [ -z "$TARGET_FILE" ]; then
+        echo "Error: libhadoop doesn't support platform combination ($OS_TYPE 
/ $ARCH_TYPE)." >&2

Review Comment:
   `OS_TYPE` is deprecated, should use `OZONE_OS_TYPE`.



##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -1348,6 +1349,25 @@ function ozone_os_tricks
           export JAVA_HOME
         fi
       fi
+
+      if [ "$ARCH_TYPE" = "arm64" ]; then
+        TARGET_FILE="libhadoop_osx_aarch_64.dylib"
+      fi
+
+     pushd . > /dev/null && cd lib/native
+      # If no matching file variant was found for the current environment
+      if [ -z "$TARGET_FILE" ]; then
+        echo "Error: libhadoop doesn't support platform combination ($OS_TYPE 
/ $ARCH_TYPE)." >&2
+      else
+        LINK_FILE="libhadoop.dylib"

Review Comment:
   By moving `LINK_FILE` definition out of `if-else`, the code block can be 
extracted to a function, to be reused for both `Darwin` and `Linux` cases.



##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -1348,6 +1349,25 @@ function ozone_os_tricks
           export JAVA_HOME
         fi
       fi
+
+      if [ "$ARCH_TYPE" = "arm64" ]; then
+        TARGET_FILE="libhadoop_osx_aarch_64.dylib"
+      fi
+
+     pushd . > /dev/null && cd lib/native
+      # If no matching file variant was found for the current environment

Review Comment:
   nit:
   - indent is off
   - `pushd && cd` is unnecessarily complex
   
   ```suggestion
         fi
   
         pushd lib/native > /dev/null
         # If no matching file variant was found for the current environment
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to