When a previously un-bundled dependency becomes bundled, it is sometimes desirable to keep the actual path in node_modules as a symlink in order to keep RPM happy. In that case, the dependencies might be stored in i.e. node_modules.bundled directory, and the node_modules directory would contain symlinks to them.
This change tweaks the detection of un-bundled dependencies, so that in the above case the symlinks are still treated as bundled.
Real-life example of this situation, taken from the specfile for rh-nodejs8-nodejs from CentOS:
# Since the old version of NPM was unbundled, there are a lot of symlinks in# it's node_modules directory. We need to keep these as symlinks to ensure we# can backtrack on this if we decide to.# Rename the npm node_modules directory to node_modules.bundled
mv%{buildroot}/%{_prefix}/lib/node_modules/npm/node_modules\%{buildroot}/%{_prefix}/lib/node_modules/npm/node_modules.bundled
# Recreate all the symlinks
mkdir-p%{buildroot}/%{_prefix}/lib/node_modules/npm/node_modules
FILES=%{buildroot}/%{_prefix}/lib/node_modules/npm/node_modules.bundled/*
forfin$FILESdomodule=`basename$f`ln-s../node_modules.bundled/$module%{buildroot}%{_prefix}/lib/node_modules/npm/node_modules/$moduledone
When a previously un-bundled dependency becomes bundled, it is sometimes desirable to keep the actual path in
node_modulesas a symlink in order to keep RPM happy. In that case, the dependencies might be stored in i.e.node_modules.bundleddirectory, and thenode_modulesdirectory would contain symlinks to them.This change tweaks the detection of un-bundled dependencies, so that in the above case the symlinks are still treated as bundled.
Real-life example of this situation, taken from the specfile for rh-nodejs8-nodejs from CentOS: