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

fix: also strip hardlink target #171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

joshuarli
Copy link
Member

discovered in #170

fails on limactl linux x86-64 homebrew archive because lima/0.23.2 needs to be stripped away

tarinfo = <TarInfo 'share/lima/templates/almalinux.yaml' at 0x7fdba9372e00>

    def _find_link_target(self, tarinfo):
        """Find the target member of a symlink or hardlink member in the
           archive.
        """
        if tarinfo.issym():
            # Always search the entire archive.
            linkname = "/".join(filter(None, (os.path.dirname(tarinfo.name), tarinfo.linkname)))
            limit = None
        else:
            # Search the archive before the link, because a hard link is
            # just a reference to an already archived file.
            linkname = tarinfo.linkname
            limit = tarinfo
    
        member = self._getmember(linkname, tarinfo=limit, normalize=True)
        if member is None:
>           raise KeyError("linkname %r not found" % linkname)
E           KeyError: "linkname 'lima/0.23.2/share/lima/templates/almalinux-9.yaml' not found"

Copy link
Member

@asottile-sentry asottile-sentry left a comment

Choose a reason for hiding this comment

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

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.

2 participants