diff options
| author | cashmere <cashmere@autistici.org> | 2026-07-25 12:43:49 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-07-25 12:43:49 +0200 |
| commit | 110120f3c39c7849035d3c5fd4817459e5a85f21 (patch) | |
| tree | 6c1ff81b704f2f31a57f6bd70066fff4ea1ec706 | |
| parent | 508825b0bae16d88b521bd87dcd96823d8736724 (diff) | |
| download | ports-110120f3c39c7849035d3c5fd4817459e5a85f21.tar.gz | |
patch pinentry-emacs
| -rw-r--r-- | security/pinentry-emacs/Makefile | 5 | ||||
| -rw-r--r-- | security/pinentry-emacs/files/patch-pinentry-emacs | 24 |
2 files changed, 22 insertions, 7 deletions
diff --git a/security/pinentry-emacs/Makefile b/security/pinentry-emacs/Makefile index e9b4f2d..2563d75 100644 --- a/security/pinentry-emacs/Makefile +++ b/security/pinentry-emacs/Makefile @@ -1,5 +1,6 @@ PORTNAME= pinentry-emacs DISTVERSION= g20171127 +PORTREVISION= 1 CATEGORIES= security MAINTAINER= cashmere@autistici.org @@ -22,10 +23,6 @@ NO_BUILD= yes PLIST_FILES= bin/pinentry-emacs -post-patch: - @${REINPLACE_CMD} -e '1s|/bin/bash|${LOCALBASE}/bin/bash|' \ - ${WRKSRC}/pinentry-emacs - do-install: ${INSTALL_SCRIPT} ${WRKSRC}/pinentry-emacs ${STAGEDIR}${PREFIX}/bin/pinentry-emacs diff --git a/security/pinentry-emacs/files/patch-pinentry-emacs b/security/pinentry-emacs/files/patch-pinentry-emacs index 923dec5..b17ba53 100644 --- a/security/pinentry-emacs/files/patch-pinentry-emacs +++ b/security/pinentry-emacs/files/patch-pinentry-emacs @@ -1,7 +1,25 @@ ---- pinentry-emacs.orig 2026-07-11 14:01:00 UTC +--- pinentry-emacs.orig 2017-11-27 09:56:54 UTC +++ pinentry-emacs -@@ -31,7 +31,8 @@ - RES=$(emacsclient -e "(pinentry-emacs \"$DESC\" \"$PROMPT\" \"$OK\" \"$ERROR\")" | sed -e 's/^"//' -e 's/"$//') +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/usr/local/bin/bash + set -o pipefail + echo OK + while read cmd rest +@@ -28,10 +28,19 @@ do + ;; + GETPIN) + +- RES=$(emacsclient -e "(pinentry-emacs \"$DESC\" \"$PROMPT\" \"$OK\" \"$ERROR\")" | sed -e 's/^"//' -e 's/"$//') ++ # Resolve the Emacs server socket the way emacsclient does ++ # ($EMACS_SOCKET_NAME, then $XDG_RUNTIME_DIR/emacs/server), but ++ # fall back to $HOME/.run/emacs/server when gpg-agent was started ++ # with a different XDG_RUNTIME_DIR than the Emacs daemon. ++ SOCKET="${EMACS_SOCKET_NAME:-${XDG_RUNTIME_DIR:+$XDG_RUNTIME_DIR/emacs/server}}" ++ if [ -n "$SOCKET" ] && [ ! -S "$SOCKET" ] && [ -S "$HOME/.run/emacs/server" ]; then ++ SOCKET="$HOME/.run/emacs/server" ++ fi ++ RES=$(emacsclient ${SOCKET:+--socket-name="$SOCKET"} -e "(pinentry-emacs \"$DESC\" \"$PROMPT\" \"$OK\" \"$ERROR\")" | sed -e 's/^"//' -e 's/"$//') if [ $? -ne 0 ] then - RES=$(lukspinentry) |
