'Make a (symbolic) link called targetpath. If it cannot be created
(platform limitation), we try to make a copy of the referenced file
instead of a link.'

def makelink(self, tarinfo, targetpath):

    if (hasattr(os, 'symlink') and hasattr(os, 'link')):
        if tarinfo.issym():
            if os.path.lexists(targetpath):
                os.unlink(targetpath)
            os.symlink(tarinfo.linkname, targetpath)
        elif os.path.exists(tarinfo._link_target):
            if os.path.lexists(targetpath):
                os.unlink(targetpath)
            os.link(tarinfo._link_target, targetpath)
        else:
            self._extract_member(self._find_link_target(tarinfo), targetpath)
    else:
        try:
            self._extract_member(self._find_link_target(tarinfo), targetpath)
        except KeyError:
            raise ExtractError('unable    to    resolve    link    inside    archive')
