* options.h, g10.c (main), import.c (parse_import_options, import_one,
[gnupg.git] / g10 / g10.c
index 6509b3e..20d781c 100644 (file)
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -192,6 +192,7 @@ enum cmd_and_opt_values
     oCompressAlgo,
     oCompressLevel,
     oBZ2CompressLevel,
+    oBZ2CompressLowmem,
     oPasswdFD,
 #ifdef __riscos__
     oPasswdFile,
@@ -221,7 +222,6 @@ enum cmd_and_opt_values
     oAlwaysTrust,
     oTrustModel,
     oForceOwnertrust,
-    oEmuChecksumBug,
     oRunAsShmCP,
     oSetFilename,
     oForYourEyesOnly,
@@ -316,7 +316,6 @@ enum cmd_and_opt_values
     oPersonalCipherPreferences,
     oPersonalDigestPreferences,
     oPersonalCompressPreferences,
-    oEmuMDEncodeBug,
     oDisplay,
     oTTYname,
     oTTYtype,
@@ -423,6 +422,7 @@ static ARGPARSE_OPTS opts[] = {
     { oCompress, NULL, 1, N_("|N|set compress level N (0 disables)") },
     { oCompressLevel, "compress-level", 1, "@" },
     { oBZ2CompressLevel, "bzip2-compress-level", 1, "@" },
+    { oBZ2CompressLowmem, "bzip2-compress-lowmem", 0, "@" },
     { oTextmodeShort, NULL,   0, "@"},
     { oTextmode, "textmode",  0, N_("use canonical text mode")},
     { oNoTextmode, "no-textmode",  0, "@"},
@@ -565,7 +565,6 @@ static ARGPARSE_OPTS opts[] = {
     { oAlwaysTrust, "always-trust", 0, "@"},
     { oTrustModel, "trust-model", 2, "@"},
     { oForceOwnertrust, "force-ownertrust", 2, "@"},
-    { oEmuChecksumBug, "emulate-checksum-bug", 0, "@"},
     { oRunAsShmCP, "run-as-shm-coprocess", 4, "@" },
     { oSetFilename, "set-filename", 2, "@" },
     { oForYourEyesOnly, "for-your-eyes-only", 0, "@" },
@@ -640,7 +639,6 @@ static ARGPARSE_OPTS opts[] = {
     { oPersonalCipherPreferences, "personal-cipher-prefs", 2, "@"},
     { oPersonalDigestPreferences, "personal-digest-prefs", 2, "@"},
     { oPersonalCompressPreferences, "personal-compress-prefs", 2, "@"},
-    { oEmuMDEncodeBug, "emulate-md-encode-bug", 0, "@"},
     { oDisplay,    "display",     2, "@" },
     { oTTYname,    "ttyname",     2, "@" },
     { oTTYtype,    "ttytype",     2, "@" },
@@ -660,11 +658,9 @@ static ARGPARSE_OPTS opts[] = {
     { opcscDriver, "pcsc-driver",    2, "@"},
     { oDisableCCID, "disable-ccid", 0, "@"},
 
-
 {0} };
 
 
-
 int g10_errors_seen = 0;
 
 static int utf8_strings = 0;
@@ -679,10 +675,6 @@ static void add_notation_data( const char *string, int which );
 static void add_policy_url( const char *string, int which );
 static void add_keyserver_url( const char *string, int which );
 
-#ifdef __riscos__
-RISCOS_GLOBAL_STATICS("GnuPG Heap")
-#endif /* __riscos__ */
-
 const char *
 strusage( int level )
 {
@@ -696,6 +688,19 @@ strusage( int level )
       case 19: p =
            _("Please report bugs to <gnupg-bugs@gnu.org>.\n");
        break;
+
+#ifdef IS_DEVELOPMENT_VERSION
+      case 20:
+       p="NOTE: THIS IS A DEVELOPMENT VERSION!";
+       break;
+      case 21:
+       p="It is only intended for test purposes and should NOT be";
+       break;
+      case 22:
+       p="used in a production environment or with production keys!";
+       break;
+#endif
+
       case 1:
       case 40: p =
            _("Usage: gpg [options] [files] (-h for help)");
@@ -1182,7 +1187,6 @@ main( int argc, char **argv )
 #endif
 
 #ifdef __riscos__
-    riscos_global_defaults();
     opt.lock_once = 1;
 #endif /* __riscos__ */
 
@@ -1200,6 +1204,7 @@ main( int argc, char **argv )
     i18n_init();
     opt.command_fd = -1; /* no command fd */
     opt.compress_level = -1; /* defaults to standard compress level */
+    opt.bz2_compress_level = -1; /* defaults to standard compress level */
     /* note: if you change these lines, look at oOpenPGP */
     opt.def_cipher_algo = 0;
     opt.def_digest_algo = 0;
@@ -1671,7 +1676,6 @@ main( int argc, char **argv )
          case oPGP7:  opt.compliance = CO_PGP7;  break;
          case oPGP8:  opt.compliance = CO_PGP8;  break;
          case oGnuPG: opt.compliance = CO_GNUPG; break;
-         case oEmuMDEncodeBug: opt.emulate_bugs |= EMUBUG_MDENCODE; break;
          case oCompressSigs: opt.compress_sigs = 1; break;
          case oRunAsShmCP:
 #ifndef __riscos__
@@ -1790,6 +1794,7 @@ main( int argc, char **argv )
            break;
          case oCompressLevel: opt.compress_level = pargs.r.ret_int; break;
          case oBZ2CompressLevel: opt.bz2_compress_level = pargs.r.ret_int; break;
+         case oBZ2CompressLowmem: opt.bz2_compress_lowmem=1; break;
          case oPasswdFD:
             pwfd = iobuf_translate_file_handle (pargs.r.ret_int, 0);
             opt.use_agent = 0;
@@ -1863,7 +1868,7 @@ main( int argc, char **argv )
            parse_keyserver_options(pargs.r.ret_str);
            break;
          case oImportOptions:
-           if(!parse_import_options(pargs.r.ret_str,&opt.import_options))
+           if(!parse_import_options(pargs.r.ret_str,&opt.import_options,1))
              {
                if(configname)
                  log_error(_("%s:%d: invalid import options\n"),
@@ -1873,7 +1878,7 @@ main( int argc, char **argv )
              }
            break;
          case oExportOptions:
-           if(!parse_export_options(pargs.r.ret_str,&opt.export_options))
+           if(!parse_export_options(pargs.r.ret_str,&opt.export_options,1))
              {
                if(configname)
                  log_error(_("%s:%d: invalid export options\n"),
@@ -1898,7 +1903,7 @@ main( int argc, char **argv )
                  {NULL,0}
                };
 
-             if(!parse_options(pargs.r.ret_str,&opt.list_options,lopts))
+             if(!parse_options(pargs.r.ret_str,&opt.list_options,lopts,1))
                {
                  if(configname)
                    log_error(_("%s:%d: invalid list options\n"),
@@ -1922,7 +1927,7 @@ main( int argc, char **argv )
                  {NULL,0}
                };
 
-             if(!parse_options(pargs.r.ret_str,&opt.verify_options,vopts))
+             if(!parse_options(pargs.r.ret_str,&opt.verify_options,vopts,1))
                {
                  if(configname)
                    log_error(_("%s:%d: invalid verify options\n"),
@@ -1978,11 +1983,10 @@ main( int argc, char **argv )
          case oNoLiteral: opt.no_literal = 1; break;
          case oSetFilesize: opt.set_filesize = pargs.r.ret_ulong; break;
          case oHonorHttpProxy:
-                opt.keyserver_options.honor_http_proxy = 1;
+               add_to_strlist(&opt.keyserver_options.other,"http-proxy");
                deprecated_warning(configname,configlineno,
                                   "--honor-http-proxy",
-                                  "--keyserver-options ",
-                                  "honor-http-proxy");
+                                  "--keyserver-options ","http-proxy");
                break;
          case oFastListMode: opt.fast_list_mode = 1; break;
          case oFixedListMode: opt.fixed_list_mode = 1; break;
@@ -2006,7 +2010,11 @@ main( int argc, char **argv )
          case oOverrideSessionKey:
                opt.override_session_key = pargs.r.ret_str;
                break;
-         case oMergeOnly: opt.merge_only = 1; break;
+         case oMergeOnly:
+               deprecated_warning(configname,configlineno,"--merge-only",
+                                  "--import-options ","merge-only");
+               opt.import_options|=IMPORT_MERGE_ONLY;
+           break;
           case oAllowSecretKeyImport: /* obsolete */ break;
          case oTryAllSecrets: opt.try_all_secrets = 1; break;
           case oTrustedKey: register_trusted_key( pargs.r.ret_str ); break;
@@ -2073,11 +2081,17 @@ main( int argc, char **argv )
        fprintf(stderr, "%s\n", strusage(15) );
     }
 #ifdef IS_DEVELOPMENT_VERSION
-    if( !opt.batch ) {
-       log_info("NOTE: THIS IS A DEVELOPMENT VERSION!\n");
-       log_info("It is only intended for test purposes and should NOT be\n");
-       log_info("used in a production environment or with production keys!\n");
-    }
+    if( !opt.batch )
+      {
+       const char *s;
+
+       if((s=strusage(20)))
+         log_info("%s\n",s);
+       if((s=strusage(21)))
+         log_info("%s\n",s);
+       if((s=strusage(22)))
+         log_info("%s\n",s);
+      }
 #endif
 
     if (opt.verbose > 2)