Browse Source

pass: don't add newline to output. Fixes #3310

Since 5b3f31bf14 fixes the newline being added to termux-clipboard-get, this workaround is no longer required here and actually breaks the comparission.
android-5
Oliver Schmidhauser 6 years ago
committed by Fredrik Fornwall
parent
commit
17ed079607
  1. 1
      packages/pass/build.sh
  2. 18
      packages/pass/src-password-store.sh.patch

1
packages/pass/build.sh

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.passwordstore.org
TERMUX_PKG_DESCRIPTION="Lightweight directory-based password manager" TERMUX_PKG_DESCRIPTION="Lightweight directory-based password manager"
TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=1.7.3 TERMUX_PKG_VERSION=1.7.3
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=2b6c65846ebace9a15a118503dcd31b6440949a30d3b5291dfb5b1615b99a3f4 TERMUX_PKG_SHA256=2b6c65846ebace9a15a118503dcd31b6440949a30d3b5291dfb5b1615b99a3f4
TERMUX_PKG_SRCURL=https://git.zx2c4.com/password-store/snapshot/password-store-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://git.zx2c4.com/password-store/snapshot/password-store-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_BUILD_IN_SRC=yes

18
packages/pass/src-password-store.sh.patch

@ -1,7 +1,8 @@
diff -u -r ../password-store-1.7.3/src/password-store.sh ./src/password-store.sh diff --git a/src/password-store.sh b/src/password-store.sh
--- ../password-store-1.7.3/src/password-store.sh 2018-08-03 03:32:48.000000000 +0000 index 7264ffc..f924de3 100755
+++ ./src/password-store.sh 2018-08-05 20:53:50.490883332 +0000 --- a/src/password-store.sh
@@ -11,7 +11,7 @@ +++ b/src/password-store.sh
@@ -11,7 +11,7 @@ GPG="gpg"
export GPG_TTY="${GPG_TTY:-$(tty 2>/dev/null)}" export GPG_TTY="${GPG_TTY:-$(tty 2>/dev/null)}"
which gpg2 &>/dev/null && GPG="gpg2" which gpg2 &>/dev/null && GPG="gpg2"
[[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" ) [[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" )
@ -10,7 +11,7 @@ diff -u -r ../password-store-1.7.3/src/password-store.sh ./src/password-store.sh
PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
EXTENSIONS="${PASSWORD_STORE_EXTENSIONS_DIR:-$PREFIX/.extensions}" EXTENSIONS="${PASSWORD_STORE_EXTENSIONS_DIR:-$PREFIX/.extensions}"
X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}"
@@ -156,12 +156,13 @@ @@ -156,11 +156,11 @@ clip() {
# trailing new lines. # trailing new lines.
local sleep_argv0="password store sleep on display $DISPLAY" local sleep_argv0="password store sleep on display $DISPLAY"
pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
@ -21,14 +22,11 @@ diff -u -r ../password-store-1.7.3/src/password-store.sh ./src/password-store.sh
( (
( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" )
- local now="$(xclip -o -selection "$X_SELECTION" | $BASE64)" - local now="$(xclip -o -selection "$X_SELECTION" | $BASE64)"
- [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now"
+ local now="$(termux-clipboard-get | $BASE64)" + local now="$(termux-clipboard-get | $BASE64)"
+ #removing -n here, because termux-clipboard-get always returns a newline while xclip does not [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now"
+ [[ $now != $(echo "$1" | $BASE64) ]] && before="$now"
# It might be nice to programatically check to see if klipper exists, # It might be nice to programatically check to see if klipper exists,
# as well as checking for other common clipboard managers. But for now, @@ -172,7 +172,7 @@ clip() {
@@ -172,7 +173,7 @@
# so we axe it here: # so we axe it here:
qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null

Loading…
Cancel
Save