Print an error in the case of a broken control.tar.gz file within the archive.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 12 Jan 2010 04:14:14 +0000 (04:14 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 12 Jan 2010 04:14:14 +0000 (04:14 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@516 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

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);