Skip to content

Commit

Permalink
Small fix to hardlinking to deal with Joliet.
Browse files Browse the repository at this point in the history
pylint pointed out that we weren't necessarily
handling all situations, which isn't quite true.
Nevertheless, it is easy enough for us to change
this and slightly improve performance along the way.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette committed Feb 6, 2025
1 parent 68cce51 commit 97a540b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pycdlib/pycdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3102,16 +3102,16 @@ def _add_hard_link_to_inode(self, data_ino, length, file_mode,
vd = self.pvd
rr = self.rock_ridge
xa = self.xa
elif joliet_new_path is not None:
else:
# Above we checked to make sure we got exactly one new path, so
# we know for certain that this is Joliet.
if self.joliet_vd is None:
raise pycdlibexception.PyCdlibInternalError('Tried to link to Joliet record on non-Joliet ISO')
# ... to a file on the Joliet filesystem.
(new_name, new_parent) = self._joliet_name_and_parent_from_path(joliet_new_path)
vd = self.joliet_vd
rr = ''
xa = False
# Above we checked to make sure we got at least one new path, so we
# don't need to worry about the else situation here.

new_rec = dr.DirectoryRecord()
new_rec.new_file(vd, length, new_name, new_parent,
Expand Down

0 comments on commit 97a540b

Please sign in to comment.