mirror of
git://git.gnupg.org/gnupg.git
synced 2024-07-04 03:08:57 +02:00
![Justus Winter](/assets/img/avatar_default.png)
* tools/gpgtar.c (enum cmd_and_opt_values): New value. (opts): Add new group for tar options, rearrange a little, add '--tar-args'. (tar_opts): New variable. (shell_parse_stringlist): New function. (shell_parse_argv): Likewise. (parse_arguments): Add option argument, handle '--tar-args'. (main): Fix invokation of 'parse_arguments'. * tests/openpgp/gpgtar.test: Simplify decryption. Signed-off-by: Justus Winter <justus@g10code.com>
56 lines
1.0 KiB
Bash
Executable File
56 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
#set -x
|
|
|
|
# Make sure $srcdir is set.
|
|
if test "x$srcdir" = x
|
|
then
|
|
echo srcdir environment variable not set!
|
|
exit 1
|
|
fi
|
|
|
|
. $srcdir/defs.inc || exit 3
|
|
|
|
set -e
|
|
|
|
# Make sure $GNUPGHOME is set.
|
|
if test "x$GNUPGHOME" = x
|
|
then
|
|
echo "GNUPGHOME not set."
|
|
exit 1
|
|
fi
|
|
|
|
TESTFILES="$plain_files $data_files"
|
|
|
|
TESTDIR=gpgtar.d
|
|
FILELIST="${TESTDIR}/filelist"
|
|
GPG=../../g10/gpg2
|
|
GPGTAR="../../tools/gpgtar"
|
|
GPGZIP="sh ../../tools/gpg-zip --gpg-args --trust-model=always"
|
|
|
|
for TOOL in "$GPGTAR" "$GPGZIP"
|
|
do
|
|
rm -rf -- "${TESTDIR}"
|
|
mkdir "${TESTDIR}"
|
|
|
|
$TOOL --gpg "$GPG" --encrypt --recipient "$usrname2" \
|
|
--output "${TESTDIR}/test.tar.pgp" $TESTFILES
|
|
|
|
$TOOL --gpg "$GPG" --list-archive "${TESTDIR}/test.tar.pgp" >"$FILELIST"
|
|
for F in $TESTFILES
|
|
do
|
|
grep -qe "\\b${F}\\b" "$FILELIST"
|
|
done
|
|
|
|
$TOOL --gpg "$GPG" --tar-args --directory="${TESTDIR}" \
|
|
--decrypt "${TESTDIR}/test.tar.pgp"
|
|
for F in $TESTFILES
|
|
do
|
|
diff -q "$F" "${TESTDIR}/$F"
|
|
done
|
|
done
|
|
|
|
# Success!
|
|
|
|
exit 0
|