opkg: allow to configure the path to the signature verification script
[project/opkg-lede.git] / src / opkg-cl.c
index a3ea5c139aa2221c0075796ead72212c731a66a6..01c6e94627af927a59bd63542b9f65e670d64ed5 100644 (file)
@@ -53,6 +53,7 @@ enum {
        ARGS_OPT_CACHE,
        ARGS_OPT_FORCE_SIGNATURE,
        ARGS_OPT_NO_CHECK_CERTIFICATE,
+       ARGS_OPT_VERIFY_PROGRAM,
        ARGS_OPT_SIZE,
 };
 
@@ -109,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}
 };
@@ -232,6 +235,9 @@ static int args_parse(int argc, char *argv[])
                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;
@@ -322,6 +328,8 @@ static void usage()
        printf("                                directory name in a pinch).\n");
        printf("\t-o <dir>              Use <dir> as the root directory for\n");
        printf("\t--offline-root <dir>  offline installation of packages.\n");
+       printf
+           ("\t--verify-program <path> Use the given program to verify usign signatures\n");
        printf
            ("\t--add-arch <arch>:<prio>        Register architecture with given priority\n");
        printf
@@ -409,11 +417,13 @@ int main(int argc, char *argv[])
            !strcmp(cmd_name, "remove") ||
            !strcmp(cmd_name, "files") ||
            !strcmp(cmd_name, "search") ||
+           !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);
@@ -430,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;
        }