[MacPorts] #51649: gnupg21 @2.1.12_0: selects +pinentry when pinentry-mac is active
MacPorts
noreply at macports.org
Thu Jun 16 18:47:38 PDT 2016
#51649: gnupg21 @2.1.12_0: selects +pinentry when pinentry-mac is active
----------------------+---------------------
Reporter: larryv@… | Owner: jann@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.3.99
Keywords: haspatch | Port: gnupg21
----------------------+---------------------
I am running 10.11, and `pinentry` is not installed. I assume that the
intended behavior on a modern system is to default to `+pinentry_mac`
unless `pinentry` is active and `pinentry-mac` is not. Yet, this is what I
am seeing:
{{{
% sudo port deactivate pinentry-mac
Note: It is not recommended to uninstall/deactivate a port that has
dependents as it breaks the dependents.
The following ports will break: gnupg21 @2.1.13_0
Continue? [y/N]: y
Warning: Deactivate forced. Proceeding despite dependencies.
---> Deactivating pinentry-mac @0.9.4_0
---> Cleaning pinentry-mac
% port variants gnupg21
gnupg21 has the variants:
pinentry: Handle user input via pinentry.
* conflicts with pinentry_mac
[+]pinentry_mac: Handle user input via pinentry-mac. Only compatible with
OS X 10.8+.
* conflicts with pinentry
universal: Build for multiple architectures
% sudo port activate pinentry-mac
---> Activating pinentry-mac @0.9.4_0
---> Cleaning pinentry-mac
---> Some of the ports you installed have notes:
[snip]
% port variants gnupg21
gnupg21 has the variants:
[+]pinentry: Handle user input via pinentry.
* conflicts with pinentry_mac
pinentry_mac: Handle user input via pinentry-mac. Only compatible with
OS X 10.8+.
* conflicts with pinentry
universal: Build for multiple architectures
}}}
I think the portfile logic that determines the presence of `pinentry` and
`pinentry-mac` is incorrect. Remember that Tcl’s `catch` command returns
zero (Tcl “false”) on success and nonzero (“true”) on error—the opposite
of what Tcl conditionals expect. I think this fixes the issue:
{{{
#!patch
diff --git a/dports/mail/gnupg21/Portfile b/dports/mail/gnupg21/Portfile
index e9aa87f..fb55e3a 100644
--- a/dports/mail/gnupg21/Portfile
+++ b/dports/mail/gnupg21/Portfile
@@ -42,8 +42,8 @@ platform darwin {
if {${os.subplatform} ne "macosx" ||
${xcodeversion} eq "none" ||
[vercmp ${xcodeversion} {5.0}] < 0 ||
- ${os.major} < 12 || ([catch {registry_active pinentry}] &&
- ![catch {registry_active pinentry-
mac}])} {
+ ${os.major} < 12 || (![catch {registry_active pinentry}] &&
+ [catch {registry_active pinentry-mac}])}
{
default_variants-append +pinentry
} else {
default_variants-append +pinentry_mac
}}}
{{{
% sudo port deactivate pinentry-mac
Note: It is not recommended to uninstall/deactivate a port that has
dependents as it breaks the dependents.
The following ports will break: gnupg21 @2.1.13_0
Continue? [y/N]: y
Warning: Deactivate forced. Proceeding despite dependencies.
---> Deactivating pinentry-mac @0.9.4_0
---> Cleaning pinentry-mac
% port variants gnupg21
gnupg21 has the variants:
pinentry: Handle user input via pinentry.
* conflicts with pinentry_mac
[+]pinentry_mac: Handle user input via pinentry-mac. Only compatible with
OS X 10.8+.
* conflicts with pinentry
universal: Build for multiple architectures
% sudo port activate pinentry-mac
---> Activating pinentry-mac @0.9.4_0
---> Cleaning pinentry-mac
---> Some of the ports you installed have notes:
[snip]
% port variants gnupg21
gnupg21 has the variants:
pinentry: Handle user input via pinentry.
* conflicts with pinentry_mac
[+]pinentry_mac: Handle user input via pinentry-mac. Only compatible with
OS X 10.8+.
* conflicts with pinentry
universal: Build for multiple architectures
}}}
--
Ticket URL: <https://trac.macports.org/ticket/51649>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list