mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
69a8440f44
* tools/gpgtar-create.c (gpgtar_create): Use given arguments. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (enum cmd_and_opt_values): New value. (opts): Add 'gpg-args'. (parse_arguments): Handle arguments. * tools/gpgtar.h (opt): Add field 'gpg_arguments'. * tests/openpgp/gpgtar.test: Simplify accordingly. Signed-off-by: Justus Winter <justus@g10code.com>
62 lines
1.1 KiB
Bash
Executable File
62 lines
1.1 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
|
|
GPGARGS="--trust-model=always"
|
|
|
|
GPGTAR="../../tools/gpgtar"
|
|
GPGZIP="sh ../../tools/gpg-zip"
|
|
|
|
for TOOL in "$GPGTAR" "$GPGZIP"
|
|
do
|
|
rm -rf -- "${TESTDIR}"
|
|
mkdir "${TESTDIR}"
|
|
|
|
$TOOL --gpg "$GPG" --gpg-args "$GPGARGS" \
|
|
--encrypt --recipient "$usrname2" \
|
|
--output "${TESTDIR}/test.tar.pgp" $TESTFILES
|
|
|
|
$TOOL --gpg "$GPG" --gpg-args "$GPGARGS" \
|
|
--list-archive "${TESTDIR}/test.tar.pgp" \
|
|
>"$FILELIST"
|
|
for F in $TESTFILES
|
|
do
|
|
grep -qe "\\b${F}\\b" "$FILELIST"
|
|
done
|
|
|
|
$TOOL --gpg "$GPG" --gpg-args "$GPGARGS" \
|
|
--tar-args --directory="${TESTDIR}" \
|
|
--decrypt "${TESTDIR}/test.tar.pgp"
|
|
for F in $TESTFILES
|
|
do
|
|
diff -q "$F" "${TESTDIR}/$F"
|
|
done
|
|
done
|
|
|
|
# Success!
|
|
|
|
exit 0
|