3 # gpg-archive - gpg-ized tar using the same format as PGP's PGP Zip.
4 # Copyright (C) 2005 Free Software Foundation, Inc.
6 # This file is part of GnuPG.
8 # GnuPG is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # GnuPG is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, see <http://www.gnu.org/licenses/>.
20 # Despite the name, PGP Zip format is actually an OpenPGP-wrapped tar
21 # file. To be compatible with PGP itself, this must be a USTAR format
22 # tar file. Unclear on whether there is a distinction here between
23 # the GNU or POSIX variant of USTAR.
30 Usage: gpg-zip [--help] [--version] [--encrypt] [--decrypt] [--symmetric]
31 [--list-archive] [--output FILE] [--gpg GPG] [--gpg-args ARGS]
32 [--tar TAR] [--tar-args ARGS] filename1 [filename2, ...]
33 directory1 [directory2, ...]
35 Encrypt or sign files into an archive."
39 while test $# -gt 0 ; do
52 gpg_args="$gpg_args --encrypt"
59 gpg_args="$gpg_args --decrypt"
66 gpg_args="$gpg_args --symmetric"
73 gpg_args="$gpg_args --sign"
80 gpg_args="$gpg_args --recipient $2"
85 gpg_args="$gpg_args --local-user $2"
90 gpg_args="$gpg_args --output $2"
95 echo "gpg-zip (GnuPG) $VERSION"
104 gpg_args="$gpg_args $2"
114 tar_args="$tar_args $2"
136 if test x$create = xyes ; then
137 # echo "$TAR $tar_args -cf - "$@" | $GPG --set-filename x.tar $gpg_args" 1>&2
138 $TAR $tar_args -cf - "$@" | $GPG --set-filename x.tar $gpg_args
139 elif test x$list = xyes ; then
140 # echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -tf -" 1>&2
141 cat "$1" | $GPG $gpg_args | $TAR $tar_args -tf -
142 elif test x$unpack = xyes ; then
143 # echo "cat \"$1\" | $GPG $gpg_args | $TAR $tar_args -xvf -" 1>&2
144 cat "$1" | $GPG $gpg_args | $TAR $tar_args -x${tar_verbose_opt}f -