opkg command line frontend using libopkg
*/
-#include "includes.h"
+#include "config.h"
+#include <stdio.h>
#include <getopt.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#include "opkg_conf.h"
#include "opkg_cmd.h"
int
main(int argc, char *argv[])
{
- int opts;
+ int opts, err = -1;
char *cmd_name;
opkg_cmd_t *cmd;
int nocheckfordirorfile = 0;
usage();
}
- if (opkg_cmd_exec(cmd, argc - opts, (const char **) (argv + opts)))
- goto err2;
+ err = opkg_cmd_exec(cmd, argc - opts, (const char **) (argv + opts));
- print_error_list();
- free_error_list();
-
- return 0;
-
-err2:
#ifdef HAVE_CURL
opkg_curl_cleanup();
#endif
print_error_list();
free_error_list();
- return -1;
+ return err;
}