+static int for_all_content(const struct wgt_desc *desc, int (*action)(const char *src, const char *type))
+{
+ int rc, rc2;
+ struct wgt_desc_feature *feat;
+ const char *src, *type;
+
+ rc = action(desc->content_src, desc->content_type);
+ feat = desc->features;
+ while (feat) {
+ if (!strcmp(feat->name, "urn:AGL:widget:provided-unit")) {
+ src = wgt_info_param(feat, "content.src");
+ type = wgt_info_param(feat, "content.type");
+ rc2 = action(src, type);
+ if (rc >= 0 && rc2 < 0)
+ rc = rc2;
+ }
+ feat = feat->next;
+ }
+ return rc;
+}
+
+static int set_exec_flag(const char *src, const char *type)
+{
+ int i, rc;
+
+ if (src && type) {
+ i = sizeof exec_type_strings / sizeof *exec_type_strings;
+ while (i) {
+ if (!strcasecmp(type, exec_type_strings[--i])) {
+ rc = fchmodat(workdirfd, src, 0755, 0);
+ if (rc < 0)
+ ERROR("can't make executable the file %s", src);
+ return rc;
+ }
+ }
+ }
+ return 0;
+}
+
+static int check_one_content(const char *src, const char *type)