1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-09 12:54:23 +01:00

* gpg-zip.in: Add --decrypt functionality. Fix quoting so filenames

with spaces work properly.
This commit is contained in:
David Shaw 2005-08-05 13:09:32 +00:00
parent 533bc3e813
commit 433038b4a9
2 changed files with 24 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2005-08-05 David Shaw <dshaw@jabberwocky.com>
* gpg-zip.in: Add --decrypt functionality. Fix quoting so
filenames with spaces work properly.
2005-08-04 David Shaw <dshaw@jabberwocky.com> 2005-08-04 David Shaw <dshaw@jabberwocky.com>
* gpg-zip.in: New. Script wrapper to work with encrypted tar * gpg-zip.in: New. Script wrapper to work with encrypted tar

View File

@ -29,7 +29,7 @@ TAR=@TAR@
GPG=gpg GPG=gpg
usage="\ 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] [--list-archive] [--output FILE] [--gpg GPG] [--gpg-args ARGS]
[--tar TAR] [--tar-args ARGS] filename1 [filename2, ...] [--tar TAR] [--tar-args ARGS] filename1 [filename2, ...]
directory1 [directory2, ...] directory1 [directory2, ...]
@ -45,24 +45,35 @@ while test $# -gt 0 ; do
--list-archive) --list-archive)
list=yes list=yes
create=no create=no
unpack=no
shift shift
;; ;;
--encrypt | -e) --encrypt | -e)
gpg_args="$gpg_args --encrypt" gpg_args="$gpg_args --encrypt"
list=no list=no
create=yes create=yes
unpack=no
shift
;;
--decrypt | -d)
gpg_args="$gpg_args --decrypt"
list=no
create=no
unpack=yes
shift shift
;; ;;
--symmetric | -c) --symmetric | -c)
gpg_args="$gpg_args --symmetric" gpg_args="$gpg_args --symmetric"
list=no list=no
create=yes create=yes
unpack=no
shift shift
;; ;;
--sign | -s) --sign | -s)
gpg_args="$gpg_args --sign" gpg_args="$gpg_args --sign"
list=no list=no
create=yes create=yes
unpack=no
shift shift
;; ;;
--recipient | -r) --recipient | -r)
@ -117,11 +128,14 @@ while test $# -gt 0 ; do
done done
if test x$create = xyes ; then if test x$create = xyes ; then
# echo "$TAR -cf - $* | $GPG --set-filename x.tar $gpg_args" >&2 # echo "$TAR -cf - "$@" | $GPG --set-filename x.tar $gpg_args" 1>&2
$TAR -cf - $* | $GPG --set-filename x.tar $gpg_args $TAR -cf - "$@" | $GPG --set-filename x.tar $gpg_args
elif test x$list = xyes ; then elif test x$list = xyes ; then
# echo "cat $1 | $GPG $gpg_args | $TAR $tar_args -tf -" >&2 # echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -tf -" 1>&2
cat $1 | $GPG $gpg_args | $TAR $tar_args -tf - 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 else
echo "$usage" 1>&2 echo "$usage" 1>&2
exit 1 exit 1