From 2901b2c9c6389235932be187607c398ef20cb79a Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 19 Apr 2023 11:17:35 -0400 Subject: opk: Automatically initialize inner gzip and ustar Simplifies interface to main(). --- (limited to 'src/main.c') 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; -- cgit v0.9.1