From 83b7eb4ea021a1e47adb16b2f8dcc9adbd10c832 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 29 Oct 2019 10:24:09 -0400 Subject: [PATCH] Fix issue with NPM docs being replaced with a symlink Signed-off-by: Stephen Gallagher --- nodejs.spec | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/nodejs.spec b/nodejs.spec index 49115e3..f9ee475 100644 --- a/nodejs.spec +++ b/nodejs.spec @@ -8,7 +8,7 @@ # This is used by both the nodejs package and the npm subpackage thar # has a separate version - the name is special so that rpmdev-bumpspec # will bump this rather than adding .1 to the end. -%global baserelease 3 +%global baserelease 5 %{?!_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -553,6 +553,38 @@ if st and st.type == "directory" then end end +-- Replace the npm HTML docs directory with a symlink +-- Drop this scriptlet when F31 is EOL +path = "%{_prefix}/lib/node_modules/npm/html" +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 + +-- Replace the npm HTML man directory with a symlink +-- Drop this scriptlet when F31 is EOL +path = "%{_prefix}/lib/node_modules/npm/man" +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 + %pretrans -n v8-devel -p -- Replace the v8 libplatform include directory with a symlink @@ -646,7 +678,7 @@ end %{_pkgdocdir}/npm/doc %changelog -* Tue Oct 29 2019 Stephen Gallagher - 1:12.13.0-3 +* Tue Oct 29 2019 Stephen Gallagher - 1:12.13.0-5 - Fix issue with NPM docs being replaced with a symlink * Mon Oct 28 2019 Stephen Gallagher - 1:12.13.0-2