On Wed, Feb 27, 2013 at 10:19:47PM +0100, Helmut Grohne wrote:
> Tags: patch

I just noticed that this one was missing. Sorry for the noise.

Helmut
diff -Nru password-store-1.4.2/debian/changelog 
password-store-1.4.2/debian/changelog
--- password-store-1.4.2/debian/changelog       2012-11-30 13:19:19.000000000 
+0100
+++ password-store-1.4.2/debian/changelog       2013-02-27 20:02:31.000000000 
+0100
@@ -1,3 +1,10 @@
+password-store (1.4.2-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Support gpg1.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Wed, 27 Feb 2013 20:02:20 +0100
+
 password-store (1.4.2-1) unstable; urgency=low
 
   * New upstream release (closes: #694772).
diff -Nru password-store-1.4.2/debian/control 
password-store-1.4.2/debian/control
--- password-store-1.4.2/debian/control 2012-11-30 13:14:38.000000000 +0100
+++ password-store-1.4.2/debian/control 2013-02-27 20:57:50.000000000 +0100
@@ -8,8 +8,8 @@
 
 Package: pass
 Architecture: all
-Depends: ${misc:Depends}, pwgen, gnupg2, tree
-Recommends: git, xclip
+Depends: ${misc:Depends}, pwgen, gnupg2 | gnupg, tree
+Recommends: gnupg2, git, xclip
 Suggests: perl, libxml-simple-perl, python, ruby
 Description: lightweight directory-based password manager
  Stores, retrieves, generates, and synchronizes passwords securely using
diff -Nru password-store-1.4.2/debian/patches/gnupg1-support 
password-store-1.4.2/debian/patches/gnupg1-support
--- password-store-1.4.2/debian/patches/gnupg1-support  1970-01-01 
01:00:00.000000000 +0100
+++ password-store-1.4.2/debian/patches/gnupg1-support  2013-02-27 
20:55:21.000000000 +0100
@@ -0,0 +1,118 @@
+From: Helmut Grohne <hel...@subdivi.de>
+Subject: support gnupg1 as an alternative to gnupg2
+Last-Update: 2013-02-27
+
+--- password-store-1.4.2.orig/src/password-store.sh
++++ password-store-1.4.2/src/password-store.sh
+@@ -8,7 +8,13 @@ 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"
++if which gpg2 >/dev/null; then
++      GPG=gpg2
++      GPG_OPTS="--quiet --yes --batch"
++else
++      GPG=gpg
++      GPG_OPTS="--quiet --yes"
++fi
+ 
+ export GIT_DIR
+ export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}"
+@@ -159,7 +165,7 @@ case "$command" in
+ 
+               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 &&
++                              $GPG -d $GPG_OPTS "$passfile" | $GPG -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."
+@@ -221,9 +227,9 @@ case "$command" in
+                               exit 1
+                       fi
+                       if [[ $clip -eq 0 ]]; then
+-                              exec gpg2 -d $GPG_OPTS "$passfile"
++                              exec $GPG -d $GPG_OPTS "$passfile"
+                       else
+-                              pass="$(gpg2 -d $GPG_OPTS "$passfile" | head -n 
1)"
++                              pass="$($GPG -d $GPG_OPTS "$passfile" | head -n 
1)"
+                               [[ -n $pass ]] || exit 1
+                               clip "$pass" "$path"
+                       fi
+@@ -258,7 +264,7 @@ case "$command" in
+               if [[ $multiline -eq 1 ]]; then
+                       echo "Enter contents of $path and press Ctrl+D when 
finished:"
+                       echo
+-                      gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS
++                      $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS
+               elif [[ $noecho -eq 1 ]]; then
+                       while true; do
+                               read -r -p "Enter password for $path: " -s 
password
+@@ -266,7 +272,7 @@ case "$command" in
+                               read -r -p "Retype password for $path: " -s 
password_again
+                               echo
+                               if [[ $password == "$password_again" ]]; then
+-                                      gpg2 -e -r "$ID" -o "$passfile" 
$GPG_OPTS <<<"$password"
++                                      $GPG -e -r "$ID" -o "$passfile" 
$GPG_OPTS <<<"$password"
+                                       break
+                               else
+                                       echo "Error: the entered passwords do 
not match."
+@@ -274,7 +280,7 @@ case "$command" in
+                       done
+               else
+                       read -r -p "Enter password for $path: " -e password
+-                      gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password"
++                      $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password"
+               fi
+               git_add_file "$passfile" "Added given password for $path to 
store."
+               ;;
+@@ -296,11 +302,11 @@ case "$command" in
+ 
+               action="Added"
+               if [[ -f $passfile ]]; then
+-                      gpg2 -d -o "$tmp_file" $GPG_OPTS "$passfile" || exit 1
++                      $GPG -d -o "$tmp_file" $GPG_OPTS "$passfile" || exit 1
+                       action="Edited"
+               fi
+               ${EDITOR:-vi} "$tmp_file"
+-              while ! gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS "$tmp_file"; 
do
++              while ! $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS "$tmp_file"; 
do
+                       echo "GPG encryption failed. Retrying."
+                       sleep 1
+               done
+@@ -338,7 +344,7 @@ case "$command" in
+ 
+               pass="$(pwgen -s $symbols $length 1)"
+               [[ -n $pass ]] || exit 1
+-              gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass"
++              $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass"
+               git_add_file "$passfile" "Added generated password for $path to 
store."
+               
+               if [[ $clip -eq 0 ]]; then
+--- password-store-1.4.2.orig/contrib/pass.bash-completion
++++ password-store-1.4.2/contrib/pass.bash-completion
+@@ -39,8 +39,10 @@ _pass_complete_entries () {
+ 
+ _pass_complete_keys () {
+       local IFS=$'\n'
++      local GPG=gpg2
++      which $GPG >/dev/null || GPG=gpg
+       # Extract names and email addresses from gpg --list-keys
+-      local keys="$(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | 
sort -u | sed '/^$/d')"
++      local keys="$($GPG --list-secret-keys --with-colons | cut -d : -f 10 | 
sort -u | sed '/^$/d')"
+       COMPREPLY+=($(compgen -W "${keys}" -- ${cur}))
+ }
+ 
+--- password-store-1.4.2.orig/contrib/pass.zsh-completion
++++ password-store-1.4.2/contrib/pass.zsh-completion
+@@ -111,6 +111,8 @@ _pass_complete_entries () {
+ 
+ _pass_complete_keys () {
+       local IFS=$'\n'
++      local GPG=gpg2
++      which $GPG >/dev/null || GPG=gpg
+       # Extract names and email addresses from gpg --list-keys
+-      _values 'gpg keys' $(gpg2 --list-secret-keys --with-colons | cut -d : 
-f 10 | sort -u | sed '/^$/d')
++      _values 'gpg keys' $($GPG --list-secret-keys --with-colons | cut -d : 
-f 10 | sort -u | sed '/^$/d')
+ }
diff -Nru password-store-1.4.2/debian/patches/series 
password-store-1.4.2/debian/patches/series
--- password-store-1.4.2/debian/patches/series  1970-01-01 01:00:00.000000000 
+0100
+++ password-store-1.4.2/debian/patches/series  2013-02-27 20:51:28.000000000 
+0100
@@ -0,0 +1 @@
+gnupg1-support

Reply via email to