Oliver Schmidhauser
8 years ago
committed by
Fredrik Fornwall
2 changed files with 19 additions and 35 deletions
@ -1,8 +1,9 @@ |
|||||
TERMUX_PKG_HOMEPAGE=https://www.passwordstore.org/ |
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_VERSION=1.6.5 |
TERMUX_PKG_VERSION=1.7 |
||||
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 |
||||
TERMUX_PKG_DEPENDS="bash, coreutils, gnupg, pwgen, tree" |
TERMUX_PKG_DEPENDS="bash, gnupg, pwgen, tree" |
||||
TERMUX_PKG_PLATFORM_INDEPENDENT=yes |
TERMUX_PKG_PLATFORM_INDEPENDENT=yes |
||||
TERMUX_PKG_EXTRA_MAKE_ARGS="PREFIX=$TERMUX_PREFIX" |
TERMUX_PKG_EXTRA_MAKE_ARGS="PREFIX=$TERMUX_PREFIX" |
||||
|
TERMUX_PKG_SHA256=161ac3bd3c452a97f134aa7aa4668fe3f2401c839fd23c10e16b8c0ae4e15500 |
||||
|
@ -1,57 +1,40 @@ |
|||||
--- ../password-store-master/src/password-store.sh 2016-02-07 12:05:52.000000000 +0100
|
diff --git a/src/password-store.sh b/src/password-store.sh
|
||||
+++ ./src/password-store.sh 2016-03-07 21:29:27.667761280 +0100
|
index 1ab6fb5..912b8b1 100755
|
||||
@@ -1,4 +1,4 @@
|
--- a/src/password-store.sh
|
||||
-#!/usr/bin/env bash
|
+++ b/src/password-store.sh
|
||||
+#!/data/data/com.termux/files/usr/bin/env bash
|
@@ -11,7 +11,7 @@ GPG="gpg"
|
||||
|
export GPG_TTY="${GPG_TTY:-$(tty 2>/dev/null)}" |
||||
# Copyright (C) 2012 - 2014 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. |
|
||||
# This file is licensed under the GPLv2+. Please see COPYING for more information. |
|
||||
@@ -12,7 +12,9 @@
|
|
||||
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" ) |
||||
|
-
|
||||
+TERMUXPREFIX=$PREFIX
|
+TMPDIR=$PREFIX/tmp
|
||||
PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" |
PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" |
||||
+
|
EXTENSIONS="${PASSWORD_STORE_EXTENSIONS_DIR:-$PREFIX/.extensions}" |
||||
X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" |
X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" |
||||
CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}" |
@@ -156,12 +156,13 @@ clip() {
|
||||
GENERATED_LENGTH="${PASSWORD_STORE_GENERATED_LENGTH:-25}" |
|
||||
@@ -133,13 +135,13 @@
|
|
||||
# variable. Specifically, it cannot store nulls nor (non-trivally) store |
|
||||
# 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 |
||||
- local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)"
|
- local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)"
|
||||
- echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard"
|
- echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard"
|
||||
+ pgrep -f "^$sleep_argv0" | xargs kill 2>/dev/null && sleep 0.5
|
|
||||
+ local before="$(termux-clipboard-get 2>/dev/null | base64)"
|
+ local before="$(termux-clipboard-get 2>/dev/null | base64)"
|
||||
+ echo -n "$1" | termux-clipboard-set || die "Error: Could not copy data to the clipboard"
|
+ echo -n "$1" | termux-clipboard-set || die "Error: Could not copy data to the clipboard"
|
||||
( |
( |
||||
- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
|
( 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"
|
- [[ $now != $(echo -n "$1" | base64) ]] && before="$now"
|
||||
+ ( exec -a "$sleep_argv0" coreutils --coreutils-prog=sleep "$CLIP_TIME" )
|
+ 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 "$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, |
# as well as checking for other common clipboard managers. But for now, |
||||
@@ -150,7 +152,7 @@
|
@@ -172,7 +173,7 @@ clip() {
|
||||
# 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 |
||||
|
|
||||
- echo "$before" | base64 -d | xclip -selection "$X_SELECTION"
|
- echo "$before" | base64 -d | xclip -selection "$X_SELECTION"
|
||||
+ echo "$before" | base64 -d| termux-clipboard-set
|
+ echo "$before" | base64 -d | termux-clipboard-set
|
||||
) 2>/dev/null & disown |
) 2>/dev/null & disown |
||||
echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." |
echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." |
||||
} |
} |
||||
@@ -174,7 +176,8 @@
|
|
||||
Are you sure you would like to continue? |
|
||||
_EOF |
|
||||
)" |
|
||||
- SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/$template")"
|
|
||||
+ echo "mktemp -d ${TMPDIR:-$TERMUXPREFIX/tmp}/$template"
|
|
||||
+ SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-$TERMUXPREFIX/tmp}/$template")"
|
|
||||
shred_tmpfile() { |
|
||||
find "$SECURE_TMPDIR" -type f -exec $SHRED {} + |
|
||||
rm -rf "$SECURE_TMPDIR" |
|
Loading…
Reference in new issue