From 08db5d3f6ebf1e9812e7f113cd45afba049526b6 Mon Sep 17 00:00:00 2001 From: Richard Young Date: Tue, 16 Nov 2021 17:56:04 -0500 Subject: [PATCH] fixes --- libarchive/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libarchive/__init__.py b/libarchive/__init__.py index 8fbc000..91dd011 100644 --- a/libarchive/__init__.py +++ b/libarchive/__init__.py @@ -305,10 +305,10 @@ class Entry(object): self.hpos = hpos self.encoding = encoding - if self.issym(): + if self.issym() and symlink: self.symlink = symlink - else: - self.symlink = None + #else: + # self.symlink = None @property def header_position(self): @@ -340,8 +340,8 @@ class Entry(object): if entry.issym(): symLinkPath = _libarchive.archive_entry_symlink(e) - - print(symLinkPath) + entry.symlink = symLinkPath + print(symLinkPath) finally: _libarchive.archive_entry_free(e) @@ -385,6 +385,10 @@ class Entry(object): _libarchive.archive_entry_set_perm(e, stat.S_IMODE(self.mode)) _libarchive.archive_entry_set_size(e, self.size) _libarchive.archive_entry_set_mtime(e, self.mtime, 0) + + if e.issym(): + libarchive.archive_entry_set_symlink(e, self.symlink) + call_and_check(_libarchive.archive_write_header, archive._a, archive._a, e) #self.hpos = archive.header_position finally: