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

Skip symlinked files when fixing permissions #1439

Merged
merged 5 commits into from Oct 28, 2015

Conversation

geimer
Copy link
Contributor

@geimer geimer commented Oct 27, 2015

Either the symlinks will point to other files in the installation prefix, so permissions for those files are being handled twice in that case, or the symlinks point to somewhere else (like for PDT), in which case we shouldn't touch the files they point to at all (not only to avoid errors, it's just plain wrong to do so)...

The old behavior is still available via skip_symlinks=False.

@hpcugentbot
Copy link
Contributor

Automatic reply from Jenkins: Can I test this?

@@ -700,8 +700,15 @@ def adjust_permissions(name, permissionBits, add=True, onlyfiles=False, onlydirs
for root, dirs, files in os.walk(name):
paths = []
if not onlydirs:
paths += files
if not skip_symlinks:
paths += files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's switch to paths.extend(files) here (matches better with the .append used below)

add test for adjust_permissions
@@ -700,9 +700,17 @@ def adjust_permissions(name, permissionBits, add=True, onlyfiles=False, onlydirs
for root, dirs, files in os.walk(name):
paths = []
if not onlydirs:
paths += files
if not skip_symlinks:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, maybe it's better to avoid 'double negation' (sort of):

if skip_symlinks:
   ...
else:
   # ...
   paths.extend(dirs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes some sense. But after switching this, we have yet another negation inside the for loop -- which has now moved up. Though I would suggest to keep it that way to have the part where something has to be done first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it, it may actually make sense to switch that too (If we are skipping symlinks and if it is a link, issue a debug message; otherwise do it)

@boegel boegel added this to the v2.4.0 milestone Oct 27, 2015
@boegel
Copy link
Member

boegel commented Oct 27, 2015

Jenkins: ok to test

@hpcugentbot
Copy link
Contributor

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2239/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link
Contributor

EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/2240/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@boegel
Copy link
Member

boegel commented Oct 28, 2015

Going in, thanks @geimer!

boegel added a commit that referenced this pull request Oct 28, 2015
Skip symlinked files when fixing permissions
@boegel boegel merged commit c00747e into easybuilders:develop Oct 28, 2015
@geimer geimer deleted the symlink_permissions branch October 29, 2015 07:54
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

Successfully merging this pull request may close these issues.

None yet

3 participants