mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-07 22:21:32 +00:00
Add helper to create a file list from bundles
In order to support verify_fix_path from bundle_add, a generic file list from bundle list needs to be implemented to replace the one embedded in the current consolidate_submanifests function. This function will be used to generate a file list to be passed to a new function for consolidating a list of files (created in the following patch). Note the list of files this creates is not sorted.
This commit is contained in:
committed by
Patrick McCarty
parent
06614d964e
commit
b849abb47d
@@ -257,6 +257,7 @@ void delete_motd(void);
|
||||
extern int get_dirfd_path(const char *fullname);
|
||||
extern int verify_fix_path(char *targetpath, struct manifest *manifest);
|
||||
extern void set_local_download(void);
|
||||
extern struct list *files_from_bundles(struct list *bundles);
|
||||
|
||||
/* subscription.c */
|
||||
struct list *free_list_file(struct list *item);
|
||||
|
||||
@@ -851,3 +851,24 @@ void set_local_download(void)
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
struct list *files_from_bundles(struct list *bundles)
|
||||
{
|
||||
struct list *files = NULL;
|
||||
struct list *list;
|
||||
struct manifest *bundle;
|
||||
|
||||
list = list_head(bundles);
|
||||
while (list) {
|
||||
struct list *bfiles;
|
||||
bundle = list->data;
|
||||
list = list->next;
|
||||
if (!bundle) {
|
||||
continue;
|
||||
}
|
||||
bfiles = list_clone(bundle->files);
|
||||
files = list_concat(bfiles, files);
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user