mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpgtar: Make option -C work for archive creation.
* tools/gpgtar-create.c (gpgtar_create): Switch to the -C directory. -- The -C option is pretty useful given that pattern are always relative to the current directory. In contrast to GNU tar, the switching is done only once. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
91ae3e7fb6
commit
b3a7a51407
3 changed files with 14 additions and 5 deletions
|
@ -762,6 +762,14 @@ gpgtar_create (char **inpattern, int encrypt, int sign)
|
|||
memset (scanctrl, 0, sizeof *scanctrl);
|
||||
scanctrl->flist_tail = &scanctrl->flist;
|
||||
|
||||
if (opt.directory && gnupg_chdir (opt.directory))
|
||||
{
|
||||
err = gpg_error_from_syserror ();
|
||||
log_error ("chdir to '%s' failed: %s\n",
|
||||
opt.directory, gpg_strerror (err));
|
||||
return err;
|
||||
}
|
||||
|
||||
while (!eof_seen)
|
||||
{
|
||||
char *pat, *p;
|
||||
|
|
|
@ -112,7 +112,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||
ARGPARSE_group (302, N_("@\nTar options:\n ")),
|
||||
|
||||
ARGPARSE_s_s (oDirectory, "directory",
|
||||
N_("|DIRECTORY|extract files into DIRECTORY")),
|
||||
N_("|DIRECTORY|change to DIRECTORY first")),
|
||||
ARGPARSE_s_s (oFilesFrom, "files-from",
|
||||
N_("|FILE|get names to create from FILE")),
|
||||
ARGPARSE_s_n (oNull, "null", N_("-T reads null-terminated names")),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue