entropy.client.interfaces.methods.quickpkg_handler: apply the same

fix of entropy.spm.quickpkg, properly store username and group bits
inside the tar file when possible.
This commit is contained in:
Fabio Erculiani
2009-04-02 19:05:54 +02:00
parent 98e046e725
commit 2c0fa8fe68

View File

@@ -1356,8 +1356,18 @@ class Misc:
path = os.path.realpath(path)
tarinfo = tar.gettarinfo(path, arcname)
tarinfo.uname = id_strings.setdefault(tarinfo.uid, str(tarinfo.uid))
tarinfo.gname = id_strings.setdefault(tarinfo.gid, str(tarinfo.gid))
uid = tarinfo.uid
gid = tarinfo.gid
user = self.entropyTools.get_user_from_uid(uid)
group = self.entropyTools.get_group_from_gid(gid)
if user == None:
user = str(uid)
if group == None:
group = str(gid)
tarinfo.uname = id_strings.setdefault(tarinfo.uid, user)
tarinfo.gname = id_strings.setdefault(tarinfo.gid, group)
if stat.S_ISREG(exist.st_mode):
tarinfo.type = tarfile.REGTYPE