cli: implement --lists-dir
[project/opkg-lede.git] / src / opkg-cl.c
index 5f66d28f7332c302232c5988b456695b7a36ba14..d70ad50d9e3b41e5d9fe0298a3fdf6b09bae2135 100644 (file)
@@ -42,6 +42,7 @@ enum {
        ARGS_OPT_FORCE_SPACE,
        ARGS_OPT_FORCE_POSTINSTALL,
        ARGS_OPT_FORCE_REMOVE,
+       ARGS_OPT_FORCE_CHECKSUM,
        ARGS_OPT_ADD_ARCH,
        ARGS_OPT_ADD_DEST,
        ARGS_OPT_NOACTION,
@@ -50,6 +51,7 @@ enum {
        ARGS_OPT_NOCASE,
        ARGS_OPT_AUTOREMOVE,
        ARGS_OPT_CACHE,
+       ARGS_OPT_FORCE_SIGNATURE,
 };
 
 static struct option long_options[] = {
@@ -84,6 +86,10 @@ static struct option long_options[] = {
        {"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
        {"force-remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
        {"force_remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
+       {"force-checksum", 0, 0, ARGS_OPT_FORCE_CHECKSUM},
+       {"force_checksum", 0, 0, ARGS_OPT_FORCE_CHECKSUM},
+       {"force-signature", 0, 0, ARGS_OPT_FORCE_SIGNATURE},
+       {"force_signature", 0, 0, ARGS_OPT_FORCE_SIGNATURE},
        {"noaction", 0, 0, ARGS_OPT_NOACTION},
        {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
        {"nodeps", 0, 0, ARGS_OPT_NODEPS},
@@ -95,6 +101,8 @@ static struct option long_options[] = {
        {"test", 0, 0, ARGS_OPT_NOACTION},
        {"tmp-dir", 1, 0, 't'},
        {"tmp_dir", 1, 0, 't'},
+       {"lists-dir", 1, 0, 'l'},
+       {"lists_dir", 1, 0, 'l'},
        {"verbosity", 2, 0, 'V'},
        {"version", 0, 0, 'v'},
        {0, 0, 0, 0}
@@ -109,7 +117,7 @@ args_parse(int argc, char *argv[])
        char *tuple, *targ;
 
        while (1) {
-               c = getopt_long_only(argc, argv, "Ad:f:ino:p:t:vV::",
+               c = getopt_long_only(argc, argv, "Ad:f:ino:p:l:t:vV::",
                                long_options, &option_index);
                if (c == -1)
                        break;
@@ -133,6 +141,9 @@ args_parse(int argc, char *argv[])
                case 't':
                        conf->tmp_dir = xstrdup(optarg);
                        break;
+               case 'l':
+                       conf->lists_dir = xstrdup(optarg);
+                       break;
                case 'v':
                        printf("opkg version %s\n", VERSION);
                        exit(0);
@@ -178,6 +189,9 @@ args_parse(int argc, char *argv[])
                case ARGS_OPT_FORCE_REMOVE:
                        conf->force_remove = 1;
                        break;
+               case ARGS_OPT_FORCE_CHECKSUM:
+                       conf->force_checksum = 1;
+                       break;
                case ARGS_OPT_NODEPS:
                        conf->nodeps = 1;
                        break;
@@ -204,6 +218,9 @@ args_parse(int argc, char *argv[])
         case ARGS_OPT_DOWNLOAD_ONLY:
                        conf->download_only = 1;
                        break;
+               case ARGS_OPT_FORCE_SIGNATURE:
+                       conf->force_signature = 1;
+                       break;
                case ':':
                        parse_err = -1;
                        break;
@@ -293,6 +310,7 @@ usage()
        printf("\t--force-space         Disable free space checks\n");
        printf("\t--force-postinstall   Run postinstall scripts even in offline mode\n");
        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--noaction            No action -- test only\n");
        printf("\t--download-only       No action -- download only\n");
        printf("\t--nodeps              Do not follow dependencies\n");
@@ -303,6 +321,8 @@ usage()
        printf("\t                      automatically to satisfy dependencies\n");
        printf("\t-t                    Specify tmp-dir.\n");
        printf("\t--tmp-dir             Specify tmp-dir.\n");
+       printf("\t-l                    Specify lists-dir.\n");
+       printf("\t--lists-dir           Specify lists-dir.\n");
 
        printf("\n");