[Pgp-tools-commit] r779 - trunk/caff

Guilhem Moulin guilhem-guest at moszumanska.debian.org
Fri Feb 20 19:36:13 UTC 2015


Author: guilhem-guest
Date: 2015-02-20 19:36:13 +0000 (Fri, 20 Feb 2015)
New Revision: 779

Modified:
   trunk/caff/caff
Log:
caff: Remove check_executable.

We'll get see if gpg(1) is executable when determining the version.

Modified: trunk/caff/caff
===================================================================
--- trunk/caff/caff	2015-02-20 19:36:08 UTC (rev 778)
+++ trunk/caff/caff	2015-02-20 19:36:13 UTC (rev 779)
@@ -549,22 +549,6 @@
 	return $template;
 };
 
-sub check_executable($$) {
-	# (GnuPG::Interface gives lousy errors when the gpg binary isn't found,
-	# so we want to check manually.)
-	my ($purpose, $fn) = @_;
-	# Only check provided fnames with a slash in them.
-	return unless defined $fn;
-	if ($fn =~ m!/!) {
-		myerror(1, "$0: $purpose executable '$fn' not found.") unless -x $fn;
-	} else {
-		for my $p (split(':', $ENV{PATH})) {
-			return if -x "$p/$fn";
-		};
-		myerror(1, "$0: $purpose executable '$fn' not found on path.") unless -x $fn;
-	};
-};
-
 sub load_config() {
 	my $config = $ENV{'HOME'} . '/.caffrc';
 	unless (-f $config) {
@@ -599,7 +583,6 @@
 	$CONFIG{'gpg'} //= $ENV{GNUPGBIN} // 'gpg';
 	mywarn("deprecated option \$CONFIG{'$_'} = '$CONFIG{$_}'") for grep {defined $CONFIG{$_}} qw/gpg-sign gpg-delsig/;
 
-	check_executable('gpg', $CONFIG{gpg});
 	$CONFIG{'secret-keyring'} //= ($ENV{'GNUPGHOME'} || "$ENV{'HOME'}/.gnupg") . '/secring.gpg';
 	$CONFIG{'no-download'} //= 0;
 	$CONFIG{'no-sign'} //= 0;
@@ -1342,7 +1325,7 @@
 };
 
 
-$GNUPG_VERSION = `$CONFIG{'gpg'} --with-colons --list-config version`;
+$GNUPG_VERSION = `$CONFIG{'gpg'} --with-colons --list-config version` or exit 1;
 chomp $GNUPG_VERSION;
 $GNUPG_VERSION =~ s/^cfg:version:(\d+\.\d+).*/$1/;
 debug "gpg (GnuPG) $GNUPG_VERSION";




More information about the Pgp-tools-commit mailing list