From ae3e1918a3c5f442cc8273af67f330ba6f5a60d3 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 27 Nov 2006 14:42:45 +0000 Subject: [PATCH] * Let files.xml hold uid, gid and mode info for every file of the package. --- pisi/build.py | 5 ++++- pisi/files.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pisi/build.py b/pisi/build.py index 00a09a5d..4f778ead 100644 --- a/pisi/build.py +++ b/pisi/build.py @@ -17,6 +17,7 @@ import sys import glob from copy import deepcopy from os.path import basename, dirname +from stat import S_IMODE import gettext __trans = gettext.translation('pisi', fallback=True) @@ -612,8 +613,10 @@ class Builder: frpath = util.removepathprefix(install_dir, fpath) # relative path ftype, permanent = get_file_type(frpath, package.files, install_dir) fsize = util.dir_size(fpath) + st = os.stat(fpath) d[frpath] = FileInfo(path=frpath, type=ftype, permanent=permanent, - size=fsize, hash=fhash) + size=fsize, hash=fhash, uid=str(st.st_uid), gid=str(st.st_gid), + mode=oct(S_IMODE(st.st_mode))) for pinfo in package.files: wildcard_path = util.join_path(install_dir, pinfo.path) diff --git a/pisi/files.py b/pisi/files.py index cd50e692..0dab0d0b 100644 --- a/pisi/files.py +++ b/pisi/files.py @@ -26,6 +26,9 @@ class FileInfo: t_Path = [ autoxml.String, autoxml.mandatory ] t_Type = [ autoxml.String, autoxml.mandatory ] t_Size = [ autoxml.Long, autoxml.optional ] + t_Uid = [ autoxml.String, autoxml.optional ] + t_Gid = [ autoxml.String, autoxml.optional ] + t_Mode = [ autoxml.String, autoxml.optional ] t_Hash = [ autoxml.String, autoxml.optional, "SHA1Sum" ] t_Permanent = [ autoxml.String, autoxml.optional ]