bin/xbps-create: record file size in files.plist
This commit is contained in:
parent
c533f1bd52
commit
91e428d54d
@ -59,6 +59,7 @@
|
|||||||
struct xentry {
|
struct xentry {
|
||||||
TAILQ_ENTRY(xentry) entries;
|
TAILQ_ENTRY(xentry) entries;
|
||||||
uint64_t mtime;
|
uint64_t mtime;
|
||||||
|
uint64_t size;
|
||||||
char *file, *type, *target, *hash;
|
char *file, *type, *target, *hash;
|
||||||
ino_t inode;
|
ino_t inode;
|
||||||
};
|
};
|
||||||
@ -473,6 +474,7 @@ ftw_cb(const char *fpath, const struct stat *sb, const struct dirent *dir UNUSED
|
|||||||
/* store modification time for regular files and links */
|
/* store modification time for regular files and links */
|
||||||
xbps_dictionary_set_uint64(fileinfo, "mtime", sb->st_mtime);
|
xbps_dictionary_set_uint64(fileinfo, "mtime", sb->st_mtime);
|
||||||
xe->mtime = (uint64_t)sb->st_mtime;
|
xe->mtime = (uint64_t)sb->st_mtime;
|
||||||
|
xe->size = (uint64_t)sb->st_size;
|
||||||
|
|
||||||
} else if (S_ISDIR(sb->st_mode)) {
|
} else if (S_ISDIR(sb->st_mode)) {
|
||||||
/* directory */
|
/* directory */
|
||||||
@ -591,6 +593,8 @@ process_xentry(const char *key, const char *mutable_files)
|
|||||||
xbps_dictionary_set_cstring(d, "sha256", xe->hash);
|
xbps_dictionary_set_cstring(d, "sha256", xe->hash);
|
||||||
if (xe->mtime)
|
if (xe->mtime)
|
||||||
xbps_dictionary_set_uint64(d, "mtime", xe->mtime);
|
xbps_dictionary_set_uint64(d, "mtime", xe->mtime);
|
||||||
|
if (xe->size)
|
||||||
|
xbps_dictionary_set_uint64(d, "size", xe->size);
|
||||||
|
|
||||||
xbps_array_add(a, d);
|
xbps_array_add(a, d);
|
||||||
xbps_object_release(d);
|
xbps_object_release(d);
|
||||||
|
Loading…
Reference in New Issue
Block a user