diff --git a/0001-Default-to-xclip-if-wl-clip-is-not-found.patch b/0001-Default-to-xclip-if-wl-clip-is-not-found.patch new file mode 100644 index 0000000..025742f --- /dev/null +++ b/0001-Default-to-xclip-if-wl-clip-is-not-found.patch @@ -0,0 +1,43 @@ +From 85bb62f47ac2f518bfdb36c5dfedf5938219a9b7 Mon Sep 17 00:00:00 2001 +From: Santiago Zarate +Date: Thu, 23 Sep 2021 14:45:43 +0200 +Subject: [PATCH] Default to xclip if wl-clip is not found + +In the strange case that the user is jumping back and forth from X11 to +Wayland and viceversa, xclip might be installed but wl-clip might not, +and in such combination user might end up with the -c opion not working. +--- + src/password-store.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/password-store.sh b/src/password-store.sh +index a0dcf2e..7c6ea35 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -155,7 +155,7 @@ check_sneaky_paths() { + # + + clip() { +- if [[ -n $WAYLAND_DISPLAY ]]; then ++ if [[ -n $WAYLAND_DISPLAY ]] && command -v wl-copy > /dev/null; then + local copy_cmd=( wl-copy ) + local paste_cmd=( wl-paste -n ) + if [[ $X_SELECTION == primary ]]; then +@@ -163,12 +163,12 @@ clip() { + paste_cmd+=( --primary ) + fi + local display_name="$WAYLAND_DISPLAY" +- elif [[ -n $DISPLAY ]]; then ++ elif [[ -n $DISPLAY ]] && command -v xclip > /dev/null; then + local copy_cmd=( xclip -selection "$X_SELECTION" ) + local paste_cmd=( xclip -o -selection "$X_SELECTION" ) + local display_name="$DISPLAY" + else +- die "Error: No X11 or Wayland display detected" ++ die "Error: No X11 or Wayland display and clipper detected" + fi + local sleep_argv0="password store sleep on display $display_name" + +-- +2.31.1 + diff --git a/pass.spec b/pass.spec index a6a5243..35ae38e 100644 --- a/pass.spec +++ b/pass.spec @@ -6,19 +6,20 @@ Name: pass Summary: A password manager using standard Unix tools Version: 1.7.4 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ Url: http://zx2c4.com/projects/password-store/ BuildArch: noarch Source: http://git.zx2c4.com/password-store/snapshot/password-store-%{version}.tar.xz +Patch: 0001-Default-to-xclip-if-wl-clip-is-not-found.patch BuildRequires: make BuildRequires: git-core BuildRequires: gnupg2 BuildRequires: perl-generators BuildRequires: tree >= 1.7.0 -Requires: (wl-clipboard if libwayland-client else xclip) -Requires: (xclip if xorg-x11-server-Xorg else wl-clipboard) +Recommends: (wl-clipboard if libwayland-client else xclip) +Recommends: (xclip if xorg-x11-server-Xorg else wl-clipboard) Requires: git-core Requires: gnupg2 Requires: qrencode @@ -44,7 +45,7 @@ clipboard. %endif %prep -%setup -q -n password-store-%{version} +%autosetup -p 1 -n password-store-%{version} rm -f contrib/emacs/.gitignore %install @@ -80,6 +81,11 @@ make test %endif %changelog +* Mon Aug 22 2022 Peter Georg - 1.7.4-6 +- Set wl-copy/xclip requires to recommends + Resolves: rhbz#2022909 +- Cherry-pick upstream commit handling wl-copy/xclip selection + * Fri Jul 22 2022 Fedora Release Engineering - 1.7.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild