Still trying to resolve the mystery of GPG in travis

This commit is contained in:
deajan 2016-09-04 22:34:42 +02:00
parent c6f386bf01
commit 8924ae31ff
1 changed files with 13 additions and 6 deletions

View File

@ -1028,6 +1028,7 @@ function DecryptFiles {
__CheckArguments 3 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG __CheckArguments 3 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
local options
local secret local secret
local successCounter=0 local successCounter=0
local errorCounter=0 local errorCounter=0
@ -1039,12 +1040,12 @@ function DecryptFiles {
fi fi
#TODO: ugly fix : gpg 1.4.x fails with passphrase-file but not with passphrase (error is: can't query passphrase in batch mode) #TODO: ugly fix : gpg 1.4.x fails with passphrase-file but not with passphrase (error is: can't query passphrase in batch mode)
if [ "$CRYPT_TOOL" == "gpg2" ] && [ -f "$passphraseFile" ]; then #if [ "$CRYPT_TOOL" == "gpg2" ] && [ -f "$passphraseFile" ]; then
secret="--passphrase-file $passphraseFile"
elif [ "$CRYPT_TOOL" == "gpg" ] && [ -f "$passphraseFile" ]; then
secret="$$passphrase $(cat "$passphraseFile")"
#if [ -f "$passphraseFile" ]; then
# secret="--passphrase-file $passphraseFile" # secret="--passphrase-file $passphraseFile"
#elif [ "$CRYPT_TOOL" == "gpg" ] && [ -f "$passphraseFile" ]; then
# secret="$$passphrase $(cat "$passphraseFile")"
if [ -f "$passphraseFile" ]; then
secret="--passphrase-file $passphraseFile"
elif [ "$passphrase" != "" ]; then elif [ "$passphrase" != "" ]; then
secret="--passphrase $passphrase" secret="--passphrase $passphrase"
else else
@ -1052,11 +1053,17 @@ function DecryptFiles {
exit 1 exit 1
fi fi
if [ "$CRYPT_TOOL" == "gpg2" ]; then
options="--batch --yes"
elif [ "$CRYPT_TOOL" == "gpg" ]; then
options="--no-use-agent --batch"
fi
while IFS= read -r -d $'\0' encryptedFile; do while IFS= read -r -d $'\0' encryptedFile; do
Logger "Decrypting [$encryptedFile]." "VERBOSE" Logger "Decrypting [$encryptedFile]." "VERBOSE"
#$CRYPT_TOOL --out "${encryptedFile%%$cryptFileExtension}" --batch --yes $secret --decrypt "$encryptedFile" > "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID" 2>&1 #$CRYPT_TOOL --out "${encryptedFile%%$cryptFileExtension}" --batch --yes $secret --decrypt "$encryptedFile" > "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID" 2>&1
#WIP trying to resolve travis GPG mystery #WIP trying to resolve travis GPG mystery
$CRYPT_TOOL --out "${encryptedFile%%$cryptFileExtension}" --batch --yes $secret --decrypt "$encryptedFile" $CRYPT_TOOL $options --out "${encryptedFile%%$cryptFileExtension}" $secret --decrypt "$encryptedFile"
if [ $? != 0 ]; then if [ $? != 0 ]; then
Logger "Cannot decrypt [$encryptedFile]." "ERROR" Logger "Cannot decrypt [$encryptedFile]." "ERROR"
Logger "Command output\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID)" "DEBUG" Logger "Command output\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID)" "DEBUG"