aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2005-08-05 13:09:32 +0000
committerDavid Shaw <[email protected]>2005-08-05 13:09:32 +0000
commit433038b4a9a42cbc0329968f38bb1244bbeab7ec (patch)
treed4d31bcf61b80351bc95f5d8d52b6c4fd8f700b7
parent* keygen.c (proc_parameter_file): Sanity check items in keygen batch (diff)
downloadgnupg-433038b4a9a42cbc0329968f38bb1244bbeab7ec.tar.gz
gnupg-433038b4a9a42cbc0329968f38bb1244bbeab7ec.zip
* gpg-zip.in: Add --decrypt functionality. Fix quoting so filenames
with spaces work properly.
Diffstat (limited to '')
-rw-r--r--tools/ChangeLog5
-rw-r--r--tools/gpg-zip.in24
2 files changed, 24 insertions, 5 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog
index 4f71467b2..31a763b66 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-05 David Shaw <[email protected]>
+
+ * gpg-zip.in: Add --decrypt functionality. Fix quoting so
+ filenames with spaces work properly.
+
2005-08-04 David Shaw <[email protected]>
* gpg-zip.in: New. Script wrapper to work with encrypted tar
diff --git a/tools/gpg-zip.in b/tools/gpg-zip.in
index 40b6f3dc4..8b4ccfb2b 100644
--- a/tools/gpg-zip.in
+++ b/tools/gpg-zip.in
@@ -29,7 +29,7 @@ TAR=@TAR@
GPG=gpg
usage="\
-Usage: gpg-zip [--help] [--version] [--encrypt] [--symmetric]
+Usage: gpg-zip [--help] [--version] [--encrypt] [--decrypt] [--symmetric]
[--list-archive] [--output FILE] [--gpg GPG] [--gpg-args ARGS]
[--tar TAR] [--tar-args ARGS] filename1 [filename2, ...]
directory1 [directory2, ...]
@@ -45,24 +45,35 @@ while test $# -gt 0 ; do
--list-archive)
list=yes
create=no
+ unpack=no
shift
;;
--encrypt | -e)
gpg_args="$gpg_args --encrypt"
list=no
create=yes
+ unpack=no
+ shift
+ ;;
+ --decrypt | -d)
+ gpg_args="$gpg_args --decrypt"
+ list=no
+ create=no
+ unpack=yes
shift
;;
--symmetric | -c)
gpg_args="$gpg_args --symmetric"
list=no
create=yes
+ unpack=no
shift
;;
--sign | -s)
gpg_args="$gpg_args --sign"
list=no
create=yes
+ unpack=no
shift
;;
--recipient | -r)
@@ -117,11 +128,14 @@ while test $# -gt 0 ; do
done
if test x$create = xyes ; then
-# echo "$TAR -cf - $* | $GPG --set-filename x.tar $gpg_args" >&2
- $TAR -cf - $* | $GPG --set-filename x.tar $gpg_args
+# echo "$TAR -cf - "$@" | $GPG --set-filename x.tar $gpg_args" 1>&2
+ $TAR -cf - "$@" | $GPG --set-filename x.tar $gpg_args
elif test x$list = xyes ; then
-# echo "cat $1 | $GPG $gpg_args | $TAR $tar_args -tf -" >&2
- cat $1 | $GPG $gpg_args | $TAR $tar_args -tf -
+# echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -tf -" 1>&2
+ cat "$1" | $GPG $gpg_args | $TAR $tar_args -tf -
+elif test x$unpack = xyes ; then
+# echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -xvf -" 1>&2
+ cat "$1" | $GPG $gpg_args | $TAR $tar_args -xvf -
else
echo "$usage" 1>&2
exit 1