summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index d9ccb64..b24a2fd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,11 +20,21 @@
#include <stdlib.h>
#include "defs.h"
#include "opk.h"
+#include "ustar.h"
int
main(int argc, char *argv[])
{
- struct opkg_opk_opk *opk;
+ struct opkg_opk_ustar_seek_name *control_files_head;
+ struct opkg_opk_ustar_seek_name *control_files_tail;
+ struct opkg_opk_opk *opk;
+
+ control_files_head = control_files_tail = NULL;
+ if (opkg_opk_ustar_add_seek_name(
+ &control_files_head, &control_files_tail,
+ "control") != OPKG_OPK_OK) {
+ goto error0;
+ }
/* Initialize outer archive. */
opk = opkg_opk_opk_init_outer(argv[1]);
@@ -36,7 +46,7 @@ main(int argc, char *argv[])
if (opkg_opk_opk_init_inner(opk, "control.tar.gz") != OPKG_OPK_OK) {
goto error1;
}
- if (opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) {
+ if (opkg_opk_opk_read_control(opk, control_files_head) != OPKG_OPK_OK) {
goto error2;
}
opkg_opk_opk_free_inner(opk);
@@ -58,5 +68,10 @@ main(int argc, char *argv[])
error1:
opkg_opk_opk_free_outer(opk);
error0:
+ for (control_files_tail = control_files_head;
+ control_files_tail != NULL; ) {
+ control_files_tail = control_files_head->next;
+ free(control_files_head);
+ }
return EXIT_FAILURE;
}