From 29f2860fc3ae849747c37ffbabbf65426aa21155 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Thu, 19 Jul 2018 20:17:42 -0400 Subject: [PATCH] Fix NPM pretrans scriptlet Signed-off-by: Stephen Gallagher --- nodejs.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nodejs.spec b/nodejs.spec index 8ba1bbe..5905154 100644 --- a/nodejs.spec +++ b/nodejs.spec @@ -27,7 +27,7 @@ %global nodejs_patch 0 %global nodejs_abi %{nodejs_major}.%{nodejs_minor} %global nodejs_version %{nodejs_major}.%{nodejs_minor}.%{nodejs_patch} -%global nodejs_release 1 +%global nodejs_release 2 # == Bundled Dependency Versions == # v8 - from deps/v8/include/v8-version.h @@ -419,16 +419,18 @@ rm -f %{buildroot}/%{_defaultdocdir}/node/lldb_commands.py \ NODE_PATH=%{buildroot}%{_prefix}/lib/node_modules:%{buildroot}%{_prefix}/lib/node_modules/npm/node_modules %{buildroot}/%{_bindir}/node -e "require(\"assert\").equal(require(\"npm\").version, '%{npm_version}')" -%pretrans -p +%pretrans -n npm -p -- Remove all of the symlinks from the bundled npm node_modules directory -- This scriptlet can be removed in Fedora 31 for f in posix.files("%{_prefix}/lib/node_modules/npm/node_modules/") do - st = posix.stat(f) + path = "%{_prefix}/lib/node_modules/npm/node_modules/"..f + st = posix.stat(path) if st and st.type == "link" then os.remove(path) end end + %files %{_bindir}/node %dir %{_prefix}/lib/node_modules