@@ -99,6 +99,11 @@ static int extract_scripts(int fd, struct imglist *head, int fromfile)
const char* tmpdir_scripts = get_tmpdirscripts();
LIST_FOREACH(script, head, next) {
+ if (!script->fname[0] && (script->provided == 0)) {
+ TRACE("No script provided for script of type %s",
+ script->type);
+ continue;
+ }
if (script->provided == 0) {
ERROR("Required script %s not found in image",
script->fname);
@@ -365,12 +365,10 @@ static int parse_scripts(parsertype p, void *cfg, struct swupdate_cfg *swcfg, lu
continue;
/*
- * Check for mandatory field
+ * Check for filename field
*/
- if(!(exist_field_string(p, elem, "filename"))) {
- TRACE("Script entry without filename field, skipping..");
- continue;
- }
+ if(!(exist_field_string(p, elem, "filename")))
+ TRACE("Script entry without filename field.");
script = (struct img_type *)calloc(1, sizeof(struct img_type));
if (!script) {
A file was required for scripts. We may also have a script with a handler that only used data provided in the properties. So we update the test that block script without file (and filename). Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> --- corelib/installer.c | 5 +++++ parser/parser.c | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-)