1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

gpgtar: New option --no-compress.

* tools/gpgtar.c: Add option --no-compress.
* tools/gpgtar.h (opt): Add field no_compress.
* tools/gpgtar-create.c (gpgtar_create): Pass -z0 to gpg.
--

This option is probably easier to remember than --gpg-args '-z0'.
This commit is contained in:
Werner Koch 2023-06-15 13:52:18 +02:00
parent 0bed46cae2
commit 47cce2020d
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
4 changed files with 12 additions and 0 deletions

View File

@ -1988,6 +1988,12 @@ default is to take the directory name from the input filename. If no
input filename is known a directory named @file{GPGARCH} is used. input filename is known a directory named @file{GPGARCH} is used.
This option is deprecated in favor of option @option{--directory}. This option is deprecated in favor of option @option{--directory}.
@item --no-compress
@opindex no-compress
This option tells gpg to disable compression (i.e. using option -z0).
It is useful for archiving only large files which are are already
compressed (e.g. a set of videos).
@item --gpg @var{gpgcmd} @item --gpg @var{gpgcmd}
@opindex gpg @opindex gpg
Use the specified command @var{gpgcmd} instead of @command{gpg}. Use the specified command @var{gpgcmd} instead of @command{gpg}.

View File

@ -1283,6 +1283,8 @@ gpgtar_create (char **inpattern, const char *files_from, int null_names,
ccparray_put (&ccp, "--recipient"); ccparray_put (&ccp, "--recipient");
ccparray_put (&ccp, arg->d); ccparray_put (&ccp, arg->d);
} }
if (opt.no_compress)
ccparray_put (&ccp, "-z0");
for (arg = opt.gpg_arguments; arg; arg = arg->next) for (arg = opt.gpg_arguments; arg; arg = arg->next)
ccparray_put (&ccp, arg->d); ccparray_put (&ccp, arg->d);

View File

@ -75,6 +75,7 @@ enum cmd_and_opt_values
oSetFilename, oSetFilename,
oNull, oNull,
oUtf8Strings, oUtf8Strings,
oNoCompress,
oBatch, oBatch,
oAnswerYes, oAnswerYes,
@ -118,6 +119,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_s (oSetFilename, "set-filename", "@"), ARGPARSE_s_s (oSetFilename, "set-filename", "@"),
ARGPARSE_s_n (oOpenPGP, "openpgp", "@"), ARGPARSE_s_n (oOpenPGP, "openpgp", "@"),
ARGPARSE_s_n (oCMS, "cms", "@"), ARGPARSE_s_n (oCMS, "cms", "@"),
ARGPARSE_s_n (oNoCompress, "no-compress", "@"),
ARGPARSE_s_n (oBatch, "batch", "@"), ARGPARSE_s_n (oBatch, "batch", "@"),
ARGPARSE_s_n (oAnswerYes, "yes", "@"), ARGPARSE_s_n (oAnswerYes, "yes", "@"),
@ -344,6 +346,7 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
case oFilesFrom: files_from = pargs->r.ret_str; break; case oFilesFrom: files_from = pargs->r.ret_str; break;
case oNull: null_names = 1; break; case oNull: null_names = 1; break;
case oUtf8Strings: opt.utf8strings = 1; break; case oUtf8Strings: opt.utf8strings = 1; break;
case oNoCompress: opt.no_compress = 1; break;
case aList: case aList:
case aDecrypt: case aDecrypt:

View File

@ -33,6 +33,7 @@ struct
int quiet; int quiet;
int dry_run; int dry_run;
int utf8strings; int utf8strings;
int no_compress;
const char *gpg_program; const char *gpg_program;
strlist_t gpg_arguments; strlist_t gpg_arguments;
const char *outfile; const char *outfile;