Really handle hardlinks in the rpmunpack python example, doh

This commit is contained in:
Panu Matilainen 2023-06-27 15:19:49 +03:00
parent 9e3bb9fd43
commit 6f5d9b4677
1 changed files with 3 additions and 2 deletions

View File

@ -24,8 +24,9 @@ def unpack(h, fd):
# handle hardlinks
if f.nlink > 1:
for l in f.links:
if l.inode != f.inode:
os.link(fn, l.name)
if l.name != f.name:
ln = './%s' % l.name
os.link(fn, ln)
elif stat.S_ISDIR(f.mode):
os.mkdir(fn)
elif stat.S_ISLNK(f.mode):