X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=src%2Fopkg-cl.c;h=01c6e94627af927a59bd63542b9f65e670d64ed5;hb=4318ab1de6881f00ccb3a04c755893dee5f068ed;hp=e2f10a11852eca066996f9b0416b96e59354d9a6;hpb=4283ab3c37ebe4deb670dd049857b020c8794552;p=project%2Fopkg-lede.git diff --git a/src/opkg-cl.c b/src/opkg-cl.c index e2f10a1..01c6e94 100644 --- a/src/opkg-cl.c +++ b/src/opkg-cl.c @@ -19,10 +19,10 @@ opkg command line frontend using libopkg */ -#include "config.h" - +#define _GNU_SOURCE #include #include +#include #include "opkg_conf.h" #include "opkg_cmd.h" @@ -52,6 +52,8 @@ enum { ARGS_OPT_AUTOREMOVE, ARGS_OPT_CACHE, ARGS_OPT_FORCE_SIGNATURE, + ARGS_OPT_NO_CHECK_CERTIFICATE, + ARGS_OPT_VERIFY_PROGRAM, ARGS_OPT_SIZE, }; @@ -91,6 +93,8 @@ static struct option long_options[] = { {"force_checksum", 0, 0, ARGS_OPT_FORCE_CHECKSUM}, {"force-signature", 0, 0, ARGS_OPT_FORCE_SIGNATURE}, {"force_signature", 0, 0, ARGS_OPT_FORCE_SIGNATURE}, + {"no-check-certificate", 0, 0, ARGS_OPT_NO_CHECK_CERTIFICATE}, + {"no_check_certificate", 0, 0, ARGS_OPT_NO_CHECK_CERTIFICATE}, {"noaction", 0, 0, ARGS_OPT_NOACTION}, {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY}, {"nodeps", 0, 0, ARGS_OPT_NODEPS}, @@ -106,6 +110,8 @@ static struct option long_options[] = { {"lists-dir", 1, 0, 'l'}, {"lists_dir", 1, 0, 'l'}, {"verbosity", 2, 0, 'V'}, + {"verify-program", 1, 0, ARGS_OPT_VERIFY_PROGRAM}, + {"verify_program", 1, 0, ARGS_OPT_VERIFY_PROGRAM}, {"version", 0, 0, 'v'}, {0, 0, 0, 0} }; @@ -226,6 +232,12 @@ static int args_parse(int argc, char *argv[]) case ARGS_OPT_FORCE_SIGNATURE: conf->force_signature = 1; break; + case ARGS_OPT_NO_CHECK_CERTIFICATE: + conf->no_check_certificate = 1; + break; + case ARGS_OPT_VERIFY_PROGRAM: + conf->verify_program = xstrdup(optarg); + break; case ':': parse_err = -1; break; @@ -316,6 +328,8 @@ static void usage() printf(" directory name in a pinch).\n"); printf("\t-o Use as the root directory for\n"); printf("\t--offline-root offline installation of packages.\n"); + printf + ("\t--verify-program Use the given program to verify usign signatures\n"); printf ("\t--add-arch : Register architecture with given priority\n"); printf @@ -335,6 +349,7 @@ static void usage() printf ("\t--force-remove Remove package even if prerm script fails\n"); printf("\t--force-checksum Don't fail on checksum mismatches\n"); + printf("\t--no-check-certificate Don't validate SSL certificates\n"); printf("\t--noaction No action -- test only\n"); printf("\t--download-only No action -- download only\n"); printf("\t--nodeps Do not follow dependencies\n"); @@ -387,24 +402,28 @@ int main(int argc, char *argv[]) cmd_name = argv[opts++]; - if (!strcmp(cmd_name, "print-architecture") || + if (!strcmp(cmd_name, "install") || + !strcmp(cmd_name, "print-architecture") || !strcmp(cmd_name, "print_architecture") || !strcmp(cmd_name, "print-installation-architecture") || - !strcmp(cmd_name, "print_installation_architecture")) + !strcmp(cmd_name, "print_installation_architecture") || + !strcmp(cmd_name, "compare_versions") || + !strcmp(cmd_name, "compare-versions")) nocheckfordirorfile = 1; if (!strcmp(cmd_name, "flag") || !strcmp(cmd_name, "configure") || + !strcmp(cmd_name, "install") || !strcmp(cmd_name, "remove") || !strcmp(cmd_name, "files") || !strcmp(cmd_name, "search") || - !strcmp(cmd_name, "compare_versions") || - !strcmp(cmd_name, "compare-versions") || + !strcmp(cmd_name, "list") || !strcmp(cmd_name, "list_installed") || !strcmp(cmd_name, "list-installed") || !strcmp(cmd_name, "list_changed_conffiles") || !strcmp(cmd_name, "list-changed-conffiles") || - !strcmp(cmd_name, "status")) + !strcmp(cmd_name, "status") || + !strcmp(cmd_name, "update")) noreadfeedsfile = 1; cmd = opkg_cmd_find(cmd_name); @@ -421,11 +440,11 @@ int main(int argc, char *argv[]) if (!nocheckfordirorfile) { if (!noreadfeedsfile) { - if (pkg_hash_load_feeds(SF_NEED_DETAIL)) + if (pkg_hash_load_feeds(SF_NEED_DETAIL, NULL, NULL)) goto err1; } - if (pkg_hash_load_status_files()) + if (pkg_hash_load_status_files(NULL, NULL)) goto err1; } @@ -438,9 +457,6 @@ int main(int argc, char *argv[]) err = opkg_cmd_exec(cmd, argc - opts, (const char **)(argv + opts)); -#ifdef HAVE_CURL - opkg_curl_cleanup(); -#endif err1: opkg_conf_deinit();