Skip to content

Commit

Permalink
Merge pull request #371 from bundlewrap/symlinks-fixing-fix
Browse files Browse the repository at this point in the history
Fixes for fixing symlinks
  • Loading branch information
trehn committed Sep 26, 2017
2 parents e9f5fa2 + 78d9b3d commit c4a973e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bundlewrap/items/symlinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def fix(self, status):
self._fix_type(status)
return

for fix_type in ('owner', 'group', 'target'):
for fix_type in ('target', 'owner', 'group'):
if fix_type in status.keys_to_fix:
if fix_type == 'group' and 'owner' in status.keys_to_fix:
# owner and group are fixed with a single chown
Expand Down
14 changes: 4 additions & 10 deletions bundlewrap/utils/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,7 @@ def size(self):
def symlink_target(self):
if not self.is_symlink:
raise ValueError("{} is not a symlink".format(quote(self.path)))
if self.desc.startswith("symbolic link to `"):
return self.desc[18:-1]
elif self.desc.startswith("broken symbolic link to `"):
return self.desc[25:-1]
elif self.desc.startswith("symbolic link to "):
return self.desc[17:]
elif self.desc.startswith("broken symbolic link to "):
return self.desc[24:]
else:
raise ValueError("unable to find target for {}".format(quote(self.path)))

return force_text(self.node.run(
"readlink -- {}".format(quote(self.path)), may_fail=True,
).stdout.strip())

0 comments on commit c4a973e

Please sign in to comment.