From 3dabb507e66cd235189e39ba5d080c7e06167285 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Wed, 24 Aug 2016 16:13:33 +0200 Subject: [PATCH] btrbk: do not set "--compress-algo none" on gpg command if raw_target_compress=no Note that gpg might still compress (according to OpenPGP standard) if --compress-algo is not set. This is generally a good thing. --- btrbk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btrbk b/btrbk index 77d48c1..b481305 100755 --- a/btrbk +++ b/btrbk @@ -1268,7 +1268,8 @@ sub btrfs_send_to_file($$$$;@) if($opts{encrypt}) { die unless($opts{encrypt}->{type} eq "gpg"); $target_filename .= '.gpg'; - my @gpg_options = ( '--batch', '--no-tty', '--trust-model', 'always', '--compress-algo', 'none' ); + my @gpg_options = ( '--batch', '--no-tty', '--trust-model', 'always' ); + push @gpg_options, ( '--compress-algo', 'none' ) if($opts{compress}); # NOTE: if --compress-algo is not set, gpg might still compress according to OpenPGP standard. push(@gpg_options, ( '--no-default-keyring', '--keyring', $opts{encrypt}->{keyring} )) if($opts{encrypt}->{keyring}); push(@gpg_options, ( '--default-recipient', $opts{encrypt}->{recipient} )) if($opts{encrypt}->{recipient}); push @cmd_pipe, {