diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/opk/read.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/opk/read.c b/src/opk/read.c index a076dae..97187dc 100644 --- a/src/opk/read.c +++ b/src/opk/read.c @@ -493,8 +493,13 @@ opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) } /* Check package version. */ - if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK || - strcmp(member->name, "debian-binary") != 0) { + if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + fputs(_("Error: Failed to find \"debian-binary\" in archive\n"), + stderr); + ret = OPKG_OPK_ERROR; + goto out3; + } + if (strcmp(member->name, "debian-binary") != 0) { free(member); fputs(_("Error: Failed to find \"debian-binary\" in archive\n"), stderr); @@ -510,16 +515,19 @@ opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) ret = OPKG_OPK_ERROR; goto out3; } - if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) - { + if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { fputs(_("Error: Unsupported package version\n"), stderr); ret = OPKG_OPK_ERROR; goto out3; } /* Read control archive. */ - if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK || - strcmp(member->name, "control.tar.gz") != 0) { + if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + fputs(_("Error: Failed to find \"control.tar.gz\" in archive\n") + , stderr); + return OPKG_OPK_ERROR; + } + if (strcmp(member->name, "control.tar.gz") != 0) { free(member); fputs(_("Error: Failed to find \"control.tar.gz\" in archive\n") , stderr); @@ -532,8 +540,12 @@ opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) } /* Read data archive. */ - if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK || - strcmp(member->name, "data.tar.gz") != 0) { + if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + fputs(_("Error: Failed to find \"data.tar.gz\" in archive\n"), + stderr); + return OPKG_OPK_ERROR; + } + if (strcmp(member->name, "data.tar.gz") != 0) { free(member); fputs(_("Error: Failed to find \"data.tar.gz\" in archive\n"), stderr); |