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:
William Douglas
2016-05-10 10:31:00 -07:00
committed by Patrick McCarty
parent 06614d964e
commit b849abb47d
2 changed files with 22 additions and 0 deletions
+1
View File
@@ -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);
+21
View File
@@ -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;
}