diff --git a/nodejs18.spec b/nodejs18.spec index f2c0bb4..af795dc 100644 --- a/nodejs18.spec +++ b/nodejs18.spec @@ -733,7 +733,7 @@ NODE_PATH=%{buildroot}%{_prefix}/lib/node_modules:%{buildroot}%{nodejs_private_s %if 0%{?rhel} && 0%{?rhel} < 8 -%pretrans npm -p +%pretrans %{pkgname}-npm -p -- Remove all of the symlinks from the bundled npm node_modules directory base_path = "%{_prefix}/lib/node_modules/npm/node_modules/" d_st = posix.stat(base_path) @@ -748,6 +748,22 @@ if d_st then end %endif +# This can be removed once F37 is EOL +%pretrans -n %{pkgname} -p +path = "/usr/lib/node_modules" +st = posix.stat(path) +if st and st.type == "directory" then + status = os.rename(path, path .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") + end +end + %files -n %{pkgname} %doc AUTHORS CHANGELOG.md onboarding.md GOVERNANCE.md README.md