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

tools: Copying contents of deps/npm to test-npm #1853

Closed
wants to merge 2 commits into from

Conversation

thefourtheye
Copy link
Contributor

In Ubuntu, cp -r deps/npm/ test-npm/ was copying npm directory
under test-npm and the structure became test-npm/npm. But the test
requires the contents of deps/npm to be under test-npm. Using
deps/npm/. fixes it.

In Ubuntu, `cp -r deps/npm/ test-npm/` was copying `npm` directory 
under `test-npm` and the structure became `test-npm/npm`. But the test
 requires the contents of `deps/npm` to be under `test-npm`. Using 
`deps/npm/.` fixes it.
@Fishrock123
Copy link
Contributor

LGTM. @mhdawson does this also fix your Ubuntu issue with test-npm.sh?

@Fishrock123 Fishrock123 self-assigned this May 31, 2015
@targos
Copy link
Member

targos commented May 31, 2015

LGTM. The fix is also needed on Fedora.

@silverwind
Copy link
Contributor

Would * instead of . also work? That'd have been my approach. Also wonder why we didn't notice this earlier. Is it a difference between BSD and GNU cp?

@silverwind
Copy link
Contributor

@thefourtheye what Ubuntu version is this? I can't seem to reproduce by running cp -r dir1/ dir2/ on 14.04 with cp (GNU coreutils) 8.21.

@targos
Copy link
Member

targos commented May 31, 2015

@silverwind * also works on Fedora

@thefourtheye
Copy link
Contributor Author

@silverwind Mine are as following

➜  git  lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:        14.04
Codename:       trusty
➜  git  cp --version
cp (GNU coreutils) 8.21

I just tried again and I am able to reproduce the problem.

@silverwind
Copy link
Contributor

@thefourtheye reproduced now too. It does only manifest when the target directory exists. Confirmed now on Ubuntu and Arch.

@thefourtheye
Copy link
Contributor Author

I am really wondering why this . thingy has not been documented anywhere. I tried man and info.

@silverwind
Copy link
Contributor

It's not shell expansion at least.

Also confirming this works on BSD cp, so LGTM.

@mscdex mscdex added the test Issues and PRs related to the tests. label May 31, 2015
@jbergstroem
Copy link
Member

Can't we just omit a slash?

$ cp -r deps/npm test-npm/

Edit, output from Linux iojs-build-ubuntu1404-64-1 3.13.0-37-generic:

$ mkdir -p deps/npm/foo test-npm
$ cp -r deps/npm test-npm/
$ ls -R test-npm
test-npm:
npm

test-npm/npm:
foo

test-npm/npm/foo:

@silverwind
Copy link
Contributor

@jbergstroem that won't work, I think we want test-npm to be the npm package root, without an npm subfolder.

@jbergstroem
Copy link
Member

@silverwind hm, I thought that was what we wanted since we created test-npm just above. If not, we should remove mkdir and just avoid the trailing slash:

$ cp -r deps/npm test-npm

Edit: You're right. Looks like the script assumes we're in that folder. Then I'd suggest above -- remove the mkdir and just use cp to create it.

@silverwind
Copy link
Contributor

Yeah, that mkdir is unnecessary. @thefourtheye care to change the PR to @jbergstroem's suggestion?

Instead of creating `test-npm` first and then copying the contents of 
`deps/npm`, we just create `test-npm` from `deps/npm` with the `cp -r`
@thefourtheye
Copy link
Contributor Author

@silverwind @jbergstroem Updated the PR. Can you guys review this now?

@silverwind
Copy link
Contributor

LGTM

1 similar comment
@jbergstroem
Copy link
Member

LGTM

silverwind pushed a commit that referenced this pull request Jun 1, 2015
This fixes a platform inconsistency between BSD and GNU `cp` where
`deps/npm` would be copied into a subdirectory of `test-npm` on Linux,
but not on OS X.

PR-URL: #1853
Reviewed-By: Roman Reiss <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
@silverwind
Copy link
Contributor

Thanks, landed in 1baba05

@silverwind silverwind closed this Jun 1, 2015
@thefourtheye thefourtheye deleted the patch-1 branch June 1, 2015 10:45
@bnoordhuis
Copy link
Member

@thefourtheye Would it be possible for you to sign your commits with your real name? You show up as 'thefourtheye' in Author fields now but I see you have a couple of Reviewed-By tags under your full name.

@thefourtheye
Copy link
Contributor Author

@bnoordhuis Oh sorry. I changed it in my local git config but the last commits were made directly from github. Do you want me to change them? If so, please let me know how I can do that.

@bnoordhuis
Copy link
Member

They're in the history now so that's that. I speculate that the GH editor uses the name and email that are visible in your profile but I don't know for sure, I never use it.

Can I suggest you just make your changes from the command line? Almost every change requires that you run make test (and, implicitly, make lint) anyway.

@thefourtheye
Copy link
Contributor Author

@bnoordhuis Sure, next time onwards I ll do it from a local branch and sorry about this time. But before submitting the PR, I locally tested the changes and since the change was very small I directly edited it.

@bnoordhuis
Copy link
Member

No problem, it's not a big thing, just a small incongruity I noticed.

andrewdeandrade pushed a commit to andrewdeandrade/node that referenced this pull request Jun 3, 2015
This fixes a platform inconsistency between BSD and GNU `cp` where
`deps/npm` would be copied into a subdirectory of `test-npm` on Linux,
but not on OS X.

PR-URL: nodejs/node#1853
Reviewed-By: Roman Reiss <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
@rvagg rvagg mentioned this pull request Jun 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants