X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopkg-lede.git;a=blobdiff_plain;f=libopkg%2Fpkg.c;h=58c133d0a00d8fd8e989cce82bf4f16abb70e33f;hp=278b7271d8893717cad42f48d8301296af9c9c47;hb=6afed21188df0c417349563621302ec85f44096f;hpb=a5ef09fae04cd4274542b9f5f052e439e56450fc diff --git a/libopkg/pkg.c b/libopkg/pkg.c index 278b727..58c133d 100644 --- a/libopkg/pkg.c +++ b/libopkg/pkg.c @@ -309,8 +309,11 @@ pkg_init_from_file(opkg_conf_t *conf, pkg_t *pkg, const char *filename) } err = pkg_extract_control_file_to_stream(pkg, control_file); - if (err) + if (err) { + opkg_message(conf, OPKG_ERROR, "Failed to extract control file" + " from %s\n", filename); goto err2; + } rewind(control_file); @@ -1152,12 +1155,14 @@ pkg_get_installed_files(opkg_conf_t *conf, pkg_t *pkg) err = pkg_extract_data_file_names_to_stream(pkg, list_file); if (err) { opkg_message(conf, OPKG_ERROR, "%s: Error extracting file list " - "from %s: %s\n", __FUNCTION__, - pkg->local_filename, strerror(err)); + "from %s\n", __FUNCTION__, + pkg->local_filename); fclose(list_file); unlink(list_file_name); free(list_file_name); - return pkg->installed_files; + str_list_deinit(pkg->installed_files); + pkg->installed_files = NULL; + return NULL; } rewind(list_file); } else { @@ -1436,7 +1441,8 @@ pkg_info_preinstall_check(opkg_conf_t *conf) str_list_t *installed_files = pkg_get_installed_files(conf, pkg); /* this causes installed_files to be cached */ str_list_elt_t *iter, *niter; if (installed_files == NULL) { - opkg_message(conf, OPKG_ERROR, "No installed files for pkg %s\n", pkg->name); + opkg_message(conf, OPKG_ERROR, "Failed to determine installed " + "files for pkg %s.\n", pkg->name); break; } for (iter = str_list_first(installed_files), niter = str_list_next(installed_files, iter);