aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-01-16 17:36:24 +0100
committerMarius Bakke <marius@gnu.org>2022-01-17 18:23:13 +0100
commit5da4cbfbd94163f87f188355e5490f04dd6864c2 (patch)
treed8e3a749ff23ff301b3789d36b86a52abf98a804
parentd54c31923da62660807cb8c5722c85bb73780cae (diff)
downloadguix-5da4cbfbd94163f87f188355e5490f04dd6864c2.tar.gz
guix-5da4cbfbd94163f87f188355e5490f04dd6864c2.zip
gnu: password-store: Ensure compatibility with tree@2.0.
Fixes <https://bugs.gnu.org/53238>, et.al. * gnu/packages/patches/password-store-tree-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/password-utils.scm (password-store)[source](patches): New field.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/password-utils.scm1
-rw-r--r--gnu/packages/patches/password-store-tree-compat.patch29
3 files changed, 31 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 7e044d4a2b..a8f5c8afa1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1587,6 +1587,7 @@ dist_patch_DATA = \
%D%/packages/patches/pam-krb5-CVE-2020-10595.patch \
%D%/packages/patches/pango-skip-libthai-test.patch \
%D%/packages/patches/passwordsafe-meson-remove-extra-argument.patch \
+ %D%/packages/patches/password-store-tree-compat.patch \
%D%/packages/patches/pciutils-hurd-configure.patch \
%D%/packages/patches/pciutils-hurd-fix.patch \
%D%/packages/patches/pitivi-fix-build-with-meson-0.60.patch \
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index f56868439e..de7302618e 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -484,6 +484,7 @@ any X11 window.")
(sha256
(base32
"17zp9pnb3i9sd2zn9qanngmsywrb7y495ngcqs6313pv3gb83v53"))
+ (patches (search-patches "password-store-tree-compat.patch"))
(file-name (git-file-name name version))))
(build-system gnu-build-system)
(arguments
diff --git a/gnu/packages/patches/password-store-tree-compat.patch b/gnu/packages/patches/password-store-tree-compat.patch
new file mode 100644
index 0000000000..ce8de8f27c
--- /dev/null
+++ b/gnu/packages/patches/password-store-tree-compat.patch
@@ -0,0 +1,29 @@
+Tree 2.0 and later will unconditionally ignore all options and write
+JSON data on file descriptor 3 when available, which causes problems
+for the test harness and other scripts that use FD 3. Work around by
+closing descriptor 3 for the 'tree' command.
+
+Taken from upstream:
+ https://git.zx2c4.com/password-store/commit/?id=eea24967a002a2a81ae9b97a1fe972b5287f3a09
+
+diff --git a/src/password-store.sh b/src/password-store.sh
+--- a/src/password-store.sh
++++ b/src/password-store.sh
+@@ -402,7 +402,7 @@ cmd_show() {
+ else
+ echo "${path%\/}"
+ fi
+- tree -N -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
++ tree -N -C -l --noreport "$PREFIX/$path" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
+ elif [[ -z $path ]]; then
+ die "Error: password store is empty. Try \"pass init\"."
+ else
+@@ -414,7 +414,7 @@ cmd_find() {
+ [[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
+ IFS="," eval 'echo "Search Terms: $*"'
+ local terms="*$(printf '%s*|*' "$@")"
+- tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
++ tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
+ }
+
+ cmd_grep() {