Print an error in the case of a broken control.tar.gz file within the archive.
[oweals/opkg-lede.git] / libopkg / pkg.c
index c5a33361bfc841d12bd10a5756db54037169a59c..467dcef908f53a030f8c46075ce2e64cac3f3442 100644 (file)
@@ -309,8 +309,13 @@ pkg_init_from_file(pkg_t *pkg, const char *filename)
 
        rewind(control_file);
 
-       if (pkg_parse_from_stream(pkg, control_file, 0))
+       if ((err = pkg_parse_from_stream(pkg, control_file, 0))) {
+               if (err == 1) {
+                       opkg_msg(ERROR, "Malformed package file %s.\n",
+                               filename);
+               }
                err = -1;
+       }
 
 err2:
        fclose(control_file);