Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow symlinks when uncompressing a file #6

Open
vishen opened this issue Jul 13, 2019 · 1 comment
Open

Follow symlinks when uncompressing a file #6

vishen opened this issue Jul 13, 2019 · 1 comment

Comments

@vishen
Copy link
Owner

vishen commented Jul 13, 2019

When uncompressing a file, pacm should follow symlinks (only if that are inside the package) and write out the file. This is needed for nodejs which has the following:

$ ls -hal node-v10.16.0-linux-x64/bin/                                                                                             
total 40M
drwxr-xr-x 2 jonathan.pentecost jonathan.pentecost 4.0K Jul 13 10:07 ./
drwxr-xr-x 6 jonathan.pentecost jonathan.pentecost 4.0K Jul 13 10:07 ../
-rwxrwxr-x 1 jonathan.pentecost jonathan.pentecost  40M Jul 13 10:07 node*
lrwxrwxrwx 1 jonathan.pentecost jonathan.pentecost   38 Jul 13 10:07 npm -> ../lib/node_modules/npm/bin/npm-cli.js*
lrwxrwxrwx 1 jonathan.pentecost jonathan.pentecost   38 Jul 13 10:07 npx -> ../lib/node_modules/npm/bin/npx-cli.js*

So currently, only node is written to disk, the others are ignored. But npm and npx should both be written to disk (rather than symlinked).

@vishen
Copy link
Owner Author

vishen commented Jul 14, 2019

This is actually more difficult than I first thought for node / npm. The node executable is a single binary so that is fine, but the npm and npx executables are javascript scripts, which rely on files from the included packages javascript files:

$ grep "require" ~/src/bin/npm 
  var unsupported = require('../lib/utils/unsupported.js')
  var log = require('npmlog')
  var npm = require('../lib/npm.js')
  var npmconf = require('../lib/config/core.js')
  var errorHandler = require('../lib/utils/error-handler.js')
  var nopt = require('nopt')
      const pkg = require('../package.json')
      let notifier = require('update-notifier')({pkg})
      const isCI = require('ci-info').isCI
        const color = require('ansicolors')

It might be time to look at extracting the code related to a package, have created a new issue for that #7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant