From 6ee94a394f0f2651e2c97f8b0fd51ad4ae9ce4c7 Mon Sep 17 00:00:00 2001
From: Cloorc <13597105+cloorc@users.noreply.github.com>
Date: Tue, 22 Oct 2024 03:50:43 +0800
Subject: [PATCH] build: fix uninstall script for AIX 7.1

Signed-off-by: Cloorc <13597105+cloorc@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/55438
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Abdirahim Musse <abdirahim.musse@ibm.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
---
 tools/install.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/install.py b/tools/install.py
index bf54249b66c0d4..17515720ba9c85 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -4,10 +4,15 @@
 import ast
 import errno
 import os
+import platform
 import shutil
 import sys
 import re
 
+current_system = platform.system()
+
+SYSTEM_AIX = "AIX"
+
 def abspath(*args):
   path = os.path.join(*args)
   return os.path.abspath(path)
@@ -44,6 +49,7 @@ def try_rmdir_r(options, path):
     except OSError as e:
       if e.errno == errno.ENOTEMPTY: return
       if e.errno == errno.ENOENT: return
+      if e.errno == errno.EEXIST and current_system == SYSTEM_AIX: return
       raise
     path = abspath(path, '..')