Move checksum calculation outside of tree lock.

Additionally, add rudimentary support to adding flags to
compressors, in case you want to pass "-T0" to xz >= 5.1.
diff --git a/kup-server b/kup-server
index 74f719f..a25bdb0 100755
--- a/kup-server
+++ b/kup-server
@@ -616,6 +616,10 @@
 
 	foreach my $e (keys(%zformats)) {
 		my @c = ($zformats{$e}, '-9');
+		if ($zformats{$e} =~ /\s+/) {
+			@c = split(/\s+/, $zformats{$e});
+			push (@c, '-9');
+		}
 
 		sysopen($infds{$e}, $tmpdir.'/data', O_RDONLY) or
 		    fatal("Failed to open uncompressed data file");
@@ -837,6 +841,17 @@
 
 	make_timestamps_match();
 
+	foreach my $e (@install_ext) {
+		if ($e ne '.sign') {
+			# Should we make the digest algo configurable?
+			my $sha = Digest::SHA->new('sha256');
+			print STDERR "\rCalculating sha256 for ".$stem.$e." ";
+			$sha->addfile($tmpdir.'/data'.$e);
+			syslog(LOG_NOTICE, "sha256: %s: %s", $stem.$e, $sha->hexdigest);
+		}
+	}
+	print STDERR "... logged.\n";
+
 	lock_tree();
 
 	foreach my $e (@conflic_ext) {
@@ -862,16 +877,7 @@
 			fatal("$file: Failed to install files: $!");
 		}
 		push(@undoes, $target);
-
-		if ($e ne '.sign') {
-			# Should we make the digest algo configurable?
-			my $sha = Digest::SHA->new('sha256');
-			print STDERR "\rCalculating sha256 for ".$stem.$e;
-			$sha->addfile($target);
-			syslog(LOG_NOTICE, "sha256: %s: %s", $target, $sha->hexdigest);
-		}
 	}
-	print STDERR "...logged.\n";
 
 	unlock_tree();
 	cleanup();