diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-10-28 22:35:01 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-10-28 22:35:01 -0700 |
commit | 290990af18d2c56c26bb4b33f24e641948879522 (patch) | |
tree | 265d3d8972b9690ef6344ac41b9b33999519acc4 | |
parent | f06f1d8e2174527cc7f4b5491f0f84d41f368d62 (diff) | |
download | portage-290990af18d2c56c26bb4b33f24e641948879522.tar.gz portage-290990af18d2c56c26bb4b33f24e641948879522.tar.bz2 portage-290990af18d2c56c26bb4b33f24e641948879522.zip |
quickpkg: fix regression in hardlink support
Hardlink support has been broken since commit
4198da0184aaec30c41f2e5d2c7af71c4d35b662, which omitted the hardlink
logic from TarFile.gettarinfo().
-rw-r--r-- | pym/portage/dbapi/vartree.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index ee0db6f24..73772b0e0 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -4560,11 +4560,20 @@ def tar_contents(contents, root, tar, protect=None, onProgress=None): tarinfo.mode = lst.st_mode tarinfo.uid = lst.st_uid tarinfo.gid = lst.st_gid - tarinfo.size = lst.st_size + tarinfo.size = 0 tarinfo.mtime = lst.st_mtime tarinfo.linkname = "" if stat.S_ISREG(lst.st_mode): - tarinfo.type = tarfile.REGTYPE + inode = (lst.st_ino, lst.st_dev) + if (lst.st_nlink > 1 and + inode in tar.inodes and + arcname != tar.inodes[inode]): + tarinfo.type = tarfile.LNKTYPE + tarinfo.linkname = tar.inodes[inode] + else: + tar.inodes[inode] = arcname + tarinfo.type = tarfile.REGTYPE + tarinfo.size = lst.st_size elif stat.S_ISDIR(lst.st_mode): tarinfo.type = tarfile.DIRTYPE elif stat.S_ISLNK(lst.st_mode): |