diff options
author | milki <milki@FreeBSD.org> | 2014-05-24 12:51:14 +0800 |
---|---|---|
committer | milki <milki@FreeBSD.org> | 2014-05-24 12:51:14 +0800 |
commit | 8a2ae37f3dd4706379496501e072caad773d0842 (patch) | |
tree | 691adfc18b7952399b443c1498d47d848bafe620 /sysutils | |
parent | 85fe80c51840bb0677398d61d1a1a67ddde478ca (diff) | |
download | freebsd-ports-gnome-8a2ae37f3dd4706379496501e072caad773d0842.tar.gz freebsd-ports-gnome-8a2ae37f3dd4706379496501e072caad773d0842.tar.zst freebsd-ports-gnome-8a2ae37f3dd4706379496501e072caad773d0842.zip |
Update to 1.6.2
- Add missing dep on misc/getopt
- Patches updated against 1.6.2
- New contrib option for import scripts, shell completions, etc
Approved by: swills (mentor)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/password-store/Makefile | 57 | ||||
-rw-r--r-- | sysutils/password-store/distinfo | 4 | ||||
-rw-r--r-- | sysutils/password-store/files/git+xclip.patch | 697 | ||||
-rw-r--r-- | sysutils/password-store/files/git.patch | 468 | ||||
-rw-r--r-- | sysutils/password-store/files/linuxism+git+xclip.patch | 605 | ||||
-rw-r--r-- | sysutils/password-store/files/linuxism+git.patch | 383 | ||||
-rw-r--r-- | sysutils/password-store/files/linuxism+xclip.patch | 321 | ||||
-rw-r--r-- | sysutils/password-store/files/linuxism.patch | 40 | ||||
-rw-r--r-- | sysutils/password-store/files/xclip.patch | 303 | ||||
-rw-r--r-- | sysutils/password-store/pkg-plist | 29 |
10 files changed, 1526 insertions, 1381 deletions
diff --git a/sysutils/password-store/Makefile b/sysutils/password-store/Makefile index 8e4fc5dedd59..da02976b5921 100644 --- a/sysutils/password-store/Makefile +++ b/sysutils/password-store/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= password-store -PORTVERSION= 1.4.2 +PORTVERSION= 1.6.2 CATEGORIES= sysutils MASTER_SITES= http://git.zx2c4.com/password-store/snapshot/ @@ -13,14 +13,15 @@ LICENSE= GPLv2 RUN_DEPENDS= bash>=0:${PORTSDIR}/shells/bash \ gnupg>=2:${PORTSDIR}/security/gnupg \ pwgen>=0:${PORTSDIR}/sysutils/pwgen \ - tree>=0:${PORTSDIR}/sysutils/tree + tree>=1.7:${PORTSDIR}/sysutils/tree -OPTIONS_DEFINE= GIT XCLIP +OPTIONS_DEFINE= GIT XCLIP CONTRIB +OPTIONS_SUB= yes GIT_DESC= Enable git storage XCLIP_DESC= Enable xclip feature +CONTRIB_DESC= Include shell completions, import scripts, related projects -NO_STAGE= yes .include <bsd.port.options.mk> .if ${PORT_OPTIONS:MGIT} @@ -32,38 +33,34 @@ RUN_DEPENDS+= base64>=0:${PORTSDIR}/converters/base64 \ xclip>=0:${PORTSDIR}/x11/xclip .endif -do-patch: -.if empty(PORT_OPTIONS:MGIT) && empty(PORT_OPTIONS:MXCLIP) - (cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/linuxism+git+xclip.patch) -.elif empty(PORT_OPTIONS:MGIT) - (cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/linuxism+git.patch) -.elif empty(PORT_OPTIONS:MXCLIP) - (cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/linuxism+xclip.patch) -.else - (cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/linuxism.patch) +.if ! ${PORT_OPTIONS:MGIT} && ! ${PORT_OPTIONS:MXCLIP} +EXTRA_PATCHES= ${PATCHDIR}/git+xclip.patch:-p1 +.elif ! ${PORT_OPTIONS:MGIT} +EXTRA_PATCHES= ${PATCHDIR}/git.patch:-p1 +.elif ! ${PORT_OPTIONS:MXCLIP} +EXTRA_PATCHES= ${PATCHDIR}/xclip.patch:-p1 .endif +post-patch: + @${REINPLACE_CMD} -Ee 's|GETOPT="getopt"|GETOPT="${LOCALBASE}/bin/getopt"|' ${WRKSRC}/src/password-store.sh + @${REINPLACE_CMD} -Ee 's|SHRED="shred -f -z"|SHRED="rm -P -f"|' ${WRKSRC}/src/password-store.sh + # empty to skip make do-build: do-install: - ${INSTALL_SCRIPT} ${WRKSRC}/src/password-store.sh ${PREFIX}/libexec/pass - @${LN} -s ${PREFIX}/libexec/pass ${PREFIX}/bin/pass - - @${MKDIR} ${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/contrib/pass.bash-completion ${DATADIR}/ - ${INSTALL_DATA} ${WRKSRC}/contrib/pass.zsh-completion ${DATADIR}/ - ${INSTALL_DATA} ${WRKSRC}/contrib/pass.fish-completion ${DATADIR}/ - ${INSTALL_DATA} ${WRKSRC}/man/pass.1 ${MANPREFIX}/man/man1/pass.1 - -MAN1= pass.1 -MANCOMPRESSED= no + @${INSTALL_SCRIPT} ${WRKSRC}/src/password-store.sh ${STAGEDIR}${PREFIX}/libexec/pass + @${LN} -s ${PREFIX}/libexec/pass ${STAGEDIR}${PREFIX}/bin/pass -PLIST_FILES= bin/pass \ - libexec/pass \ - share/password-store/pass.bash-completion \ - share/password-store/pass.zsh-completion \ - share/password-store/pass.fish-completion -PLIST_DIRS= share/password-store +.if ${PORT_OPTIONS:MCONTRIB} + @${MKDIR} ${STAGEDIR}${DATADIR} + @(cd ${WRKSRC}/contrib && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}) + @(cd ${WRKSRC}/src/completion && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}) +.endif +.if ${PORT_OPTIONS:MDOCS} + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + @${INSTALL_MAN} ${WRKSRC}/man/example-filter.sh ${STAGEDIR}${EXAMPLESDIR} + @${INSTALL_MAN} ${WRKSRC}/man/pass.1 ${STAGEDIR}${MANPREFIX}/man/man1/pass.1 +.endif .include <bsd.port.mk> diff --git a/sysutils/password-store/distinfo b/sysutils/password-store/distinfo index a1813ec56ae9..8b21b8fc9871 100644 --- a/sysutils/password-store/distinfo +++ b/sysutils/password-store/distinfo @@ -1,2 +1,2 @@ -SHA256 (password-store-1.4.2.tar.gz) = 6db19c42407562694220ab4aec4f9b306f493fbb06f9d37b8aa8bd6190aa4de1 -SIZE (password-store-1.4.2.tar.gz) = 21022 +SHA256 (password-store-1.6.2.tar.gz) = 6c3d4681a3df2c6f0ed5b476c82be7c70c44fecbf6c9550a1a7d736a71489590 +SIZE (password-store-1.6.2.tar.gz) = 59220 diff --git a/sysutils/password-store/files/git+xclip.patch b/sysutils/password-store/files/git+xclip.patch new file mode 100644 index 000000000000..83c67543a1c4 --- /dev/null +++ b/sysutils/password-store/files/git+xclip.patch @@ -0,0 +1,697 @@ +diff --git a/README b/README +index 8bee02a..3557b0d 100644 +--- a/README ++++ b/README +@@ -17,10 +17,6 @@ Depends on: + http://www.gnu.org/software/bash/ + - GnuPG2 + http://www.gnupg.org/ +-- git +- http://www.git-scm.com/ +-- xclip +- http://sourceforge.net/projects/xclip/ + - pwgen + http://sourceforge.net/projects/pwgen/ + - tree >= 1.7.0 +diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el +index 1863185..e0556fd 100644 +--- a/contrib/emacs/password-store.el ++++ b/contrib/emacs/password-store.el +@@ -109,10 +109,6 @@ outputs error message on failure." + entry + new-entry)) + +-(defun password-store--run-git (&rest args) +- (apply 'password-store--run "git" +- args)) +- + (defun password-store--run-version () + (password-store--run "version")) + +diff --git a/man/pass.1 b/man/pass.1 +index 42d9aec..c101742 100644 +--- a/man/pass.1 ++++ b/man/pass.1 +@@ -33,13 +33,6 @@ or + depending on the type of specifier in ARGS. Otherwise COMMAND must be one of + the valid commands listed below. + +-Several of the commands below rely on or provide additional functionality if +-the password store directory is also a git repository. If the password store +-directory is a git repository, all password store modification commands will +-cause a corresponding git commit. See the \fIEXTENDED GIT EXAMPLE\fP section +-for a detailed description using \fBinit\fP and +-.BR git (1). +- + The \fBinit\fP command must be run before other commands in order to initialize + the password store with the correct gpg key id. Passwords are encrypting using + the gpg key set with \fBinit\fP. +@@ -86,12 +79,8 @@ List names of passwords inside the tree that match \fIpass-names\fP by using the + .BR tree (1) + program. This command is alternatively named \fBsearch\fP. + .TP +-\fBshow\fP [ \fI--clip\fP, \fI-c\fP ] \fIpass-name\fP +-Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP +-is specified, do not print the password but instead copy the first line to the +-clipboard using +-.BR xclip (1) +-and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. ++\fBshow\fP \fIpass-name\fP ++Decrypt and print a password named \fIpass-name\fP. + .TP + \fBinsert\fP [ \fI--echo\fP, \fI-e\fP | \fI--multiline\fP, \fI-m\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP + Insert a new password into the password store called \fIpass-name\fP. This will +@@ -110,15 +99,11 @@ ensure that temporary files are created in \fI/dev/shm\fP in order to avoid writ + difficult-to-erase disk sectors. If \fI/dev/shm\fP is not accessible, fallback to + the ordinary \fITMPDIR\fP location, and print a warning. + .TP +-\fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--clip\fP, \fI-c\fP ] [ \fI--in-place\fP, \fI-i\fP | \fI--force\fP, \fI-f\fP ] \fIpass-name pass-length\fP ++\fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--in-place\fP, \fI-i\fP | \fI--force\fP, \fI-f\fP ] \fIpass-name pass-length\fP + Generate a new password using + .BR pwgen (1) + of length \fIpass-length\fP and insert into \fIpass-name\fP. If \fI--no-symbols\fP or \fI-n\fP + is specified, do not use any non-alphanumeric characters in the generated password. +-If \fI--clip\fP or \fI-c\fP is specified, do not print the password but instead copy +-it to the clipboard using +-.BR xclip (1) +-and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. + Prompt before overwriting an existing password, + unless \fI--force\fP or \fI-f\fP is specified. If \fI--in-place\fP or \fI-i\fP is + specified, do not interactively prompt, and only replace the first line of the password +@@ -144,16 +129,6 @@ silently overwrite \fInew-path\fP if it exists. If \fInew-path\fP ends in a + trailing \fI/\fP, it is always treated as a directory. Passwords are selectively + reencrypted to the corresponding keys of their new destination. + .TP +-\fBgit\fP \fIgit-command-args\fP... +-If the password store is a git repository, pass \fIgit-command-args\fP as arguments to +-.BR git (1) +-using the password store as the git repository. If \fIgit-command-args\fP is \fBinit\fP, +-in addition to initializing the git repository, add the current contents of the password +-store to the repository in an initial commit. If the git config key \fIpass.signcommits\fP +-is set to \fItrue\fP, then all commits will be signed using \fIuser.signingkey\fP or the +-default git signing key. This config key may be turned on using: +-.B `pass git config --bool --add pass.signcommits true` +-.TP + \fBhelp\fP + Show usage message. + .TP +@@ -223,11 +198,6 @@ Show existing password + .br + sup3rh4x3rizmynam3 + .TP +-Copy existing password to clipboard +-.B zx2c4@laptop ~ $ pass -c Email/zx2c4.com +-.br +-Copied Email/jason@zx2c4.com to clipboard. Will clear in 45 seconds. +-.TP + Add password to store + .B zx2c4@laptop ~ $ pass insert Business/cheese-whiz-factory + .br +@@ -266,10 +236,8 @@ The generated password to Email/jasondonenfeld.com is: + .br + YqFsMkBeO6di + .TP +-Generate new password and copy it to the clipboard +-.B zx2c4@laptop ~ $ pass generate -c Email/jasondonenfeld.com 19 +-.br +-Copied Email/jasondonenfeld.com to clipboard. Will clear in 45 seconds. ++Generate new password ++.B zx2c4@laptop ~ $ pass generate Email/jasondonenfeld.com 19 + .TP + Remove password from store + .B zx2c4@laptop ~ $ pass remove Business/cheese-whiz-factory +@@ -278,99 +246,6 @@ rm: remove regular file \[u2018]/home/zx2c4/.password-store/Business/cheese-whiz + .br + removed \[u2018]/home/zx2c4/.password-store/Business/cheese-whiz-factory.gpg\[u2019] + +-.SH EXTENDED GIT EXAMPLE +-Here, we initialize new password store, create a git repository, and then manipulate and sync passwords. Make note of the arguments to the first call of \fBpass git push\fP; consult +-.BR git-push (1) +-for more information. +- +-.B zx2c4@laptop ~ $ pass init Jason@zx2c4.com +-.br +-mkdir: created directory \[u2018]/home/zx2c4/.password-store\[u2019] +-.br +-Password store initialized for Jason@zx2c4.com. +- +-.B zx2c4@laptop ~ $ pass git init +-.br +-Initialized empty Git repository in /home/zx2c4/.password-store/.git/ +-.br +-[master (root-commit) 998c8fd] Added current contents of password store. +-.br +- 1 file changed, 1 insertion(+) +-.br +- create mode 100644 .gpg-id +- +-.B zx2c4@laptop ~ $ pass git remote add origin kexec.com:pass-store +- +-.B zx2c4@laptop ~ $ pass generate Amazon/amazonemail@email.com 21 +-.br +-mkdir: created directory \[u2018]/home/zx2c4/.password-store/Amazon\[u2019] +-.br +-[master 30fdc1e] Added generated password for Amazon/amazonemail@email.com to store. +-.br +-1 file changed, 0 insertions(+), 0 deletions(-) +-.br +-create mode 100644 Amazon/amazonemail@email.com.gpg +-.br +-The generated password to Amazon/amazonemail@email.com is: +-.br +-<5m,_BrZY`antNDxKN<0A +- +-.B zx2c4@laptop ~ $ pass git push -u --all +-.br +-Counting objects: 4, done. +-.br +-Delta compression using up to 2 threads. +-.br +-Compressing objects: 100% (3/3), done. +-.br +-Writing objects: 100% (4/4), 921 bytes, done. +-.br +-Total 4 (delta 0), reused 0 (delta 0) +-.br +-To kexec.com:pass-store +-.br +-* [new branch] master -> master +-.br +-Branch master set up to track remote branch master from origin. +- +-.B zx2c4@laptop ~ $ pass insert Amazon/otheraccount@email.com +-.br +-Enter password for Amazon/otheraccount@email.com: som3r3a11yb1gp4ssw0rd!!88** +-.br +-[master b9b6746] Added given password for Amazon/otheraccount@email.com to store. +-.br +-1 file changed, 0 insertions(+), 0 deletions(-) +-.br +-create mode 100644 Amazon/otheraccount@email.com.gpg +- +-.B zx2c4@laptop ~ $ pass rm Amazon/amazonemail@email.com +-.br +-rm: remove regular file \[u2018]/home/zx2c4/.password-store/Amazon/amazonemail@email.com.gpg\[u2019]? y +-.br +-removed \[u2018]/home/zx2c4/.password-store/Amazon/amazonemail@email.com.gpg\[u2019] +-.br +-rm 'Amazon/amazonemail@email.com.gpg' +-.br +-[master 288b379] Removed Amazon/amazonemail@email.com from store. +-.br +-1 file changed, 0 insertions(+), 0 deletions(-) +-.br +-delete mode 100644 Amazon/amazonemail@email.com.gpg +- +-.B zx2c4@laptop ~ $ pass git push +-.br +-Counting objects: 9, done. +-.br +-Delta compression using up to 2 threads. +-.br +-Compressing objects: 100% (5/5), done. +-.br +-Writing objects: 100% (7/7), 1.25 KiB, done. +-.br +-Total 7 (delta 0), reused 0 (delta 0) +-.br +-To kexec.com:pass-store +- + .SH FILES + + .TP +@@ -394,19 +269,6 @@ Overrides the default gpg key identification set by \fBinit\fP. Keys must not + contain spaces and thus use of the hexidecimal key signature is recommended. + Multiple keys may be specified separated by spaces. + .TP +-.I PASSWORD_STORE_GIT +-Overrides the default root of the git repository, which is helpful if +-\fIPASSWORD_STORE_DIR\fP is temporarily set to a sub-directory of the default +-password store. +-.TP +-.I PASSWORD_STORE_X_SELECTION +-Overrides the selection passed to \fBxclip\fP, by default \fIclipboard\fP. See +-.BR xclip (1) +-for more info. +-.TP +-.I PASSWORD_STORE_CLIP_TIME +-Specifies the number of seconds to wait before restoring the clipboard, by default +-\fI45\fP seconds. + .TP + .I PASSWORD_STORE_UMASK + Sets the umask of all files modified by pass, by default \fI077\fP. +@@ -416,8 +278,6 @@ The location of the text editor used by \fBedit\fP. + .SH SEE ALSO + .BR gpg2 (1), + .BR pwgen (1), +-.BR git (1), +-.BR xclip (1). + + .SH AUTHOR + .B pass +diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion +index ea31fbf..dbf39dc 100644 +--- a/src/completion/pass.bash-completion ++++ b/src/completion/pass.bash-completion +@@ -62,7 +62,7 @@ _pass() + { + COMPREPLY=() + local cur="${COMP_WORDS[COMP_CWORD]}" +- local commands="init ls find grep show insert generate edit rm mv cp git help version" ++ local commands="init ls find grep show insert generate edit rm mv cp help version" + if [[ $COMP_CWORD -gt 1 ]]; then + local lastarg="${COMP_WORDS[$COMP_CWORD-1]}" + case "${COMP_WORDS[1]}" in +@@ -78,7 +78,6 @@ _pass() + _pass_complete_entries + ;; + show|-*) +- COMPREPLY+=($(compgen -W "-c --clip" -- ${cur})) + _pass_complete_entries 1 + ;; + insert) +@@ -86,7 +85,7 @@ _pass() + _pass_complete_entries + ;; + generate) +- COMPREPLY+=($(compgen -W "-n --no-symbols -c --clip -f --force -i --in-place" -- ${cur})) ++ COMPREPLY+=($(compgen -W "-n --no-symbols -f --force -i --in-place" -- ${cur})) + _pass_complete_entries + ;; + cp|copy|mv|rename) +@@ -97,9 +96,6 @@ _pass() + COMPREPLY+=($(compgen -W "-r --recursive -f --force" -- ${cur})) + _pass_complete_entries + ;; +- git) +- COMPREPLY+=($(compgen -W "init push pull config log reflog rebase" -- ${cur})) +- ;; + esac + else + COMPREPLY+=($(compgen -W "${commands}" -- ${cur})) +diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion +index c32a42c..6920546 100644 +--- a/src/completion/pass.fish-completion ++++ b/src/completion/pass.fish-completion +@@ -75,7 +75,6 @@ complete -c $PROG -f -A -n '__fish_pass_uses_command insert' -a "(__fish_pass_pr + + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a generate -d 'Command: generate new password' + complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s n -l no-symbols -d 'Do not use special symbols' +-complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s c -l clip -d 'Put the password in clipboard' + complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s f -l force -d 'Do not prompt before overwritting' + complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s i -l in-place -d 'Replace only the first line with the generated password' + complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -a "(__fish_pass_print_entry_dirs)" +@@ -97,22 +96,10 @@ complete -c $PROG -f -A -n '__fish_pass_needs_command' -a edit -d 'Command: edit + complete -c $PROG -f -A -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)" + + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a show -d 'Command: show existing password' +-complete -c $PROG -f -A -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard' + complete -c $PROG -f -A -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)" + # When no command is given, `show` is defaulted. +-complete -c $PROG -f -A -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard' + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" + complete -c $PROG -f -A -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" +-complete -c $PROG -f -A -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" +- +-complete -c $PROG -f -A -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'init' -d 'Initialize git repository' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'status' -d 'Show status of the repo' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'add' -d 'Add changes to the index' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'commit' -d 'Commit changes to the repo' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'push' -d 'Push changes to remote repo' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'pull' -d 'Pull changes from remote repo' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'log' -d 'View changelog' + + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a find -d 'Command: find a password file or directory matching pattern' + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a grep -d 'Command: search inside of decrypted password files for matching pattern' +diff --git a/src/completion/pass.zsh-completion b/src/completion/pass.zsh-completion +index b658398..0f5599f 100644 +--- a/src/completion/pass.zsh-completion ++++ b/src/completion/pass.zsh-completion +@@ -41,8 +41,6 @@ _pass () { + _arguments : \ + "-n[don't include symbols in password]" \ + "--no-symbols[don't include symbols in password]" \ +- "-c[copy password to the clipboard]" \ +- "--clip[copy password to the clipboard]" \ + "-f[force overwrite]" \ + "--force[force overwrite]" \ + "-i[replace first line]" \ +@@ -63,18 +61,6 @@ _pass () { + "--recursive[recursively delete]" + _pass_complete_entries_with_subdirs + ;; +- git) +- local -a subcommands +- subcommands=( +- "init:Initialize git repository" +- "push:Push to remote repository" +- "pull:Pull from remote repository" +- "config:Show git config" +- "log:Show git log" +- "reflog:Show git reflog" +- ) +- _describe -t commands 'pass git' subcommands +- ;; + show|*) + _pass_cmd_show + ;; +@@ -93,7 +79,6 @@ _pass () { + "mv:Rename the password" + "cp:Copy the password" + "rm:Remove the password" +- "git:Call git on the password store" + "version:Output version information" + "help:Output help message" + ) +@@ -106,15 +91,12 @@ _pass () { + } + + _pass_cmd_show () { +- _arguments : \ +- "-c[put it on the clipboard]" \ +- "--clip[put it on the clipboard]" + _pass_complete_entries + } + _pass_complete_entries_helper () { + local IFS=$'\n' + local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" +- _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort) ++ _values -C 'passwords' $(find -L "$prefix" -name .gpg-id -prune -o $@ -print | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort) + } + + _pass_complete_entries_with_subdirs () { +diff --git a/src/password-store.sh b/src/password-store.sh +index 460aa63..227545a 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -12,28 +12,11 @@ which gpg2 &>/dev/null && GPG="gpg2" + [[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" ) + + PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" +-X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" +-CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}" +- +-export GIT_DIR="${PASSWORD_STORE_GIT:-$PREFIX}/.git" +-export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}" + + # + # BEGIN helper functions + # + +-git_add_file() { +- [[ -d $GIT_DIR ]] || return +- git add "$1" || return +- [[ -n $(git status --porcelain "$1") ]] || return +- git_commit "$2" +-} +-git_commit() { +- local sign="" +- [[ -d $GIT_DIR ]] || return +- [[ $(git config --bool --get pass.signcommits) == "true" ]] && sign="-S" +- git commit $sign -m "$1" +-} + yesno() { + [[ -t 0 ]] || return 0 + local response +@@ -135,33 +118,6 @@ check_sneaky_paths() { + # BEGIN platform definable + # + +-clip() { +- # This base64 business is because bash cannot store binary data in a shell +- # variable. Specifically, it cannot store nulls nor (non-trivally) store +- # trailing new lines. +- +- local sleep_argv0="password store sleep on display $DISPLAY" +- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 +- local before="$(xclip -o -selection "$X_SELECTION" | base64)" +- echo -n "$1" | xclip -selection "$X_SELECTION" +- ( +- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) +- local now="$(xclip -o -selection "$X_SELECTION" | base64)" +- [[ $now != $(echo -n "$1" | base64) ]] && before="$now" +- +- # It might be nice to programatically check to see if klipper exists, +- # as well as checking for other common clipboard managers. But for now, +- # this works fine -- if qdbus isn't there or if klipper isn't running, +- # this essentially becomes a no-op. +- # +- # Clipboard managers frequently write their history out in plaintext, +- # so we axe it here: +- qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null +- +- echo "$before" | base64 -d | xclip -selection "$X_SELECTION" +- ) 2>/dev/null & disown +- echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." +-} + tmpdir() { + local warn=1 + [[ $1 == "nowarn" ]] && warn=0 +@@ -222,9 +178,8 @@ cmd_usage() { + List passwords. + $PROGRAM find pass-names... + List passwords that match pass-names. +- $PROGRAM [show] [--clip,-c] pass-name +- Show existing password and optionally put it on the clipboard. +- If put on the clipboard, it will be cleared in $CLIP_TIME seconds. ++ $PROGRAM [show] pass-name ++ Show existing password. + $PROGRAM grep search-string + Search for password files containing search-string when decrypted. + $PROGRAM insert [--echo,-e | --multiline,-m] [--force,-f] pass-name +@@ -233,9 +188,8 @@ cmd_usage() { + overwriting existing password unless forced. + $PROGRAM edit pass-name + Insert a new password or edit an existing password using ${EDITOR:-vi}. +- $PROGRAM generate [--no-symbols,-n] [--clip,-c] [--in-place,-i | --force,-f] pass-name pass-length ++ $PROGRAM generate [--no-symbols,-n] [--in-place,-i | --force,-f] pass-name pass-length + Generate a new password of pass-length with optionally no symbols. +- Optionally put it on the clipboard and clear board after 45 seconds. + Prompt before overwriting existing password unless forced. + Optionally replace only the first line of an existing file with a new password. + $PROGRAM rm [--recursive,-r] [--force,-f] pass-name +@@ -244,9 +198,6 @@ cmd_usage() { + Renames or moves old-path to new-path, optionally forcefully, selectively reencrypting. + $PROGRAM cp [--force,-f] old-path new-path + Copies old-path to new-path, optionally forcefully, selectively reencrypting. +- $PROGRAM git git-command-args... +- If the password store is a git repository, execute a git command +- specified by git-command-args. + $PROGRAM help + Show this text. + $PROGRAM version +@@ -275,47 +226,24 @@ cmd_init() { + if [[ $# -eq 1 && -z $1 ]]; then + [[ ! -f "$gpg_id" ]] && die "Error: $gpg_id does not exist and so cannot be removed." + rm -v -f "$gpg_id" || exit 1 +- if [[ -d $GIT_DIR ]]; then +- git rm -qr "$gpg_id" +- git_commit "Deinitialize ${gpg_id}." +- fi + rmdir -p "${gpg_id%/*}" 2>/dev/null + else + mkdir -v -p "$PREFIX/$id_path" + printf "%s\n" "$@" > "$gpg_id" + local id_print="$(printf "%s, " "$@")" + echo "Password store initialized for ${id_print%, }" +- git_add_file "$gpg_id" "Set GPG id to ${id_print%, }." + fi + + agent_check + reencrypt_path "$PREFIX/$id_path" +- git_add_file "$PREFIX/$id_path" "Reencrypt password store using new GPG id ${id_print%, }." + } + + cmd_show() { +- local opts clip=0 +- opts="$($GETOPT -o c -l clip -n "$PROGRAM" -- "$@")" +- local err=$? +- eval set -- "$opts" +- while true; do case $1 in +- -c|--clip) clip=1; shift ;; +- --) shift; break ;; +- esac done +- +- [[ $err -ne 0 ]] && die "Usage: $PROGRAM $COMMAND [--clip,-c] [pass-name]" +- + local path="$1" + local passfile="$PREFIX/$path.gpg" + check_sneaky_paths "$path" + if [[ -f $passfile ]]; then +- if [[ $clip -eq 0 ]]; then + exec $GPG -d "${GPG_OPTS[@]}" "$passfile" +- else +- local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n 1)" +- [[ -n $pass ]] || exit 1 +- clip "$pass" "$path" +- fi + elif [[ -d $PREFIX/$path ]]; then + if [[ -z $path ]]; then + echo "Password Store" +@@ -398,7 +326,6 @@ cmd_insert() { + read -r -p "Enter password for $path: " -e password + $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" <<<"$password" + fi +- git_add_file "$passfile" "Add given password for $path to store." + } + + cmd_edit() { +@@ -430,23 +357,21 @@ cmd_edit() { + echo "GPG encryption failed. Retrying." + sleep 1 + done +- git_add_file "$passfile" "$action password for $path using ${EDITOR:-vi}." + } + + cmd_generate() { +- local opts clip=0 force=0 symbols="-y" inplace=0 +- opts="$($GETOPT -o ncif -l no-symbols,clip,in-place,force -n "$PROGRAM" -- "$@")" ++ local opts force=0 symbols="-y" inplace=0 ++ opts="$($GETOPT -o nif -l no-symbols,in-place,force -n "$PROGRAM" -- "$@")" + local err=$? + eval set -- "$opts" + while true; do case $1 in + -n|--no-symbols) symbols=""; shift ;; +- -c|--clip) clip=1; shift ;; + -f|--force) force=1; shift ;; + -i|--in-place) inplace=1; shift ;; + --) shift; break ;; + esac done + +- [[ $err -ne 0 || $# -ne 2 || ( $force -eq 1 && $inplace -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--no-symbols,-n] [--clip,-c] [--in-place,-i | --force,-f] pass-name pass-length" ++ [[ $err -ne 0 || $# -ne 2 || ( $force -eq 1 && $inplace -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--no-symbols,-n] [--in-place,-i | --force,-f] pass-name pass-length" + local path="$1" + local length="$2" + check_sneaky_paths "$path" +@@ -472,13 +397,8 @@ cmd_generate() { + fi + local verb="Add" + [[ $inplace -eq 1 ]] && verb="Replace" +- git_add_file "$passfile" "$verb generated password for ${path}." + +- if [[ $clip -eq 0 ]]; then +- printf "\e[1m\e[37mThe generated password for \e[4m%s\e[24m is:\e[0m\n\e[1m\e[93m%s\e[0m\n" "$path" "$pass" +- else +- clip "$pass" "$path" +- fi ++ printf "\e[1m\e[37mThe generated password for \e[4m%s\e[24m is:\e[0m\n\e[1m\e[93m%s\e[0m\n" "$path" "$pass" + } + + cmd_delete() { +@@ -504,10 +424,6 @@ cmd_delete() { + [[ $force -eq 1 ]] || yesno "Are you sure you would like to delete $path?" + + rm $recursive -f -v "$passfile" +- if [[ -d $GIT_DIR && ! -e $passfile ]]; then +- git rm -qr "$passfile" +- git_commit "Remove $path from store." +- fi + rmdir -p "${passfile%/*}" 2>/dev/null + } + +@@ -544,34 +460,10 @@ cmd_copy_move() { + mv $interactive -v "$old_path" "$new_path" || exit 1 + [[ -e "$new_path" ]] && reencrypt_path "$new_path" + +- if [[ -d $GIT_DIR && ! -e $old_path ]]; then +- git rm -qr "$old_path" +- git_add_file "$new_path" "Rename ${1} to ${2}." +- fi + rmdir -p "$old_dir" 2>/dev/null + else + cp $interactive -r -v "$old_path" "$new_path" || exit 1 + [[ -e "$new_path" ]] && reencrypt_path "$new_path" +- git_add_file "$new_path" "Copy ${1} to ${2}." +- fi +-} +- +-cmd_git() { +- if [[ $1 == "init" ]]; then +- git "$@" || exit 1 +- git_add_file "$PREFIX" "Add current contents of password store." +- +- echo '*.gpg diff=gpg' > "$PREFIX/.gitattributes" +- git_add_file .gitattributes "Configure git repository for gpg file diff." +- git config --local diff.gpg.binary true +- git config --local diff.gpg.textconv "$GPG -d ${GPG_OPTS[*]}" +- elif [[ -d $GIT_DIR ]]; then +- tmpdir nowarn #Defines $SECURE_TMPDIR. We don't warn, because at most, this only copies encrypted files. +- trap "rm -rf '$SECURE_TMPDIR'" INT TERM EXIT +- export TMPDIR="$SECURE_TMPDIR" +- git "$@" +- else +- die "Error: the password store is not a git repository. Try \"$PROGRAM git init\"." + fi + } + +@@ -595,7 +487,6 @@ case "$1" in + delete|rm|remove) shift; cmd_delete "$@" ;; + rename|mv) shift; cmd_copy_move "move" "$@" ;; + copy|cp) shift; cmd_copy_move "copy" "$@" ;; +- git) shift; cmd_git "$@" ;; + *) COMMAND="show"; cmd_show "$@" ;; + esac + exit 0 +diff --git a/tests/setup.sh b/tests/setup.sh +index 779f14a..3c68815 100644 +--- a/tests/setup.sh ++++ b/tests/setup.sh +@@ -20,12 +20,6 @@ if [[ ! -d $PASSWORD_STORE_DIR ]]; then + exit 1 + fi + +-export GIT_DIR="$PASSWORD_STORE_DIR/.git" +-export GIT_WORK_TREE="$PASSWORD_STORE_DIR" +-git config --global user.email "Pass-Automated-Testing-Suite@zx2c4.com" +-git config --global user.name "Pass Automated Testing Suite" +- +- + PASS="$TEST_HOME/../src/password-store.sh" + if [[ ! -e $PASS ]]; then + echo "Could not find password-store.sh" +diff --git a/tests/t0050-mv-tests.sh b/tests/t0050-mv-tests.sh +index 3ec7c2a..f51304c 100755 +--- a/tests/t0050-mv-tests.sh ++++ b/tests/t0050-mv-tests.sh +@@ -8,7 +8,6 @@ INITIAL_PASSWORD="bla bla bla will we make it!!" + + test_expect_success 'Basic move command' ' + "$PASS" init $KEY1 && +- "$PASS" git init && + "$PASS" insert -e cred1 <<<"$INITIAL_PASSWORD" && + "$PASS" mv cred1 cred2 && + [[ -e $PASSWORD_STORE_DIR/cred2.gpg && ! -e $PASSWORD_STORE_DIR/cred1.gpg ]] +@@ -44,8 +43,4 @@ test_expect_success 'Password made it until the end' ' + [[ $("$PASS" show cred) == "$INITIAL_PASSWORD" ]] + ' + +-test_expect_success 'Git is consistent' ' +- [[ -z $(git status --porcelain 2>&1) ]] +-' +- + test_done +diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh +index 96da41b..0cbf4b0 100755 +--- a/tests/t0300-reencryption.sh ++++ b/tests/t0300-reencryption.sh +@@ -21,8 +21,8 @@ gpg_keys_from_group() { + canonicalize_gpg_keys "${keys[@]}" + } + +-test_expect_success 'Setup initial key and git' ' +- "$PASS" init $KEY1 && "$PASS" git init ++test_expect_success 'Setup initial key' ' ++ "$PASS" init $KEY1 + ' + + test_expect_success 'Root key encryption' ' +@@ -93,8 +93,4 @@ test_expect_success 'Password lived through all transformations' ' + [[ $("$PASS" show anotherfolder2/anotherfolder/cred1) == "$INITIAL_PASSWORD" ]] + ' + +-test_expect_success 'Git picked up all changes throughout' ' +- [[ -z $(git status --porcelain 2>&1) ]] +-' +- + test_done diff --git a/sysutils/password-store/files/git.patch b/sysutils/password-store/files/git.patch new file mode 100644 index 000000000000..2f9483a2b9f3 --- /dev/null +++ b/sysutils/password-store/files/git.patch @@ -0,0 +1,468 @@ +diff --git a/README b/README +index 8bee02a..299465c 100644 +--- a/README ++++ b/README +@@ -17,8 +17,6 @@ Depends on: + http://www.gnu.org/software/bash/ + - GnuPG2 + http://www.gnupg.org/ +-- git +- http://www.git-scm.com/ + - xclip + http://sourceforge.net/projects/xclip/ + - pwgen +diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el +index 1863185..e0556fd 100644 +--- a/contrib/emacs/password-store.el ++++ b/contrib/emacs/password-store.el +@@ -109,10 +109,6 @@ outputs error message on failure." + entry + new-entry)) + +-(defun password-store--run-git (&rest args) +- (apply 'password-store--run "git" +- args)) +- + (defun password-store--run-version () + (password-store--run "version")) + +diff --git a/man/pass.1 b/man/pass.1 +index 42d9aec..1a69546 100644 +--- a/man/pass.1 ++++ b/man/pass.1 +@@ -33,13 +33,6 @@ or + depending on the type of specifier in ARGS. Otherwise COMMAND must be one of + the valid commands listed below. + +-Several of the commands below rely on or provide additional functionality if +-the password store directory is also a git repository. If the password store +-directory is a git repository, all password store modification commands will +-cause a corresponding git commit. See the \fIEXTENDED GIT EXAMPLE\fP section +-for a detailed description using \fBinit\fP and +-.BR git (1). +- + The \fBinit\fP command must be run before other commands in order to initialize + the password store with the correct gpg key id. Passwords are encrypting using + the gpg key set with \fBinit\fP. +@@ -144,16 +137,6 @@ silently overwrite \fInew-path\fP if it exists. If \fInew-path\fP ends in a + trailing \fI/\fP, it is always treated as a directory. Passwords are selectively + reencrypted to the corresponding keys of their new destination. + .TP +-\fBgit\fP \fIgit-command-args\fP... +-If the password store is a git repository, pass \fIgit-command-args\fP as arguments to +-.BR git (1) +-using the password store as the git repository. If \fIgit-command-args\fP is \fBinit\fP, +-in addition to initializing the git repository, add the current contents of the password +-store to the repository in an initial commit. If the git config key \fIpass.signcommits\fP +-is set to \fItrue\fP, then all commits will be signed using \fIuser.signingkey\fP or the +-default git signing key. This config key may be turned on using: +-.B `pass git config --bool --add pass.signcommits true` +-.TP + \fBhelp\fP + Show usage message. + .TP +@@ -278,99 +261,6 @@ rm: remove regular file \[u2018]/home/zx2c4/.password-store/Business/cheese-whiz + .br + removed \[u2018]/home/zx2c4/.password-store/Business/cheese-whiz-factory.gpg\[u2019] + +-.SH EXTENDED GIT EXAMPLE +-Here, we initialize new password store, create a git repository, and then manipulate and sync passwords. Make note of the arguments to the first call of \fBpass git push\fP; consult +-.BR git-push (1) +-for more information. +- +-.B zx2c4@laptop ~ $ pass init Jason@zx2c4.com +-.br +-mkdir: created directory \[u2018]/home/zx2c4/.password-store\[u2019] +-.br +-Password store initialized for Jason@zx2c4.com. +- +-.B zx2c4@laptop ~ $ pass git init +-.br +-Initialized empty Git repository in /home/zx2c4/.password-store/.git/ +-.br +-[master (root-commit) 998c8fd] Added current contents of password store. +-.br +- 1 file changed, 1 insertion(+) +-.br +- create mode 100644 .gpg-id +- +-.B zx2c4@laptop ~ $ pass git remote add origin kexec.com:pass-store +- +-.B zx2c4@laptop ~ $ pass generate Amazon/amazonemail@email.com 21 +-.br +-mkdir: created directory \[u2018]/home/zx2c4/.password-store/Amazon\[u2019] +-.br +-[master 30fdc1e] Added generated password for Amazon/amazonemail@email.com to store. +-.br +-1 file changed, 0 insertions(+), 0 deletions(-) +-.br +-create mode 100644 Amazon/amazonemail@email.com.gpg +-.br +-The generated password to Amazon/amazonemail@email.com is: +-.br +-<5m,_BrZY`antNDxKN<0A +- +-.B zx2c4@laptop ~ $ pass git push -u --all +-.br +-Counting objects: 4, done. +-.br +-Delta compression using up to 2 threads. +-.br +-Compressing objects: 100% (3/3), done. +-.br +-Writing objects: 100% (4/4), 921 bytes, done. +-.br +-Total 4 (delta 0), reused 0 (delta 0) +-.br +-To kexec.com:pass-store +-.br +-* [new branch] master -> master +-.br +-Branch master set up to track remote branch master from origin. +- +-.B zx2c4@laptop ~ $ pass insert Amazon/otheraccount@email.com +-.br +-Enter password for Amazon/otheraccount@email.com: som3r3a11yb1gp4ssw0rd!!88** +-.br +-[master b9b6746] Added given password for Amazon/otheraccount@email.com to store. +-.br +-1 file changed, 0 insertions(+), 0 deletions(-) +-.br +-create mode 100644 Amazon/otheraccount@email.com.gpg +- +-.B zx2c4@laptop ~ $ pass rm Amazon/amazonemail@email.com +-.br +-rm: remove regular file \[u2018]/home/zx2c4/.password-store/Amazon/amazonemail@email.com.gpg\[u2019]? y +-.br +-removed \[u2018]/home/zx2c4/.password-store/Amazon/amazonemail@email.com.gpg\[u2019] +-.br +-rm 'Amazon/amazonemail@email.com.gpg' +-.br +-[master 288b379] Removed Amazon/amazonemail@email.com from store. +-.br +-1 file changed, 0 insertions(+), 0 deletions(-) +-.br +-delete mode 100644 Amazon/amazonemail@email.com.gpg +- +-.B zx2c4@laptop ~ $ pass git push +-.br +-Counting objects: 9, done. +-.br +-Delta compression using up to 2 threads. +-.br +-Compressing objects: 100% (5/5), done. +-.br +-Writing objects: 100% (7/7), 1.25 KiB, done. +-.br +-Total 7 (delta 0), reused 0 (delta 0) +-.br +-To kexec.com:pass-store +- + .SH FILES + + .TP +@@ -394,11 +284,6 @@ Overrides the default gpg key identification set by \fBinit\fP. Keys must not + contain spaces and thus use of the hexidecimal key signature is recommended. + Multiple keys may be specified separated by spaces. + .TP +-.I PASSWORD_STORE_GIT +-Overrides the default root of the git repository, which is helpful if +-\fIPASSWORD_STORE_DIR\fP is temporarily set to a sub-directory of the default +-password store. +-.TP + .I PASSWORD_STORE_X_SELECTION + Overrides the selection passed to \fBxclip\fP, by default \fIclipboard\fP. See + .BR xclip (1) +@@ -416,7 +301,6 @@ The location of the text editor used by \fBedit\fP. + .SH SEE ALSO + .BR gpg2 (1), + .BR pwgen (1), +-.BR git (1), + .BR xclip (1). + + .SH AUTHOR +diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion +index ea31fbf..f7e207b 100644 +--- a/src/completion/pass.bash-completion ++++ b/src/completion/pass.bash-completion +@@ -62,7 +62,7 @@ _pass() + { + COMPREPLY=() + local cur="${COMP_WORDS[COMP_CWORD]}" +- local commands="init ls find grep show insert generate edit rm mv cp git help version" ++ local commands="init ls find grep show insert generate edit rm mv cp help version" + if [[ $COMP_CWORD -gt 1 ]]; then + local lastarg="${COMP_WORDS[$COMP_CWORD-1]}" + case "${COMP_WORDS[1]}" in +@@ -97,9 +97,6 @@ _pass() + COMPREPLY+=($(compgen -W "-r --recursive -f --force" -- ${cur})) + _pass_complete_entries + ;; +- git) +- COMPREPLY+=($(compgen -W "init push pull config log reflog rebase" -- ${cur})) +- ;; + esac + else + COMPREPLY+=($(compgen -W "${commands}" -- ${cur})) +diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion +index c32a42c..598b55e 100644 +--- a/src/completion/pass.fish-completion ++++ b/src/completion/pass.fish-completion +@@ -105,14 +105,5 @@ complete -c $PROG -f -A -n '__fish_pass_needs_command' -a "(__fish_pass_print_en + complete -c $PROG -f -A -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" + complete -c $PROG -f -A -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" + +-complete -c $PROG -f -A -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'init' -d 'Initialize git repository' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'status' -d 'Show status of the repo' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'add' -d 'Add changes to the index' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'commit' -d 'Commit changes to the repo' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'push' -d 'Push changes to remote repo' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'pull' -d 'Pull changes from remote repo' +-complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'log' -d 'View changelog' +- + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a find -d 'Command: find a password file or directory matching pattern' + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a grep -d 'Command: search inside of decrypted password files for matching pattern' +diff --git a/src/completion/pass.zsh-completion b/src/completion/pass.zsh-completion +index b658398..b0695e6 100644 +--- a/src/completion/pass.zsh-completion ++++ b/src/completion/pass.zsh-completion +@@ -63,18 +63,6 @@ _pass () { + "--recursive[recursively delete]" + _pass_complete_entries_with_subdirs + ;; +- git) +- local -a subcommands +- subcommands=( +- "init:Initialize git repository" +- "push:Push to remote repository" +- "pull:Pull from remote repository" +- "config:Show git config" +- "log:Show git log" +- "reflog:Show git reflog" +- ) +- _describe -t commands 'pass git' subcommands +- ;; + show|*) + _pass_cmd_show + ;; +@@ -93,7 +81,6 @@ _pass () { + "mv:Rename the password" + "cp:Copy the password" + "rm:Remove the password" +- "git:Call git on the password store" + "version:Output version information" + "help:Output help message" + ) +@@ -114,7 +101,7 @@ _pass_cmd_show () { + _pass_complete_entries_helper () { + local IFS=$'\n' + local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" +- _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort) ++ _values -C 'passwords' $(find -L "$prefix" -name .gpg-id -prune -o $@ -print | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort) + } + + _pass_complete_entries_with_subdirs () { +diff --git a/src/password-store.sh b/src/password-store.sh +index 460aa63..969d631 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -15,25 +15,10 @@ PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" + CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}" + +-export GIT_DIR="${PASSWORD_STORE_GIT:-$PREFIX}/.git" +-export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}" +- + # + # BEGIN helper functions + # + +-git_add_file() { +- [[ -d $GIT_DIR ]] || return +- git add "$1" || return +- [[ -n $(git status --porcelain "$1") ]] || return +- git_commit "$2" +-} +-git_commit() { +- local sign="" +- [[ -d $GIT_DIR ]] || return +- [[ $(git config --bool --get pass.signcommits) == "true" ]] && sign="-S" +- git commit $sign -m "$1" +-} + yesno() { + [[ -t 0 ]] || return 0 + local response +@@ -244,9 +229,6 @@ cmd_usage() { + Renames or moves old-path to new-path, optionally forcefully, selectively reencrypting. + $PROGRAM cp [--force,-f] old-path new-path + Copies old-path to new-path, optionally forcefully, selectively reencrypting. +- $PROGRAM git git-command-args... +- If the password store is a git repository, execute a git command +- specified by git-command-args. + $PROGRAM help + Show this text. + $PROGRAM version +@@ -275,22 +257,16 @@ cmd_init() { + if [[ $# -eq 1 && -z $1 ]]; then + [[ ! -f "$gpg_id" ]] && die "Error: $gpg_id does not exist and so cannot be removed." + rm -v -f "$gpg_id" || exit 1 +- if [[ -d $GIT_DIR ]]; then +- git rm -qr "$gpg_id" +- git_commit "Deinitialize ${gpg_id}." +- fi + rmdir -p "${gpg_id%/*}" 2>/dev/null + else + mkdir -v -p "$PREFIX/$id_path" + printf "%s\n" "$@" > "$gpg_id" + local id_print="$(printf "%s, " "$@")" + echo "Password store initialized for ${id_print%, }" +- git_add_file "$gpg_id" "Set GPG id to ${id_print%, }." + fi + + agent_check + reencrypt_path "$PREFIX/$id_path" +- git_add_file "$PREFIX/$id_path" "Reencrypt password store using new GPG id ${id_print%, }." + } + + cmd_show() { +@@ -398,7 +374,6 @@ cmd_insert() { + read -r -p "Enter password for $path: " -e password + $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" <<<"$password" + fi +- git_add_file "$passfile" "Add given password for $path to store." + } + + cmd_edit() { +@@ -430,7 +405,6 @@ cmd_edit() { + echo "GPG encryption failed. Retrying." + sleep 1 + done +- git_add_file "$passfile" "$action password for $path using ${EDITOR:-vi}." + } + + cmd_generate() { +@@ -472,7 +446,6 @@ cmd_generate() { + fi + local verb="Add" + [[ $inplace -eq 1 ]] && verb="Replace" +- git_add_file "$passfile" "$verb generated password for ${path}." + + if [[ $clip -eq 0 ]]; then + printf "\e[1m\e[37mThe generated password for \e[4m%s\e[24m is:\e[0m\n\e[1m\e[93m%s\e[0m\n" "$path" "$pass" +@@ -504,10 +477,6 @@ cmd_delete() { + [[ $force -eq 1 ]] || yesno "Are you sure you would like to delete $path?" + + rm $recursive -f -v "$passfile" +- if [[ -d $GIT_DIR && ! -e $passfile ]]; then +- git rm -qr "$passfile" +- git_commit "Remove $path from store." +- fi + rmdir -p "${passfile%/*}" 2>/dev/null + } + +@@ -544,34 +513,10 @@ cmd_copy_move() { + mv $interactive -v "$old_path" "$new_path" || exit 1 + [[ -e "$new_path" ]] && reencrypt_path "$new_path" + +- if [[ -d $GIT_DIR && ! -e $old_path ]]; then +- git rm -qr "$old_path" +- git_add_file "$new_path" "Rename ${1} to ${2}." +- fi + rmdir -p "$old_dir" 2>/dev/null + else + cp $interactive -r -v "$old_path" "$new_path" || exit 1 + [[ -e "$new_path" ]] && reencrypt_path "$new_path" +- git_add_file "$new_path" "Copy ${1} to ${2}." +- fi +-} +- +-cmd_git() { +- if [[ $1 == "init" ]]; then +- git "$@" || exit 1 +- git_add_file "$PREFIX" "Add current contents of password store." +- +- echo '*.gpg diff=gpg' > "$PREFIX/.gitattributes" +- git_add_file .gitattributes "Configure git repository for gpg file diff." +- git config --local diff.gpg.binary true +- git config --local diff.gpg.textconv "$GPG -d ${GPG_OPTS[*]}" +- elif [[ -d $GIT_DIR ]]; then +- tmpdir nowarn #Defines $SECURE_TMPDIR. We don't warn, because at most, this only copies encrypted files. +- trap "rm -rf '$SECURE_TMPDIR'" INT TERM EXIT +- export TMPDIR="$SECURE_TMPDIR" +- git "$@" +- else +- die "Error: the password store is not a git repository. Try \"$PROGRAM git init\"." + fi + } + +@@ -595,7 +540,6 @@ case "$1" in + delete|rm|remove) shift; cmd_delete "$@" ;; + rename|mv) shift; cmd_copy_move "move" "$@" ;; + copy|cp) shift; cmd_copy_move "copy" "$@" ;; +- git) shift; cmd_git "$@" ;; + *) COMMAND="show"; cmd_show "$@" ;; + esac + exit 0 +diff --git a/tests/setup.sh b/tests/setup.sh +index 779f14a..3c68815 100644 +--- a/tests/setup.sh ++++ b/tests/setup.sh +@@ -20,12 +20,6 @@ if [[ ! -d $PASSWORD_STORE_DIR ]]; then + exit 1 + fi + +-export GIT_DIR="$PASSWORD_STORE_DIR/.git" +-export GIT_WORK_TREE="$PASSWORD_STORE_DIR" +-git config --global user.email "Pass-Automated-Testing-Suite@zx2c4.com" +-git config --global user.name "Pass Automated Testing Suite" +- +- + PASS="$TEST_HOME/../src/password-store.sh" + if [[ ! -e $PASS ]]; then + echo "Could not find password-store.sh" +diff --git a/tests/t0050-mv-tests.sh b/tests/t0050-mv-tests.sh +index 3ec7c2a..f51304c 100755 +--- a/tests/t0050-mv-tests.sh ++++ b/tests/t0050-mv-tests.sh +@@ -8,7 +8,6 @@ INITIAL_PASSWORD="bla bla bla will we make it!!" + + test_expect_success 'Basic move command' ' + "$PASS" init $KEY1 && +- "$PASS" git init && + "$PASS" insert -e cred1 <<<"$INITIAL_PASSWORD" && + "$PASS" mv cred1 cred2 && + [[ -e $PASSWORD_STORE_DIR/cred2.gpg && ! -e $PASSWORD_STORE_DIR/cred1.gpg ]] +@@ -44,8 +43,4 @@ test_expect_success 'Password made it until the end' ' + [[ $("$PASS" show cred) == "$INITIAL_PASSWORD" ]] + ' + +-test_expect_success 'Git is consistent' ' +- [[ -z $(git status --porcelain 2>&1) ]] +-' +- + test_done +diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh +index 96da41b..0cbf4b0 100755 +--- a/tests/t0300-reencryption.sh ++++ b/tests/t0300-reencryption.sh +@@ -21,8 +21,8 @@ gpg_keys_from_group() { + canonicalize_gpg_keys "${keys[@]}" + } + +-test_expect_success 'Setup initial key and git' ' +- "$PASS" init $KEY1 && "$PASS" git init ++test_expect_success 'Setup initial key' ' ++ "$PASS" init $KEY1 + ' + + test_expect_success 'Root key encryption' ' +@@ -93,8 +93,4 @@ test_expect_success 'Password lived through all transformations' ' + [[ $("$PASS" show anotherfolder2/anotherfolder/cred1) == "$INITIAL_PASSWORD" ]] + ' + +-test_expect_success 'Git picked up all changes throughout' ' +- [[ -z $(git status --porcelain 2>&1) ]] +-' +- + test_done diff --git a/sysutils/password-store/files/linuxism+git+xclip.patch b/sysutils/password-store/files/linuxism+git+xclip.patch deleted file mode 100644 index 742d87251704..000000000000 --- a/sysutils/password-store/files/linuxism+git+xclip.patch +++ /dev/null @@ -1,605 +0,0 @@ -diff --git README README -index 47ed64b..6ebfd68 100644 ---- README -+++ README -@@ -17,10 +17,6 @@ Depends on: - http://www.gnu.org/software/bash/ - - GnuPG2 - http://www.gnupg.org/ --- git -- http://www.git-scm.com/ --- xclip -- http://sourceforge.net/projects/xclip/ - - pwgen - http://sourceforge.net/projects/pwgen/ - - tree -diff --git contrib/pass.bash-completion contrib/pass.bash-completion -index d0ef012..66e8866 100644 ---- contrib/pass.bash-completion -+++ contrib/pass.bash-completion -@@ -48,7 +48,7 @@ _pass() - { - COMPREPLY=() - local cur="${COMP_WORDS[COMP_CWORD]}" -- local commands="init ls show insert generate edit rm git help version" -+ local commands="init ls show insert generate edit rm help version" - if [[ $COMP_CWORD -gt 1 ]]; then - case "${COMP_WORDS[1]}" in - init) -@@ -59,7 +59,6 @@ _pass() - _pass_complete_entries - ;; - show|-*) -- COMPREPLY+=($(compgen -W "-c --clip" -- ${cur})) - _pass_complete_entries 1 - ;; - insert) -@@ -67,16 +66,13 @@ _pass() - _pass_complete_entries - ;; - generate) -- COMPREPLY+=($(compgen -W "-n --no-symbols -c --clip -f --force" -- ${cur})) -+ COMPREPLY+=($(compgen -W "-n --no-symbols -f --force" -- ${cur})) - _pass_complete_entries - ;; - rm|remove|delete) - COMPREPLY+=($(compgen -W "-r --recursive -f --force" -- ${cur})) - _pass_complete_entries - ;; -- git) -- COMPREPLY+=($(compgen -W "init push pull config log reflog" -- ${cur})) -- ;; - esac - else - COMPREPLY+=($(compgen -W "${commands}" -- ${cur})) -diff --git contrib/pass.fish-completion contrib/pass.fish-completion -index 9130d1f..366ed5e 100644 ---- contrib/pass.fish-completion -+++ contrib/pass.fish-completion -@@ -76,7 +76,6 @@ complete -c $PROG -f -A -n '__fish_pass_uses_command insert' -a "(__fish_pass_pr - - complete -c $PROG -f -A -n '__fish_pass_needs_command' -a generate -d 'Command: generate new password' - complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s n -l no-symbols -d 'Do not use special symbols' --complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s c -l clip -d 'Put the password in clipboard' - complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s f -l force -d 'Do not prompt before overwritting' - complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -a "(__fish_pass_print_entry_dirs)" - -@@ -89,16 +88,7 @@ complete -c $PROG -f -A -n '__fish_pass_needs_command' -a edit -d 'Command: edit - complete -c $PROG -f -A -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)" - - complete -c $PROG -f -A -n '__fish_pass_needs_command' -a show -d 'Command: show existing password' --complete -c $PROG -f -A -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard' - complete -c $PROG -f -A -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)" - # When no command is given, `show` is defaulted. --complete -c $PROG -f -A -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard' - complete -c $PROG -f -A -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" - complete -c $PROG -f -A -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" --complete -c $PROG -f -A -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" -- --complete -c $PROG -f -A -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' --complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'init' -d 'Initialize git repository' --complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'push' -d 'Push changes to remote repo' --complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'pull' -d 'Pull changes from remote repo' --complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'log' -d 'View changelog' -diff --git contrib/pass.zsh-completion contrib/pass.zsh-completion -index 848bc67..e8f0ebe 100644 ---- contrib/pass.zsh-completion -+++ contrib/pass.zsh-completion -@@ -39,8 +39,6 @@ _pass () { - _arguments : \ - "-n[don't include symbols in password]" \ - "--no-symbols[don't include symbols in password]" \ -- "-c[copy password to the clipboard]" \ -- "--clip[copy password to the clipboard]" - _pass_complete_entries_with_subdirs - ;; - rm) -@@ -51,18 +49,6 @@ _pass () { - "--recursive[recursively delete]" - _pass_complete_entries_with_subdirs - ;; -- git) -- local -a subcommands -- subcommands=( -- "init:Initialize git repository" -- "push:Push to remote repository" -- "pull:Pull from remote repository" -- "config:Show git config" -- "log:Show git log" -- "reflog:Show git reflog" -- ) -- _describe -t commands 'pass git' subcommands -- ;; - show|*) - _pass_cmd_show - ;; -@@ -77,7 +63,6 @@ _pass () { - "generate:Generate a new password using pwgen" - "edit:Edit a password with \$EDITOR" - "rm:Remove the password" -- "git:Call git on the password store" - "version:Output version information" - "help:Output help message" - ) -@@ -90,15 +75,12 @@ _pass () { - } - - _pass_cmd_show () { -- _arguments : \ -- "-c[put it on the clipboard]" \ -- "--clip[put it on the clipboard]" - _pass_complete_entries - } - _pass_complete_entries_helper () { - local IFS=$'\n' - local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" -- _values -C 'passwords' $(find "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) -+ _values -C 'passwords' $(find "$prefix" -name .gpg-id -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) - } - - _pass_complete_entries_with_subdirs () { -diff --git man/pass.1 man/pass.1 -index efb5d9b..1e273ea 100644 ---- man/pass.1 -+++ man/pass.1 -@@ -33,13 +33,6 @@ or - depending on the type of specifier in ARGS. Otherwise COMMAND must be one of - the valid commands listed below. - --Several of the commands below rely on or provide additional functionality if --the password store directory is also a git repository. If the password store --directory is a git repository, all password store modification commands will --cause a corresponding git commit. See the \fIEXTENDED GIT EXAMPLE\fP section --for a detailed description using \fBinit\fP and --.BR git (1). -- - The \fBinit\fP command must be run before other commands in order to initialize - the password store with the correct gpg key id. Passwords are encrypting using - the gpg key set with \fBinit\fP. -@@ -68,12 +61,8 @@ by using the - .BR tree (1) - program. This command is alternatively named \fBlist\fP. - .TP --\fBshow\fP [ \fI--clip\fP, \fI-c\fP ] \fIpass-name\fP --Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP --is specified, do not print the password but instead copy the first line to the --clipboard using --.BR xclip (1) --and then restore the clipboard after 45 seconds. -+\fBshow\fP \fIpass-name\fP -+Decrypt and print a password named \fIpass-name\fP. - .TP - \fBinsert\fP [ \fI--echo\fP, \fI-e\fP | \fI--multiline\fP, \fI-m\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP - Insert a new password into the password store called \fIpass-name\fP. This will -@@ -92,15 +81,12 @@ ensure that temporary files are created in \fI/dev/shm\fP in order to avoid writ - difficult-to-erase disk sectors. If \fI/dev/shm\fP is not accessible, fallback to - the ordinary \fITMPDIR\fP location, and print a warning. - .TP --\fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--clip\fP, \fI-c\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name pass-length\fP -+\fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name pass-length\fP - Generate a new password using - .BR pwgen (1) - of length \fIpass-length\fP and insert into \fIpass-name\fP. If \fI--no-symbols\fP or \fI-n\fP - is specified, do not use any non-alphanumeric characters in the generated password. --If \fI--clip\fP or \fI-c\fP is specified, do not print the password but instead copy --it to the clipboard using --.BR xclip (1) --and then restore the clipboard after 45 seconds. Prompt before overwriting an existing password, -+Prompt before overwriting an existing password, - unless \fI--force\fP or \fI-f\fP is specified. - .TP - \fBrm\fP [ \fI--recursive\fP, \fI-r\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP -@@ -109,13 +95,6 @@ alternatively named \fBremove\fP or \fBdelete\fP. If \fI--recursive\fP or \fI-r\ - is specified, delete pass-name recursively if it is a directory. If \fI--force\fP - or \fI-f\fP is specified, do not interactively prompt before removal. - .TP --\fBgit\fP \fIgit-command-args\fP... --If the password store is a git repository, pass \fIgit-command-args\fP as arguments to --.BR git (1) --using the password store as the git repository. If \fIgit-command-args\fP is \fBinit\fP, --in addition to initializing the git repository, add the current contents of the password --store to the repository in an initial commit. --.TP - \fBhelp\fP - Show usage message. - .TP -@@ -166,11 +145,6 @@ Show existing password - .br - sup3rh4x3rizmynam3 - .TP --Copy existing password to clipboard --.B zx2c4@laptop ~ $ pass -c Email/zx2c4.com --.br --Copied Email/jason@zx2c4.com to clipboard. Will clear in 45 seconds. --.TP - Add password to store - .B zx2c4@laptop ~ $ pass insert Business/cheese-whiz-factory - .br -@@ -209,10 +183,8 @@ The generated password to Email/jasondonenfeld.com is: - .br - YqFsMkBeO6di - .TP --Generate new password and copy it to the clipboard --.B zx2c4@laptop ~ $ pass -c generate Email/jasondonenfeld.com 19 --.br --Copied Email/jasondonenfeld.com to clipboard. Will clear in 45 seconds. -+Generate new password -+.B zx2c4@laptop ~ $ pass generate Email/jasondonenfeld.com 19 - .TP - Remove password from store - .B zx2c4@laptop ~ $ pass remove Business/cheese-whiz-factory -@@ -221,99 +193,6 @@ rm: remove regular file \[u2018]/home/zx2c4/.password-store/Business/cheese-whiz - .br - removed \[u2018]/home/zx2c4/.password-store/Business/cheese-whiz-factory.gpg\[u2019] - --.SH EXTENDED GIT EXAMPLE --Here, we initialize new password store, create a git repository, and then manipulate and sync passwords. Make note of the arguments to the first call of \fBpass git push\fP; consult --.BR git-push (1) --for more information. -- --.B zx2c4@laptop ~ $ pass init Jason@zx2c4.com --.br --mkdir: created directory \[u2018]/home/zx2c4/.password-store\[u2019] --.br --Password store initialized for Jason@zx2c4.com. -- --.B zx2c4@laptop ~ $ pass git init --.br --Initialized empty Git repository in /home/zx2c4/.password-store/.git/ --.br --[master (root-commit) 998c8fd] Added current contents of password store. --.br -- 1 file changed, 1 insertion(+) --.br -- create mode 100644 .gpg-id -- --.B zx2c4@laptop ~ $ pass git remote add origin kexec.com:pass-store -- --.B zx2c4@laptop ~ $ pass generate Amazon/amazonemail@email.com 21 --.br --mkdir: created directory \[u2018]/home/zx2c4/.password-store/Amazon\[u2019] --.br --[master 30fdc1e] Added generated password for Amazon/amazonemail@email.com to store. --.br --1 file changed, 0 insertions(+), 0 deletions(-) --.br --create mode 100644 Amazon/amazonemail@email.com.gpg --.br --The generated password to Amazon/amazonemail@email.com is: --.br --<5m,_BrZY`antNDxKN<0A -- --.B zx2c4@laptop ~ $ pass git push -u --all --.br --Counting objects: 4, done. --.br --Delta compression using up to 2 threads. --.br --Compressing objects: 100% (3/3), done. --.br --Writing objects: 100% (4/4), 921 bytes, done. --.br --Total 4 (delta 0), reused 0 (delta 0) --.br --To kexec.com:pass-store --.br --* [new branch] master -> master --.br --Branch master set up to track remote branch master from origin. -- --.B zx2c4@laptop ~ $ pass insert Amazon/otheraccount@email.com --.br --Enter password for Amazon/otheraccount@email.com: som3r3a11yb1gp4ssw0rd!!88** --.br --[master b9b6746] Added given password for Amazon/otheraccount@email.com to store. --.br --1 file changed, 0 insertions(+), 0 deletions(-) --.br --create mode 100644 Amazon/otheraccount@email.com.gpg -- --.B zx2c4@laptop ~ $ pass rm Amazon/amazonemail@email.com --.br --rm: remove regular file \[u2018]/home/zx2c4/.password-store/Amazon/amazonemail@email.com.gpg\[u2019]? y --.br --removed \[u2018]/home/zx2c4/.password-store/Amazon/amazonemail@email.com.gpg\[u2019] --.br --rm 'Amazon/amazonemail@email.com.gpg' --.br --[master 288b379] Removed Amazon/amazonemail@email.com from store. --.br --1 file changed, 0 insertions(+), 0 deletions(-) --.br --delete mode 100644 Amazon/amazonemail@email.com.gpg -- --.B zx2c4@laptop ~ $ pass git push --.br --Counting objects: 9, done. --.br --Delta compression using up to 2 threads. --.br --Compressing objects: 100% (5/5), done. --.br --Writing objects: 100% (7/7), 1.25 KiB, done. --.br --Total 7 (delta 0), reused 0 (delta 0) --.br --To kexec.com:pass-store -- - .SH FILES - - .TP -@@ -333,19 +212,12 @@ Overrides the default password storage directory. - .I PASSWORD_STORE_KEY - Overrides the default gpg key identification set by \fBinit\fP. - .TP --.I PASSWORD_STORE_GIT --Overrides the default root of the git repository, which is helpful if --\fIPASSWORD_STORE_DIR\fP is temporarily set to a sub-directory of the default --password store. --.TP - .I EDITOR - The location of the text editor used by \fBedit\fP. - - .SH SEE ALSO - .BR gpg2 (1), - .BR pwgen (1), --.BR git (1), --.BR xclip (1). - - .SH AUTHOR - .B pass -diff --git src/password-store.sh src/password-store.sh -index 26a4bd0..e669e08 100755 ---- src/password-store.sh -+++ src/password-store.sh -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/usr/local/bin/bash - - # Copyright (C) 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. - # This file is licensed under the GPLv2+. Please see COPYING for more information. -@@ -7,12 +7,8 @@ umask 077 - - PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - ID="$PREFIX/.gpg-id" --GIT_DIR="${PASSWORD_STORE_GIT:-$PREFIX}/.git" - GPG_OPTS="--quiet --yes --batch" - --export GIT_DIR --export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}" -- - version() { - cat <<_EOF - |-----------------------| -@@ -35,24 +31,21 @@ Usage: - Optionally reencrypt existing passwords using new gpg-id. - $program [ls] [subfolder] - List passwords. -- $program [show] [--clip,-c] pass-name -- Show existing password and optionally put it on the clipboard. -- If put on the clipboard, it will be cleared in 45 seconds. -+ $program [show] pass-name -+ Show existing password - $program insert [--echo,-e | --multiline,-m] [--force,-f] pass-name - Insert new password. Optionally, the console can be enabled echo - the password back. Or, optionally, it may be multiline. Prompt -+ Insert new password. Optionally, the console can be enabled to not -+ echo the password back. Or, optionally, it may be multiline. Prompt - before overwriting existing password unless forced. - $program edit pass-name - Insert a new password or edit an existing password using ${EDITOR:-vi}. -- $program generate [--no-symbols,-n] [--clip,-c] [--force,-f] pass-name pass-length -+ $program generate [--no-symbols,-n] [--force,-f] pass-name pass-length - Generate a new password of pass-length with optionally no symbols. -- Optionally put it on the clipboard and clear board after 45 seconds. - Prompt before overwriting existing password unless forced. - $program rm [--recursive,-r] [--force,-f] pass-name - Remove existing password or directory, optionally forcefully. -- $program git git-command-args... -- If the password store is a git repository, execute a git command -- specified by git-command-args. - $program help - Show this text. - $program version -@@ -63,16 +56,10 @@ _EOF - } - is_command() { - case "$1" in -- init|ls|list|show|insert|edit|generate|remove|rm|delete|git|help|--help|version|--version) return 0 ;; -+ init|ls|list|show|insert|edit|generate|remove|rm|delete|help|--help|version|--version) return 0 ;; - *) return 1 ;; - esac - } --git_add_file() { -- [[ -d $GIT_DIR ]] || return -- git add "$1" || return -- [[ -n $(git status --porcelain "$1") ]] || return -- git commit -m "$2" --} - yesno() { - read -p "$1 [y/N] " response - [[ $response == "y" || $response == "Y" ]] || exit 1 -@@ -80,48 +67,21 @@ yesno() { - # - # BEGIN Platform definable - # --clip() { -- # This base64 business is a disgusting hack to deal with newline inconsistancies -- # in shell. There must be a better way to deal with this, but because I'm a dolt, -- # we're going with this for now. -- -- before="$(xclip -o -selection clipboard | base64)" -- echo -n "$1" | xclip -selection clipboard -- ( -- sleep 45 -- now="$(xclip -o -selection clipboard | base64)" -- if [[ $now != $(echo -n "$1" | base64) ]]; then -- before="$now" -- fi -- -- # It might be nice to programatically check to see if klipper exists, -- # as well as checking for other common clipboard managers. But for now, -- # this works fine -- if qdbus isn't there or if klipper isn't running, -- # this essentially becomes a no-op. -- # -- # Clipboard managers frequently write their history out in plaintext, -- # so we axe it here: -- qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null -- -- echo "$before" | base64 -d | xclip -selection clipboard -- ) & disown -- echo "Copied $2 to clipboard. Will clear in 45 seconds." --} - tmpdir() { -- if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then -- tmp_dir="$(TMPDIR=/dev/shm mktemp -t "$template" -d)" -+ ramdisk="/var/tmp/password-store.ramdisk" -+ if [[ -d $ramdisk && -d $ramdisk && -d $ramdisk ]]; then -+ tmp_dir="$(TMPDIR=$ramdisk mktemp -t "$template" -d)" - else -- yesno "$(echo "Your system does not have /dev/shm, which means that it may" -- echo "be difficult to entirely erase the temporary non-encrypted" -- echo "password file after editing. Are you sure you would like to" -- echo -n "continue?")" -+ yesno "$(echo "A ramdisk does not exist at $ramdisk, which means that it may" -+ echo "be difficult to entirely erase the temporary non-encrypted" -+ echo "password file after editing. Are you sure you would like to" -+ echo -n "continue?")" -+ - tmp_dir="$(mktemp -t "$template" -d)" - fi -- - } --GETOPT="getopt" - --# source /path/to/platform-defined-functions -+GETOPT="/usr/local/bin/getopt" - # - # END Platform definable - # -@@ -155,14 +115,12 @@ case "$command" in - mkdir -v -p "$PREFIX" - echo "$gpg_id" > "$ID" - echo "Password store initialized for $gpg_id." -- git_add_file "$ID" "Set GPG id to $gpg_id." - - if [[ $reencrypt -eq 1 ]]; then - find "$PREFIX" -iname '*.gpg' | while read passfile; do - gpg2 -d $GPG_OPTS "$passfile" | gpg2 -e -r "$gpg_id" -o "$passfile.new" $GPG_OPTS && - mv -v "$passfile.new" "$passfile" - done -- git_add_file "$PREFIX" "Reencrypted entire store using new GPG id $gpg_id." - fi - exit 0 - ;; -@@ -191,18 +149,8 @@ fi - - case "$command" in - show|ls|list) -- clip=0 -- -- opts="$($GETOPT -o c -l clip -n "$program" -- "$@")" -- err=$? -- eval set -- "$opts" -- while true; do case $1 in -- -c|--clip) clip=1; shift ;; -- --) shift; break ;; -- esac done -- - if [[ $err -ne 0 ]]; then -- echo "Usage: $program $command [--clip,-c] [pass-name]" -+ echo "Usage: $program $command [pass-name]" - exit 1 - fi - -@@ -220,13 +168,8 @@ case "$command" in - echo "$path is not in the password store." - exit 1 - fi -- if [[ $clip -eq 0 ]]; then -- exec gpg2 -d $GPG_OPTS "$passfile" -- else -- pass="$(gpg2 -d $GPG_OPTS "$passfile" | head -n 1)" -- [[ -n $pass ]] || exit 1 -- clip "$pass" "$path" -- fi -+ -+ gpg2 -d $GPG_OPTS "$passfile" - fi - ;; - insert) -@@ -276,7 +219,6 @@ case "$command" in - read -r -p "Enter password for $path: " -e password - gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password" - fi -- git_add_file "$passfile" "Added given password for $path to store." - ;; - edit) - if [[ $# -ne 1 ]]; then -@@ -304,25 +246,22 @@ case "$command" in - echo "GPG encryption failed. Retrying." - sleep 1 - done -- git_add_file "$passfile" "$action password for $path using ${EDITOR:-vi}." - ;; - generate) -- clip=0 - force=0 - symbols="-y" - -- opts="$($GETOPT -o ncf -l no-symbols,clip,force -n "$program" -- "$@")" -+ opts="$($GETOPT -o ncf -l no-symbols,force -n "$program" -- "$@")" - err=$? - eval set -- "$opts" - while true; do case $1 in - -n|--no-symbols) symbols=""; shift ;; -- -c|--clip) clip=1; shift ;; - -f|--force) force=1; shift ;; - --) shift; break ;; - esac done - - if [[ $err -ne 0 || $# -ne 2 ]]; then -- echo "Usage: $program $command [--no-symbols,-n] [--clip,-c] [--force,-f] pass-name pass-length" -+ echo "Usage: $program $command [--no-symbols,-n] [--force,-f] pass-name pass-length" - exit 1 - fi - path="$1" -@@ -339,14 +278,9 @@ case "$command" in - pass="$(pwgen -s $symbols $length 1)" - [[ -n $pass ]] || exit 1 - gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass" -- git_add_file "$passfile" "Added generated password for $path to store." - -- if [[ $clip -eq 0 ]]; then -- echo "The generated password to $path is:" -- echo "$pass" -- else -- clip "$pass" "$path" -- fi -+ echo "The generated password to $path is:" -+ echo "$pass" - ;; - delete|rm|remove) - recursive="" -@@ -378,21 +312,6 @@ case "$command" in - [[ $force -eq 1 ]] || yesno "Are you sure you would like to delete $path?" - - rm $recursive -f -v "$passfile" -- if [[ -d $GIT_DIR && ! -e $passfile ]]; then -- git rm -qr "$passfile" -- git commit -m "Removed $path from store." -- fi -- ;; -- git) -- if [[ $1 == "init" ]]; then -- git "$@" || exit 1 -- git_add_file "$PREFIX" "Added current contents of password store." -- elif [[ -d $GIT_DIR ]]; then -- exec git "$@" -- else -- echo "Error: the password store is not a git repository." -- exit 1 -- fi - ;; - *) - usage diff --git a/sysutils/password-store/files/linuxism+git.patch b/sysutils/password-store/files/linuxism+git.patch deleted file mode 100644 index 2cd4f74c472d..000000000000 --- a/sysutils/password-store/files/linuxism+git.patch +++ /dev/null @@ -1,383 +0,0 @@ -diff --git README README -index 47ed64b..65a041e 100644 ---- README -+++ README -@@ -17,8 +17,6 @@ Depends on: - http://www.gnu.org/software/bash/ - - GnuPG2 - http://www.gnupg.org/ --- git -- http://www.git-scm.com/ - - xclip - http://sourceforge.net/projects/xclip/ - - pwgen -diff --git contrib/pass.bash-completion contrib/pass.bash-completion -index d0ef012..5cf6550 100644 ---- contrib/pass.bash-completion -+++ contrib/pass.bash-completion -@@ -48,7 +48,7 @@ _pass() - { - COMPREPLY=() - local cur="${COMP_WORDS[COMP_CWORD]}" -- local commands="init ls show insert generate edit rm git help version" -+ local commands="init ls show insert generate edit rm help version" - if [[ $COMP_CWORD -gt 1 ]]; then - case "${COMP_WORDS[1]}" in - init) -@@ -74,9 +74,6 @@ _pass() - COMPREPLY+=($(compgen -W "-r --recursive -f --force" -- ${cur})) - _pass_complete_entries - ;; -- git) -- COMPREPLY+=($(compgen -W "init push pull config log reflog" -- ${cur})) -- ;; - esac - else - COMPREPLY+=($(compgen -W "${commands}" -- ${cur})) -diff --git contrib/pass.fish-completion contrib/pass.fish-completion -index 9130d1f..e692595 100644 ---- contrib/pass.fish-completion -+++ contrib/pass.fish-completion -@@ -96,9 +96,3 @@ complete -c $PROG -f -A -n '__fish_pass_needs_command' -s c -l clip -d 'Put pass - complete -c $PROG -f -A -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" - complete -c $PROG -f -A -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" - complete -c $PROG -f -A -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" -- --complete -c $PROG -f -A -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' --complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'init' -d 'Initialize git repository' --complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'push' -d 'Push changes to remote repo' --complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'pull' -d 'Pull changes from remote repo' --complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'log' -d 'View changelog' -diff --git contrib/pass.zsh-completion contrib/pass.zsh-completion -index 848bc67..76124ae 100644 ---- contrib/pass.zsh-completion -+++ contrib/pass.zsh-completion -@@ -51,18 +51,6 @@ _pass () { - "--recursive[recursively delete]" - _pass_complete_entries_with_subdirs - ;; -- git) -- local -a subcommands -- subcommands=( -- "init:Initialize git repository" -- "push:Push to remote repository" -- "pull:Pull from remote repository" -- "config:Show git config" -- "log:Show git log" -- "reflog:Show git reflog" -- ) -- _describe -t commands 'pass git' subcommands -- ;; - show|*) - _pass_cmd_show - ;; -@@ -77,7 +65,6 @@ _pass () { - "generate:Generate a new password using pwgen" - "edit:Edit a password with \$EDITOR" - "rm:Remove the password" -- "git:Call git on the password store" - "version:Output version information" - "help:Output help message" - ) -@@ -98,7 +85,7 @@ _pass_cmd_show () { - _pass_complete_entries_helper () { - local IFS=$'\n' - local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" -- _values -C 'passwords' $(find "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) -+ _values -C 'passwords' $(find "$prefix" -name .gpg-id -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) - } - - _pass_complete_entries_with_subdirs () { -diff --git man/pass.1 man/pass.1 -index efb5d9b..4ddc90d 100644 ---- man/pass.1 -+++ man/pass.1 -@@ -33,13 +33,6 @@ or - depending on the type of specifier in ARGS. Otherwise COMMAND must be one of - the valid commands listed below. - --Several of the commands below rely on or provide additional functionality if --the password store directory is also a git repository. If the password store --directory is a git repository, all password store modification commands will --cause a corresponding git commit. See the \fIEXTENDED GIT EXAMPLE\fP section --for a detailed description using \fBinit\fP and --.BR git (1). -- - The \fBinit\fP command must be run before other commands in order to initialize - the password store with the correct gpg key id. Passwords are encrypting using - the gpg key set with \fBinit\fP. -@@ -109,13 +102,6 @@ alternatively named \fBremove\fP or \fBdelete\fP. If \fI--recursive\fP or \fI-r\ - is specified, delete pass-name recursively if it is a directory. If \fI--force\fP - or \fI-f\fP is specified, do not interactively prompt before removal. - .TP --\fBgit\fP \fIgit-command-args\fP... --If the password store is a git repository, pass \fIgit-command-args\fP as arguments to --.BR git (1) --using the password store as the git repository. If \fIgit-command-args\fP is \fBinit\fP, --in addition to initializing the git repository, add the current contents of the password --store to the repository in an initial commit. --.TP - \fBhelp\fP - Show usage message. - .TP -@@ -221,99 +207,6 @@ rm: remove regular file \[u2018]/home/zx2c4/.password-store/Business/cheese-whiz - .br - removed \[u2018]/home/zx2c4/.password-store/Business/cheese-whiz-factory.gpg\[u2019] - --.SH EXTENDED GIT EXAMPLE --Here, we initialize new password store, create a git repository, and then manipulate and sync passwords. Make note of the arguments to the first call of \fBpass git push\fP; consult --.BR git-push (1) --for more information. -- --.B zx2c4@laptop ~ $ pass init Jason@zx2c4.com --.br --mkdir: created directory \[u2018]/home/zx2c4/.password-store\[u2019] --.br --Password store initialized for Jason@zx2c4.com. -- --.B zx2c4@laptop ~ $ pass git init --.br --Initialized empty Git repository in /home/zx2c4/.password-store/.git/ --.br --[master (root-commit) 998c8fd] Added current contents of password store. --.br -- 1 file changed, 1 insertion(+) --.br -- create mode 100644 .gpg-id -- --.B zx2c4@laptop ~ $ pass git remote add origin kexec.com:pass-store -- --.B zx2c4@laptop ~ $ pass generate Amazon/amazonemail@email.com 21 --.br --mkdir: created directory \[u2018]/home/zx2c4/.password-store/Amazon\[u2019] --.br --[master 30fdc1e] Added generated password for Amazon/amazonemail@email.com to store. --.br --1 file changed, 0 insertions(+), 0 deletions(-) --.br --create mode 100644 Amazon/amazonemail@email.com.gpg --.br --The generated password to Amazon/amazonemail@email.com is: --.br --<5m,_BrZY`antNDxKN<0A -- --.B zx2c4@laptop ~ $ pass git push -u --all --.br --Counting objects: 4, done. --.br --Delta compression using up to 2 threads. --.br --Compressing objects: 100% (3/3), done. --.br --Writing objects: 100% (4/4), 921 bytes, done. --.br --Total 4 (delta 0), reused 0 (delta 0) --.br --To kexec.com:pass-store --.br --* [new branch] master -> master --.br --Branch master set up to track remote branch master from origin. -- --.B zx2c4@laptop ~ $ pass insert Amazon/otheraccount@email.com --.br --Enter password for Amazon/otheraccount@email.com: som3r3a11yb1gp4ssw0rd!!88** --.br --[master b9b6746] Added given password for Amazon/otheraccount@email.com to store. --.br --1 file changed, 0 insertions(+), 0 deletions(-) --.br --create mode 100644 Amazon/otheraccount@email.com.gpg -- --.B zx2c4@laptop ~ $ pass rm Amazon/amazonemail@email.com --.br --rm: remove regular file \[u2018]/home/zx2c4/.password-store/Amazon/amazonemail@email.com.gpg\[u2019]? y --.br --removed \[u2018]/home/zx2c4/.password-store/Amazon/amazonemail@email.com.gpg\[u2019] --.br --rm 'Amazon/amazonemail@email.com.gpg' --.br --[master 288b379] Removed Amazon/amazonemail@email.com from store. --.br --1 file changed, 0 insertions(+), 0 deletions(-) --.br --delete mode 100644 Amazon/amazonemail@email.com.gpg -- --.B zx2c4@laptop ~ $ pass git push --.br --Counting objects: 9, done. --.br --Delta compression using up to 2 threads. --.br --Compressing objects: 100% (5/5), done. --.br --Writing objects: 100% (7/7), 1.25 KiB, done. --.br --Total 7 (delta 0), reused 0 (delta 0) --.br --To kexec.com:pass-store -- - .SH FILES - - .TP -@@ -333,18 +226,12 @@ Overrides the default password storage directory. - .I PASSWORD_STORE_KEY - Overrides the default gpg key identification set by \fBinit\fP. - .TP --.I PASSWORD_STORE_GIT --Overrides the default root of the git repository, which is helpful if --\fIPASSWORD_STORE_DIR\fP is temporarily set to a sub-directory of the default --password store. --.TP - .I EDITOR - The location of the text editor used by \fBedit\fP. - - .SH SEE ALSO - .BR gpg2 (1), - .BR pwgen (1), --.BR git (1), - .BR xclip (1). - - .SH AUTHOR -diff --git src/password-store.sh src/password-store.sh -index 26a4bd0..cc9dd22 100755 ---- src/password-store.sh -+++ src/password-store.sh -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/usr/local/bin/bash - - # Copyright (C) 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. - # This file is licensed under the GPLv2+. Please see COPYING for more information. -@@ -7,12 +7,8 @@ umask 077 - - PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - ID="$PREFIX/.gpg-id" --GIT_DIR="${PASSWORD_STORE_GIT:-$PREFIX}/.git" - GPG_OPTS="--quiet --yes --batch" - --export GIT_DIR --export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}" -- - version() { - cat <<_EOF - |-----------------------| -@@ -50,9 +46,6 @@ Usage: - Prompt before overwriting existing password unless forced. - $program rm [--recursive,-r] [--force,-f] pass-name - Remove existing password or directory, optionally forcefully. -- $program git git-command-args... -- If the password store is a git repository, execute a git command -- specified by git-command-args. - $program help - Show this text. - $program version -@@ -63,16 +56,10 @@ _EOF - } - is_command() { - case "$1" in -- init|ls|list|show|insert|edit|generate|remove|rm|delete|git|help|--help|version|--version) return 0 ;; -+ init|ls|list|show|insert|edit|generate|remove|rm|delete|help|--help|version|--version) return 0 ;; - *) return 1 ;; - esac - } --git_add_file() { -- [[ -d $GIT_DIR ]] || return -- git add "$1" || return -- [[ -n $(git status --porcelain "$1") ]] || return -- git commit -m "$2" --} - yesno() { - read -p "$1 [y/N] " response - [[ $response == "y" || $response == "Y" ]] || exit 1 -@@ -108,20 +95,20 @@ clip() { - echo "Copied $2 to clipboard. Will clear in 45 seconds." - } - tmpdir() { -- if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then -- tmp_dir="$(TMPDIR=/dev/shm mktemp -t "$template" -d)" -+ ramdisk="/var/tmp/password-store.ramdisk" -+ if [[ -d $ramdisk && -d $ramdisk && -d $ramdisk ]]; then -+ tmp_dir="$(TMPDIR=$ramdisk mktemp -t "$template" -d)" - else -- yesno "$(echo "Your system does not have /dev/shm, which means that it may" -- echo "be difficult to entirely erase the temporary non-encrypted" -- echo "password file after editing. Are you sure you would like to" -- echo -n "continue?")" -+ yesno "$(echo "A ramdisk does not exist at $ramdisk, which means that it may" -+ echo "be difficult to entirely erase the temporary non-encrypted" -+ echo "password file after editing. Are you sure you would like to" -+ echo -n "continue?")" -+ - tmp_dir="$(mktemp -t "$template" -d)" - fi -- - } --GETOPT="getopt" - --# source /path/to/platform-defined-functions -+GETOPT="/usr/local/bin/getopt" - # - # END Platform definable - # -@@ -155,14 +142,12 @@ case "$command" in - mkdir -v -p "$PREFIX" - echo "$gpg_id" > "$ID" - echo "Password store initialized for $gpg_id." -- git_add_file "$ID" "Set GPG id to $gpg_id." - - if [[ $reencrypt -eq 1 ]]; then - find "$PREFIX" -iname '*.gpg' | while read passfile; do - gpg2 -d $GPG_OPTS "$passfile" | gpg2 -e -r "$gpg_id" -o "$passfile.new" $GPG_OPTS && - mv -v "$passfile.new" "$passfile" - done -- git_add_file "$PREFIX" "Reencrypted entire store using new GPG id $gpg_id." - fi - exit 0 - ;; -@@ -276,7 +261,6 @@ case "$command" in - read -r -p "Enter password for $path: " -e password - gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password" - fi -- git_add_file "$passfile" "Added given password for $path to store." - ;; - edit) - if [[ $# -ne 1 ]]; then -@@ -304,7 +288,6 @@ case "$command" in - echo "GPG encryption failed. Retrying." - sleep 1 - done -- git_add_file "$passfile" "$action password for $path using ${EDITOR:-vi}." - ;; - generate) - clip=0 -@@ -339,7 +322,6 @@ case "$command" in - pass="$(pwgen -s $symbols $length 1)" - [[ -n $pass ]] || exit 1 - gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass" -- git_add_file "$passfile" "Added generated password for $path to store." - - if [[ $clip -eq 0 ]]; then - echo "The generated password to $path is:" -@@ -378,21 +360,6 @@ case "$command" in - [[ $force -eq 1 ]] || yesno "Are you sure you would like to delete $path?" - - rm $recursive -f -v "$passfile" -- if [[ -d $GIT_DIR && ! -e $passfile ]]; then -- git rm -qr "$passfile" -- git commit -m "Removed $path from store." -- fi -- ;; -- git) -- if [[ $1 == "init" ]]; then -- git "$@" || exit 1 -- git_add_file "$PREFIX" "Added current contents of password store." -- elif [[ -d $GIT_DIR ]]; then -- exec git "$@" -- else -- echo "Error: the password store is not a git repository." -- exit 1 -- fi - ;; - *) - usage diff --git a/sysutils/password-store/files/linuxism+xclip.patch b/sysutils/password-store/files/linuxism+xclip.patch deleted file mode 100644 index cd7356ee9de9..000000000000 --- a/sysutils/password-store/files/linuxism+xclip.patch +++ /dev/null @@ -1,321 +0,0 @@ -diff --git README README -index 47ed64b..496c37f 100644 ---- README -+++ README -@@ -19,8 +19,6 @@ Depends on: - http://www.gnupg.org/ - - git - http://www.git-scm.com/ --- xclip -- http://sourceforge.net/projects/xclip/ - - pwgen - http://sourceforge.net/projects/pwgen/ - - tree -diff --git contrib/pass.bash-completion contrib/pass.bash-completion -index d0ef012..7b3c149 100644 ---- contrib/pass.bash-completion -+++ contrib/pass.bash-completion -@@ -59,7 +59,6 @@ _pass() - _pass_complete_entries - ;; - show|-*) -- COMPREPLY+=($(compgen -W "-c --clip" -- ${cur})) - _pass_complete_entries 1 - ;; - insert) -@@ -67,7 +66,7 @@ _pass() - _pass_complete_entries - ;; - generate) -- COMPREPLY+=($(compgen -W "-n --no-symbols -c --clip -f --force" -- ${cur})) -+ COMPREPLY+=($(compgen -W "-n --no-symbols -f --force" -- ${cur})) - _pass_complete_entries - ;; - rm|remove|delete) -diff --git contrib/pass.fish-completion contrib/pass.fish-completion -index 9130d1f..8998d96 100644 ---- contrib/pass.fish-completion -+++ contrib/pass.fish-completion -@@ -76,7 +76,6 @@ complete -c $PROG -f -A -n '__fish_pass_uses_command insert' -a "(__fish_pass_pr - - complete -c $PROG -f -A -n '__fish_pass_needs_command' -a generate -d 'Command: generate new password' - complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s n -l no-symbols -d 'Do not use special symbols' --complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s c -l clip -d 'Put the password in clipboard' - complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s f -l force -d 'Do not prompt before overwritting' - complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -a "(__fish_pass_print_entry_dirs)" - -@@ -89,13 +88,10 @@ complete -c $PROG -f -A -n '__fish_pass_needs_command' -a edit -d 'Command: edit - complete -c $PROG -f -A -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)" - - complete -c $PROG -f -A -n '__fish_pass_needs_command' -a show -d 'Command: show existing password' --complete -c $PROG -f -A -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard' - complete -c $PROG -f -A -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)" - # When no command is given, `show` is defaulted. --complete -c $PROG -f -A -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard' - complete -c $PROG -f -A -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" - complete -c $PROG -f -A -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" --complete -c $PROG -f -A -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" - - complete -c $PROG -f -A -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' - complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'init' -d 'Initialize git repository' -diff --git contrib/pass.zsh-completion contrib/pass.zsh-completion -index 848bc67..9855ac0 100644 ---- contrib/pass.zsh-completion -+++ contrib/pass.zsh-completion -@@ -39,8 +39,6 @@ _pass () { - _arguments : \ - "-n[don't include symbols in password]" \ - "--no-symbols[don't include symbols in password]" \ -- "-c[copy password to the clipboard]" \ -- "--clip[copy password to the clipboard]" - _pass_complete_entries_with_subdirs - ;; - rm) -@@ -90,9 +88,6 @@ _pass () { - } - - _pass_cmd_show () { -- _arguments : \ -- "-c[put it on the clipboard]" \ -- "--clip[put it on the clipboard]" - _pass_complete_entries - } - _pass_complete_entries_helper () { -diff --git man/pass.1 man/pass.1 -index efb5d9b..bc65a54 100644 ---- man/pass.1 -+++ man/pass.1 -@@ -68,12 +68,8 @@ by using the - .BR tree (1) - program. This command is alternatively named \fBlist\fP. - .TP --\fBshow\fP [ \fI--clip\fP, \fI-c\fP ] \fIpass-name\fP --Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP --is specified, do not print the password but instead copy the first line to the --clipboard using --.BR xclip (1) --and then restore the clipboard after 45 seconds. -+\fBshow\fP \fIpass-name\fP -+Decrypt and print a password named \fIpass-name\fP. - .TP - \fBinsert\fP [ \fI--echo\fP, \fI-e\fP | \fI--multiline\fP, \fI-m\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP - Insert a new password into the password store called \fIpass-name\fP. This will -@@ -92,15 +88,12 @@ ensure that temporary files are created in \fI/dev/shm\fP in order to avoid writ - difficult-to-erase disk sectors. If \fI/dev/shm\fP is not accessible, fallback to - the ordinary \fITMPDIR\fP location, and print a warning. - .TP --\fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--clip\fP, \fI-c\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name pass-length\fP -+\fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name pass-length\fP - Generate a new password using - .BR pwgen (1) - of length \fIpass-length\fP and insert into \fIpass-name\fP. If \fI--no-symbols\fP or \fI-n\fP - is specified, do not use any non-alphanumeric characters in the generated password. --If \fI--clip\fP or \fI-c\fP is specified, do not print the password but instead copy --it to the clipboard using --.BR xclip (1) --and then restore the clipboard after 45 seconds. Prompt before overwriting an existing password, -+Prompt before overwriting an existing password, - unless \fI--force\fP or \fI-f\fP is specified. - .TP - \fBrm\fP [ \fI--recursive\fP, \fI-r\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP -@@ -166,11 +159,6 @@ Show existing password - .br - sup3rh4x3rizmynam3 - .TP --Copy existing password to clipboard --.B zx2c4@laptop ~ $ pass -c Email/zx2c4.com --.br --Copied Email/jason@zx2c4.com to clipboard. Will clear in 45 seconds. --.TP - Add password to store - .B zx2c4@laptop ~ $ pass insert Business/cheese-whiz-factory - .br -@@ -209,10 +197,8 @@ The generated password to Email/jasondonenfeld.com is: - .br - YqFsMkBeO6di - .TP --Generate new password and copy it to the clipboard --.B zx2c4@laptop ~ $ pass -c generate Email/jasondonenfeld.com 19 --.br --Copied Email/jasondonenfeld.com to clipboard. Will clear in 45 seconds. -+Generate new password -+.B zx2c4@laptop ~ $ pass generate Email/jasondonenfeld.com 19 - .TP - Remove password from store - .B zx2c4@laptop ~ $ pass remove Business/cheese-whiz-factory -@@ -345,7 +331,6 @@ The location of the text editor used by \fBedit\fP. - .BR gpg2 (1), - .BR pwgen (1), - .BR git (1), --.BR xclip (1). - - .SH AUTHOR - .B pass -diff --git src/password-store.sh src/password-store.sh -index 26a4bd0..fe79c82 100755 ---- src/password-store.sh -+++ src/password-store.sh -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/usr/local/bin/bash - - # Copyright (C) 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. - # This file is licensed under the GPLv2+. Please see COPYING for more information. -@@ -35,18 +35,18 @@ Usage: - Optionally reencrypt existing passwords using new gpg-id. - $program [ls] [subfolder] - List passwords. -- $program [show] [--clip,-c] pass-name -- Show existing password and optionally put it on the clipboard. -- If put on the clipboard, it will be cleared in 45 seconds. -+ $program [show] pass-name -+ Show existing password - $program insert [--echo,-e | --multiline,-m] [--force,-f] pass-name - Insert new password. Optionally, the console can be enabled echo - the password back. Or, optionally, it may be multiline. Prompt -+ Insert new password. Optionally, the console can be enabled to not -+ echo the password back. Or, optionally, it may be multiline. Prompt - before overwriting existing password unless forced. - $program edit pass-name - Insert a new password or edit an existing password using ${EDITOR:-vi}. -- $program generate [--no-symbols,-n] [--clip,-c] [--force,-f] pass-name pass-length -+ $program generate [--no-symbols,-n] [--force,-f] pass-name pass-length - Generate a new password of pass-length with optionally no symbols. -- Optionally put it on the clipboard and clear board after 45 seconds. - Prompt before overwriting existing password unless forced. - $program rm [--recursive,-r] [--force,-f] pass-name - Remove existing password or directory, optionally forcefully. -@@ -80,48 +80,21 @@ yesno() { - # - # BEGIN Platform definable - # --clip() { -- # This base64 business is a disgusting hack to deal with newline inconsistancies -- # in shell. There must be a better way to deal with this, but because I'm a dolt, -- # we're going with this for now. -- -- before="$(xclip -o -selection clipboard | base64)" -- echo -n "$1" | xclip -selection clipboard -- ( -- sleep 45 -- now="$(xclip -o -selection clipboard | base64)" -- if [[ $now != $(echo -n "$1" | base64) ]]; then -- before="$now" -- fi -- -- # It might be nice to programatically check to see if klipper exists, -- # as well as checking for other common clipboard managers. But for now, -- # this works fine -- if qdbus isn't there or if klipper isn't running, -- # this essentially becomes a no-op. -- # -- # Clipboard managers frequently write their history out in plaintext, -- # so we axe it here: -- qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null -- -- echo "$before" | base64 -d | xclip -selection clipboard -- ) & disown -- echo "Copied $2 to clipboard. Will clear in 45 seconds." --} - tmpdir() { -- if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then -- tmp_dir="$(TMPDIR=/dev/shm mktemp -t "$template" -d)" -+ ramdisk="/var/tmp/password-store.ramdisk" -+ if [[ -d $ramdisk && -d $ramdisk && -d $ramdisk ]]; then -+ tmp_dir="$(TMPDIR=$ramdisk mktemp -t "$template" -d)" - else -- yesno "$(echo "Your system does not have /dev/shm, which means that it may" -- echo "be difficult to entirely erase the temporary non-encrypted" -- echo "password file after editing. Are you sure you would like to" -- echo -n "continue?")" -+ yesno "$(echo "A ramdisk does not exist at $ramdisk, which means that it may" -+ echo "be difficult to entirely erase the temporary non-encrypted" -+ echo "password file after editing. Are you sure you would like to" -+ echo -n "continue?")" -+ - tmp_dir="$(mktemp -t "$template" -d)" - fi -- - } --GETOPT="getopt" - --# source /path/to/platform-defined-functions -+GETOPT="/usr/local/bin/getopt" - # - # END Platform definable - # -@@ -191,18 +164,8 @@ fi - - case "$command" in - show|ls|list) -- clip=0 -- -- opts="$($GETOPT -o c -l clip -n "$program" -- "$@")" -- err=$? -- eval set -- "$opts" -- while true; do case $1 in -- -c|--clip) clip=1; shift ;; -- --) shift; break ;; -- esac done -- - if [[ $err -ne 0 ]]; then -- echo "Usage: $program $command [--clip,-c] [pass-name]" -+ echo "Usage: $program $command [pass-name]" - exit 1 - fi - -@@ -220,13 +183,8 @@ case "$command" in - echo "$path is not in the password store." - exit 1 - fi -- if [[ $clip -eq 0 ]]; then -- exec gpg2 -d $GPG_OPTS "$passfile" -- else -- pass="$(gpg2 -d $GPG_OPTS "$passfile" | head -n 1)" -- [[ -n $pass ]] || exit 1 -- clip "$pass" "$path" -- fi -+ -+ gpg2 -d $GPG_OPTS "$passfile" - fi - ;; - insert) -@@ -307,22 +265,20 @@ case "$command" in - git_add_file "$passfile" "$action password for $path using ${EDITOR:-vi}." - ;; - generate) -- clip=0 - force=0 - symbols="-y" - -- opts="$($GETOPT -o ncf -l no-symbols,clip,force -n "$program" -- "$@")" -+ opts="$($GETOPT -o ncf -l no-symbols,force -n "$program" -- "$@")" - err=$? - eval set -- "$opts" - while true; do case $1 in - -n|--no-symbols) symbols=""; shift ;; -- -c|--clip) clip=1; shift ;; - -f|--force) force=1; shift ;; - --) shift; break ;; - esac done - - if [[ $err -ne 0 || $# -ne 2 ]]; then -- echo "Usage: $program $command [--no-symbols,-n] [--clip,-c] [--force,-f] pass-name pass-length" -+ echo "Usage: $program $command [--no-symbols,-n] [--force,-f] pass-name pass-length" - exit 1 - fi - path="$1" -@@ -341,12 +297,8 @@ case "$command" in - gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass" - git_add_file "$passfile" "Added generated password for $path to store." - -- if [[ $clip -eq 0 ]]; then -- echo "The generated password to $path is:" -- echo "$pass" -- else -- clip "$pass" "$path" -- fi -+ echo "The generated password to $path is:" -+ echo "$pass" - ;; - delete|rm|remove) - recursive="" diff --git a/sysutils/password-store/files/linuxism.patch b/sysutils/password-store/files/linuxism.patch deleted file mode 100644 index 24b69ba078d6..000000000000 --- a/sysutils/password-store/files/linuxism.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git src/password-store.sh src/password-store.sh -index 26a4bd0..4e0526d 100755 ---- src/password-store.sh -+++ src/password-store.sh -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/usr/local/bin/bash - - # Copyright (C) 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. - # This file is licensed under the GPLv2+. Please see COPYING for more information. -@@ -108,20 +108,20 @@ clip() { - echo "Copied $2 to clipboard. Will clear in 45 seconds." - } - tmpdir() { -- if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then -- tmp_dir="$(TMPDIR=/dev/shm mktemp -t "$template" -d)" -+ ramdisk="/var/tmp/password-store.ramdisk" -+ if [[ -d $ramdisk && -d $ramdisk && -d $ramdisk ]]; then -+ tmp_dir="$(TMPDIR=$ramdisk mktemp -t "$template" -d)" - else -- yesno "$(echo "Your system does not have /dev/shm, which means that it may" -- echo "be difficult to entirely erase the temporary non-encrypted" -- echo "password file after editing. Are you sure you would like to" -- echo -n "continue?")" -+ yesno "$(echo "A ramdisk does not exist at $ramdisk, which means that it may" -+ echo "be difficult to entirely erase the temporary non-encrypted" -+ echo "password file after editing. Are you sure you would like to" -+ echo -n "continue?")" -+ - tmp_dir="$(mktemp -t "$template" -d)" - fi -- - } --GETOPT="getopt" - --# source /path/to/platform-defined-functions -+GETOPT="/usr/local/bin/getopt" - # - # END Platform definable - # diff --git a/sysutils/password-store/files/xclip.patch b/sysutils/password-store/files/xclip.patch new file mode 100644 index 000000000000..a34b2c3abcf6 --- /dev/null +++ b/sysutils/password-store/files/xclip.patch @@ -0,0 +1,303 @@ +diff --git a/README b/README +index 8bee02a..fb011aa 100644 +--- a/README ++++ b/README +@@ -19,8 +19,6 @@ Depends on: + http://www.gnupg.org/ + - git + http://www.git-scm.com/ +-- xclip +- http://sourceforge.net/projects/xclip/ + - pwgen + http://sourceforge.net/projects/pwgen/ + - tree >= 1.7.0 +diff --git a/man/pass.1 b/man/pass.1 +index 42d9aec..6608de2 100644 +--- a/man/pass.1 ++++ b/man/pass.1 +@@ -86,12 +86,8 @@ List names of passwords inside the tree that match \fIpass-names\fP by using the + .BR tree (1) + program. This command is alternatively named \fBsearch\fP. + .TP +-\fBshow\fP [ \fI--clip\fP, \fI-c\fP ] \fIpass-name\fP +-Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP +-is specified, do not print the password but instead copy the first line to the +-clipboard using +-.BR xclip (1) +-and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. ++\fBshow\fP \fIpass-name\fP ++Decrypt and print a password named \fIpass-name\fP. + .TP + \fBinsert\fP [ \fI--echo\fP, \fI-e\fP | \fI--multiline\fP, \fI-m\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP + Insert a new password into the password store called \fIpass-name\fP. This will +@@ -110,15 +106,11 @@ ensure that temporary files are created in \fI/dev/shm\fP in order to avoid writ + difficult-to-erase disk sectors. If \fI/dev/shm\fP is not accessible, fallback to + the ordinary \fITMPDIR\fP location, and print a warning. + .TP +-\fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--clip\fP, \fI-c\fP ] [ \fI--in-place\fP, \fI-i\fP | \fI--force\fP, \fI-f\fP ] \fIpass-name pass-length\fP ++\fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--in-place\fP, \fI-i\fP | \fI--force\fP, \fI-f\fP ] \fIpass-name pass-length\fP + Generate a new password using + .BR pwgen (1) + of length \fIpass-length\fP and insert into \fIpass-name\fP. If \fI--no-symbols\fP or \fI-n\fP + is specified, do not use any non-alphanumeric characters in the generated password. +-If \fI--clip\fP or \fI-c\fP is specified, do not print the password but instead copy +-it to the clipboard using +-.BR xclip (1) +-and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. + Prompt before overwriting an existing password, + unless \fI--force\fP or \fI-f\fP is specified. If \fI--in-place\fP or \fI-i\fP is + specified, do not interactively prompt, and only replace the first line of the password +@@ -223,11 +215,6 @@ Show existing password + .br + sup3rh4x3rizmynam3 + .TP +-Copy existing password to clipboard +-.B zx2c4@laptop ~ $ pass -c Email/zx2c4.com +-.br +-Copied Email/jason@zx2c4.com to clipboard. Will clear in 45 seconds. +-.TP + Add password to store + .B zx2c4@laptop ~ $ pass insert Business/cheese-whiz-factory + .br +@@ -266,10 +253,8 @@ The generated password to Email/jasondonenfeld.com is: + .br + YqFsMkBeO6di + .TP +-Generate new password and copy it to the clipboard +-.B zx2c4@laptop ~ $ pass generate -c Email/jasondonenfeld.com 19 +-.br +-Copied Email/jasondonenfeld.com to clipboard. Will clear in 45 seconds. ++Generate new password ++.B zx2c4@laptop ~ $ pass generate Email/jasondonenfeld.com 19 + .TP + Remove password from store + .B zx2c4@laptop ~ $ pass remove Business/cheese-whiz-factory +@@ -399,15 +384,6 @@ Overrides the default root of the git repository, which is helpful if + \fIPASSWORD_STORE_DIR\fP is temporarily set to a sub-directory of the default + password store. + .TP +-.I PASSWORD_STORE_X_SELECTION +-Overrides the selection passed to \fBxclip\fP, by default \fIclipboard\fP. See +-.BR xclip (1) +-for more info. +-.TP +-.I PASSWORD_STORE_CLIP_TIME +-Specifies the number of seconds to wait before restoring the clipboard, by default +-\fI45\fP seconds. +-.TP + .I PASSWORD_STORE_UMASK + Sets the umask of all files modified by pass, by default \fI077\fP. + .TP +@@ -417,7 +393,6 @@ The location of the text editor used by \fBedit\fP. + .BR gpg2 (1), + .BR pwgen (1), + .BR git (1), +-.BR xclip (1). + + .SH AUTHOR + .B pass +diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion +index ea31fbf..86860cb 100644 +--- a/src/completion/pass.bash-completion ++++ b/src/completion/pass.bash-completion +@@ -78,7 +78,6 @@ _pass() + _pass_complete_entries + ;; + show|-*) +- COMPREPLY+=($(compgen -W "-c --clip" -- ${cur})) + _pass_complete_entries 1 + ;; + insert) +@@ -86,7 +85,7 @@ _pass() + _pass_complete_entries + ;; + generate) +- COMPREPLY+=($(compgen -W "-n --no-symbols -c --clip -f --force -i --in-place" -- ${cur})) ++ COMPREPLY+=($(compgen -W "-n --no-symbols -f --force -i --in-place" -- ${cur})) + _pass_complete_entries + ;; + cp|copy|mv|rename) +diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion +index c32a42c..abcff4d 100644 +--- a/src/completion/pass.fish-completion ++++ b/src/completion/pass.fish-completion +@@ -75,7 +75,6 @@ complete -c $PROG -f -A -n '__fish_pass_uses_command insert' -a "(__fish_pass_pr + + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a generate -d 'Command: generate new password' + complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s n -l no-symbols -d 'Do not use special symbols' +-complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s c -l clip -d 'Put the password in clipboard' + complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s f -l force -d 'Do not prompt before overwritting' + complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -s i -l in-place -d 'Replace only the first line with the generated password' + complete -c $PROG -f -A -n '__fish_pass_uses_command generate' -a "(__fish_pass_print_entry_dirs)" +@@ -97,13 +96,10 @@ complete -c $PROG -f -A -n '__fish_pass_needs_command' -a edit -d 'Command: edit + complete -c $PROG -f -A -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)" + + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a show -d 'Command: show existing password' +-complete -c $PROG -f -A -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard' + complete -c $PROG -f -A -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)" + # When no command is given, `show` is defaulted. +-complete -c $PROG -f -A -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard' + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" + complete -c $PROG -f -A -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" +-complete -c $PROG -f -A -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" + + complete -c $PROG -f -A -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' + complete -c $PROG -f -A -n '__fish_pass_uses_command git' -a 'init' -d 'Initialize git repository' +diff --git a/src/completion/pass.zsh-completion b/src/completion/pass.zsh-completion +index b658398..0ab3e43 100644 +--- a/src/completion/pass.zsh-completion ++++ b/src/completion/pass.zsh-completion +@@ -41,8 +41,6 @@ _pass () { + _arguments : \ + "-n[don't include symbols in password]" \ + "--no-symbols[don't include symbols in password]" \ +- "-c[copy password to the clipboard]" \ +- "--clip[copy password to the clipboard]" \ + "-f[force overwrite]" \ + "--force[force overwrite]" \ + "-i[replace first line]" \ +@@ -106,9 +104,6 @@ _pass () { + } + + _pass_cmd_show () { +- _arguments : \ +- "-c[put it on the clipboard]" \ +- "--clip[put it on the clipboard]" + _pass_complete_entries + } + _pass_complete_entries_helper () { +diff --git a/src/password-store.sh b/src/password-store.sh +index 460aa63..587317a 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -12,8 +12,6 @@ which gpg2 &>/dev/null && GPG="gpg2" + [[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" ) + + PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" +-X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" +-CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}" + + export GIT_DIR="${PASSWORD_STORE_GIT:-$PREFIX}/.git" + export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}" +@@ -135,33 +133,6 @@ check_sneaky_paths() { + # BEGIN platform definable + # + +-clip() { +- # This base64 business is because bash cannot store binary data in a shell +- # variable. Specifically, it cannot store nulls nor (non-trivally) store +- # trailing new lines. +- +- local sleep_argv0="password store sleep on display $DISPLAY" +- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 +- local before="$(xclip -o -selection "$X_SELECTION" | base64)" +- echo -n "$1" | xclip -selection "$X_SELECTION" +- ( +- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) +- local now="$(xclip -o -selection "$X_SELECTION" | base64)" +- [[ $now != $(echo -n "$1" | base64) ]] && before="$now" +- +- # It might be nice to programatically check to see if klipper exists, +- # as well as checking for other common clipboard managers. But for now, +- # this works fine -- if qdbus isn't there or if klipper isn't running, +- # this essentially becomes a no-op. +- # +- # Clipboard managers frequently write their history out in plaintext, +- # so we axe it here: +- qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null +- +- echo "$before" | base64 -d | xclip -selection "$X_SELECTION" +- ) 2>/dev/null & disown +- echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." +-} + tmpdir() { + local warn=1 + [[ $1 == "nowarn" ]] && warn=0 +@@ -222,9 +193,8 @@ cmd_usage() { + List passwords. + $PROGRAM find pass-names... + List passwords that match pass-names. +- $PROGRAM [show] [--clip,-c] pass-name +- Show existing password and optionally put it on the clipboard. +- If put on the clipboard, it will be cleared in $CLIP_TIME seconds. ++ $PROGRAM [show] pass-name ++ Show existing password. + $PROGRAM grep search-string + Search for password files containing search-string when decrypted. + $PROGRAM insert [--echo,-e | --multiline,-m] [--force,-f] pass-name +@@ -233,9 +203,8 @@ cmd_usage() { + overwriting existing password unless forced. + $PROGRAM edit pass-name + Insert a new password or edit an existing password using ${EDITOR:-vi}. +- $PROGRAM generate [--no-symbols,-n] [--clip,-c] [--in-place,-i | --force,-f] pass-name pass-length ++ $PROGRAM generate [--no-symbols,-n] [--in-place,-i | --force,-f] pass-name pass-length + Generate a new password of pass-length with optionally no symbols. +- Optionally put it on the clipboard and clear board after 45 seconds. + Prompt before overwriting existing password unless forced. + Optionally replace only the first line of an existing file with a new password. + $PROGRAM rm [--recursive,-r] [--force,-f] pass-name +@@ -294,28 +263,11 @@ cmd_init() { + } + + cmd_show() { +- local opts clip=0 +- opts="$($GETOPT -o c -l clip -n "$PROGRAM" -- "$@")" +- local err=$? +- eval set -- "$opts" +- while true; do case $1 in +- -c|--clip) clip=1; shift ;; +- --) shift; break ;; +- esac done +- +- [[ $err -ne 0 ]] && die "Usage: $PROGRAM $COMMAND [--clip,-c] [pass-name]" +- + local path="$1" + local passfile="$PREFIX/$path.gpg" + check_sneaky_paths "$path" + if [[ -f $passfile ]]; then +- if [[ $clip -eq 0 ]]; then + exec $GPG -d "${GPG_OPTS[@]}" "$passfile" +- else +- local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n 1)" +- [[ -n $pass ]] || exit 1 +- clip "$pass" "$path" +- fi + elif [[ -d $PREFIX/$path ]]; then + if [[ -z $path ]]; then + echo "Password Store" +@@ -434,19 +386,18 @@ cmd_edit() { + } + + cmd_generate() { +- local opts clip=0 force=0 symbols="-y" inplace=0 +- opts="$($GETOPT -o ncif -l no-symbols,clip,in-place,force -n "$PROGRAM" -- "$@")" ++ local opts force=0 symbols="-y" inplace=0 ++ opts="$($GETOPT -o nif -l no-symbols,in-place,force -n "$PROGRAM" -- "$@")" + local err=$? + eval set -- "$opts" + while true; do case $1 in + -n|--no-symbols) symbols=""; shift ;; +- -c|--clip) clip=1; shift ;; + -f|--force) force=1; shift ;; + -i|--in-place) inplace=1; shift ;; + --) shift; break ;; + esac done + +- [[ $err -ne 0 || $# -ne 2 || ( $force -eq 1 && $inplace -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--no-symbols,-n] [--clip,-c] [--in-place,-i | --force,-f] pass-name pass-length" ++ [[ $err -ne 0 || $# -ne 2 || ( $force -eq 1 && $inplace -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--no-symbols,-n] [--in-place,-i | --force,-f] pass-name pass-length" + local path="$1" + local length="$2" + check_sneaky_paths "$path" +@@ -474,11 +425,7 @@ cmd_generate() { + [[ $inplace -eq 1 ]] && verb="Replace" + git_add_file "$passfile" "$verb generated password for ${path}." + +- if [[ $clip -eq 0 ]]; then +- printf "\e[1m\e[37mThe generated password for \e[4m%s\e[24m is:\e[0m\n\e[1m\e[93m%s\e[0m\n" "$path" "$pass" +- else +- clip "$pass" "$path" +- fi ++ printf "\e[1m\e[37mThe generated password for \e[4m%s\e[24m is:\e[0m\n\e[1m\e[93m%s\e[0m\n" "$path" "$pass" + } + + cmd_delete() { diff --git a/sysutils/password-store/pkg-plist b/sysutils/password-store/pkg-plist new file mode 100644 index 000000000000..e54bb4854f98 --- /dev/null +++ b/sysutils/password-store/pkg-plist @@ -0,0 +1,29 @@ +%%CONTRIB%%%%DATADIR%%/dmenu/README.md +%%CONTRIB%%%%DATADIR%%/dmenu/passmenu +%%CONTRIB%%%%DATADIR%%/emacs/.gitignore +%%CONTRIB%%%%DATADIR%%/emacs/Cask +%%CONTRIB%%%%DATADIR%%/emacs/README.md +%%CONTRIB%%%%DATADIR%%/emacs/password-store.el +%%CONTRIB%%%%DATADIR%%/importers/1password2pass.rb +%%CONTRIB%%%%DATADIR%%/importers/fpm2pass.pl +%%CONTRIB%%%%DATADIR%%/importers/gorilla2pass.rb +%%CONTRIB%%%%DATADIR%%/importers/kedpm2pass.py +%%CONTRIB%%%%DATADIR%%/importers/keepass2pass.py +%%CONTRIB%%%%DATADIR%%/importers/keepassx2pass.py +%%CONTRIB%%%%DATADIR%%/importers/kwallet2pass.py +%%CONTRIB%%%%DATADIR%%/importers/lastpass2pass.rb +%%CONTRIB%%%%DATADIR%%/importers/pwsafe2pass.sh +%%CONTRIB%%%%DATADIR%%/importers/revelation2pass.py +%%CONTRIB%%%%DATADIR%%/pass.bash-completion +%%CONTRIB%%%%DATADIR%%/pass.fish-completion +%%CONTRIB%%%%DATADIR%%/pass.zsh-completion +%%CONTRIB%%%%DATADIR%%/related-projects.txt +%%CONTRIB%%@dirrmtry %%DATADIR%% +%%CONTRIB%%@dirrmtry %%DATADIR%%/dmenu +%%CONTRIB%%@dirrmtry %%DATADIR%%/emacs +%%CONTRIB%%@dirrmtry %%DATADIR%%/importers +%%PORTDOCS%%man/man1/pass.1.gz +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example-filter.sh +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%% +bin/pass +libexec/pass |