[svn] GnuPG - r5404 - trunk/tools
svn author wk
cvs at cvs.gnupg.org
Wed Aug 25 12:31:48 CEST 2010
Author: wk
Date: 2010-08-25 12:31:47 +0200 (Wed, 25 Aug 2010)
New Revision: 5404
Modified:
trunk/tools/ChangeLog
trunk/tools/gpgtar-extract.c
trunk/tools/gpgtar-list.c
trunk/tools/gpgtar.c
Log:
Changed option names.
Add O_BINARY for stdin and stdout.
Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog 2010-08-23 19:26:05 UTC (rev 5403)
+++ trunk/tools/ChangeLog 2010-08-25 10:31:47 UTC (rev 5404)
@@ -1,3 +1,15 @@
+2010-08-25 Werner Koch <wk at g10code.com>
+
+ * gpgtar.c: Add -t as short option for --list-archive.
+
+ * gpgtar-extract.c (gpgtar_extract): Use filename "-" for stdin.
+ Fix dirprefix setting.
+ * gpgtar-list.c (gpgtar_list): Ditto.
+
+2010-08-24 Werner Koch <wk at g10code.com>
+
+ * gpgtar.c (opts): Fix --cms and --openpgp names.
+
2010-08-23 Werner Koch <wk at g10code.com>
* gpgconf-comp.c (GPGNAME) [W32CE]: s/gpg2/gpg/.
Modified: trunk/tools/gpgtar-extract.c
===================================================================
--- trunk/tools/gpgtar-extract.c 2010-08-23 19:26:05 UTC (rev 5403)
+++ trunk/tools/gpgtar-extract.c 2010-08-25 10:31:47 UTC (rev 5404)
@@ -79,7 +79,7 @@
leave:
if (!err && opt.verbose)
- log_info ("extracted `%s/'\n", fname);
+ log_info ("extracted `%s'\n", fname);
es_fclose (outfp);
if (err && fname && outfp)
{
@@ -270,7 +270,10 @@
if (filename)
{
- stream = es_fopen (filename, "rb");
+ if (!strcmp (filename, "-"))
+ stream = es_stdout;
+ else
+ stream = es_fopen (filename, "rb");
if (!stream)
{
err = gpg_error_from_syserror ();
@@ -279,20 +282,26 @@
}
}
else
- stream = es_stdin; /* FIXME: How can we enforce binary mode? */
+ stream = es_stdin;
+ if (stream == es_stdin)
+ es_set_binary (es_stdin);
if (filename)
{
dirprefix = strrchr (filename, '/');
if (dirprefix)
dirprefix++;
+ else
+ dirprefix = filename;
}
else if (opt.filename)
{
dirprefix = strrchr (opt.filename, '/');
if (dirprefix)
dirprefix++;
+ else
+ dirprefix = opt.filename;
}
if (!dirprefix || !*dirprefix)
Modified: trunk/tools/gpgtar-list.c
===================================================================
--- trunk/tools/gpgtar-list.c 2010-08-23 19:26:05 UTC (rev 5403)
+++ trunk/tools/gpgtar-list.c 2010-08-25 10:31:47 UTC (rev 5404)
@@ -275,7 +275,10 @@
if (filename)
{
- stream = es_fopen (filename, "rb");
+ if (!strcmp (filename, "-"))
+ stream = es_stdout;
+ else
+ stream = es_fopen (filename, "rb");
if (!stream)
{
err = gpg_error_from_syserror ();
@@ -284,8 +287,11 @@
}
}
else
- stream = es_stdin; /* FIXME: How can we enforce binary mode? */
+ stream = es_stdin;
+ if (stream == es_stdin)
+ es_set_binary (es_stdin);
+
for (;;)
{
header = read_header (stream);
@@ -303,7 +309,7 @@
leave:
xfree (header);
- if (filename)
+ if (stream != es_stdin)
es_fclose (stream);
return;
}
Modified: trunk/tools/gpgtar.c
===================================================================
--- trunk/tools/gpgtar.c 2010-08-23 19:26:05 UTC (rev 5403)
+++ trunk/tools/gpgtar.c 2010-08-25 10:31:47 UTC (rev 5404)
@@ -48,6 +48,7 @@
aEncrypt = 'e',
aDecrypt = 'd',
aSign = 's',
+ aList = 't',
oSymmetric = 'c',
oRecipient = 'r',
@@ -63,7 +64,6 @@
oOpenPGP,
oCMS,
oSetFilename,
- aList,
oNull
};
@@ -91,8 +91,8 @@
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")),
- ARGPARSE_s_n (oOpenPGP, "--openpgp", "@"),
- ARGPARSE_s_n (oCMS, "--cms", "@"),
+ ARGPARSE_s_n (oOpenPGP, "openpgp", "@"),
+ ARGPARSE_s_n (oCMS, "cms", "@"),
ARGPARSE_end ()
};
More information about the Gnupg-commits
mailing list