summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-04-19 11:17:35 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-04-19 11:25:26 (EDT)
commit2901b2c9c6389235932be187607c398ef20cb79a (patch)
tree7776b9f76fd1bddb17501e06b22bbdd8ee2ed7dc /src/main.c
parentc91c1fa46dfc773090489f1802e4470a007b2cf7 (diff)
opk: Automatically initialize inner gzip and ustar
Simplifies interface to main().
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c
index 7b18541..1201330 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,37 +39,27 @@ main(int argc, char *argv[])
}
/* Initialize outer archive. */
- opk = opkg_opk_opk_init_outer(argv[1]);
+ opk = opkg_opk_opk_init(argv[1]);
if (opk == NULL) {
goto error0;
}
/* Read control file. */
- if (opkg_opk_opk_init_inner(opk, "control.tar.gz") != OPKG_OPK_OK) {
- goto error1;
- }
if (opkg_opk_opk_read_control(opk, control_files) != OPKG_OPK_OK) {
- goto error2;
+ goto error1;
}
- opkg_opk_opk_free_inner(opk);
/* List data files. */
- if (opkg_opk_opk_init_inner(opk, "data.tar.gz") != OPKG_OPK_OK) {
- goto error1;
- }
if (opkg_opk_opk_list_members(opk) != OPKG_OPK_OK) {
- goto error2;
+ goto error1;
}
- opkg_opk_opk_free_inner(opk);
- opkg_opk_opk_free_outer(opk);
+ opkg_opk_opk_free(opk);
opkg_opk_ustar_free_seek_names(control_files);
return EXIT_SUCCESS;
- error2:
- opkg_opk_opk_free_inner(opk);
error1:
- opkg_opk_opk_free_outer(opk);
+ opkg_opk_opk_free(opk);
error0:
opkg_opk_ustar_free_seek_names(control_files);
return EXIT_FAILURE;