* Let files.xml hold uid, gid and mode info for every file of the package.
This commit is contained in:
+4
-1
@@ -17,6 +17,7 @@ import sys
|
|||||||
import glob
|
import glob
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from os.path import basename, dirname
|
from os.path import basename, dirname
|
||||||
|
from stat import S_IMODE
|
||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
__trans = gettext.translation('pisi', fallback=True)
|
__trans = gettext.translation('pisi', fallback=True)
|
||||||
@@ -612,8 +613,10 @@ class Builder:
|
|||||||
frpath = util.removepathprefix(install_dir, fpath) # relative path
|
frpath = util.removepathprefix(install_dir, fpath) # relative path
|
||||||
ftype, permanent = get_file_type(frpath, package.files, install_dir)
|
ftype, permanent = get_file_type(frpath, package.files, install_dir)
|
||||||
fsize = util.dir_size(fpath)
|
fsize = util.dir_size(fpath)
|
||||||
|
st = os.stat(fpath)
|
||||||
d[frpath] = FileInfo(path=frpath, type=ftype, permanent=permanent,
|
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:
|
for pinfo in package.files:
|
||||||
wildcard_path = util.join_path(install_dir, pinfo.path)
|
wildcard_path = util.join_path(install_dir, pinfo.path)
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ class FileInfo:
|
|||||||
t_Path = [ autoxml.String, autoxml.mandatory ]
|
t_Path = [ autoxml.String, autoxml.mandatory ]
|
||||||
t_Type = [ autoxml.String, autoxml.mandatory ]
|
t_Type = [ autoxml.String, autoxml.mandatory ]
|
||||||
t_Size = [ autoxml.Long, autoxml.optional ]
|
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_Hash = [ autoxml.String, autoxml.optional, "SHA1Sum" ]
|
||||||
t_Permanent = [ autoxml.String, autoxml.optional ]
|
t_Permanent = [ autoxml.String, autoxml.optional ]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user