at master 8.8 kB view raw
1diff --git a/Makefile b/Makefile 2index 1ef67c8..d49031a 100644 3--- a/Makefile 4+++ b/Makefile 5@@ -16,5 +16,5 @@ test: kill build 6 setup_gpg: pypass/tests/gnupg 7 pypass/tests/gnupg: pypass/tests/test_key_sec.asc pypass/tests/test_ownertrust.txt 8 mkdir -m 700 -p pypass/tests/gnupg 9- GNUPGHOME=pypass/tests/gnupg gpg --allow-secret-key-import --import pypass/tests/test_key_sec.asc 10- GNUPGHOME=pypass/tests/gnupg gpg --import-ownertrust pypass/tests/test_ownertrust.txt 11+ GNUPGHOME=pypass/tests/gnupg @gpg_exec@ --allow-secret-key-import --import pypass/tests/test_key_sec.asc 12+ GNUPGHOME=pypass/tests/gnupg @gpg_exec@ --import-ownertrust pypass/tests/test_ownertrust.txt 13diff --git a/pypass/command.py b/pypass/command.py 14index 4616a5f..a72cf5d 100644 15--- a/pypass/command.py 16+++ b/pypass/command.py 17@@ -173,7 +173,7 @@ def show(config, path, clip): 18 if clip: 19 xclip = subprocess.Popen( 20 [ 21- 'xclip', 22+ '@xclip_exec@', 23 '-selection', 'clipboard' 24 ], 25 stdin=subprocess.PIPE 26@@ -206,7 +206,7 @@ def connect(config, path): 27 def ls(config, subfolder): 28 tree = subprocess.Popen( 29 [ 30- 'tree', 31+ '@tree_exec@', 32 '-C', 33 '-l', 34 '--noreport', 35@@ -239,7 +239,7 @@ def find(config, search_terms): 36 37 tree = subprocess.Popen( 38 [ 39- 'tree', 40+ '@tree_exec@', 41 '-C', 42 '-l', 43 '--noreport', 44@@ -273,7 +273,7 @@ def grep(config, search_string): 45 config['password_store'].get_decrypted_password(password) 46 47 grep = subprocess.Popen( 48- ['grep', '-e', search_string], 49+ ['@grep_exec@', '-e', search_string], 50 stdout=subprocess.PIPE, 51 stdin=subprocess.PIPE 52 ) 53@@ -397,7 +397,7 @@ def git(config, commands): 54 else: 55 subprocess.call( 56 [ 57- 'git', 58+ '@git_exec@', 59 '--git-dir=%s' % config['password_store'].git_dir, 60 '--work-tree=%s' % config['password_store'].path, 61 ] + command_list, 62diff --git a/pypass/passwordstore.py b/pypass/passwordstore.py 63index 9de0376..8cf20a4 100644 64--- a/pypass/passwordstore.py 65+++ b/pypass/passwordstore.py 66@@ -26,18 +26,7 @@ import re 67 from .entry_type import EntryType 68 69 # Find the right gpg binary 70-if subprocess.call( 71- ['which', 'gpg2'], 72- stdout=subprocess.PIPE, 73- stderr=subprocess.PIPE) == 0: 74- GPG_BIN = 'gpg2' 75-elif subprocess.call( 76- ['which', 'gpg'], 77- stdout=subprocess.PIPE, 78- stderr=subprocess.PIPE) == 0: 79- GPG_BIN = 'gpg' 80-else: 81- raise Exception("Could not find GPG") 82+GPG_BIN = '@gpg_exec@' 83 84 85 class PasswordStore(object): 86@@ -215,7 +204,7 @@ class PasswordStore(object): 87 # Init git repo 88 subprocess.call( 89 [ 90- "git", 91+ "@git_exec@", 92 "--git-dir=%s" % git_dir, 93 "--work-tree=%s" % git_work_tree, 94 "init", path 95@@ -226,7 +215,7 @@ class PasswordStore(object): 96 # Add remote repo 97 subprocess.call( 98 [ 99- "git", 100+ "@git_exec@", 101 "--git-dir=%s" % git_dir, 102 "--work-tree=%s" % git_work_tree, 103 "remote", 104@@ -241,7 +230,7 @@ class PasswordStore(object): 105 # TODO: add parameters for remote and branch ? 106 subprocess.call( 107 [ 108- "git", 109+ "@git_exec@", 110 "--git-dir=%s" % git_dir, 111 "--work-tree=%s" % git_work_tree, 112 "pull", 113@@ -272,7 +261,7 @@ class PasswordStore(object): 114 115 subprocess.call( 116 [ 117- 'git', 118+ '@git_exec@', 119 "--git-dir=%s" % self.git_dir, 120 "--work-tree=%s" % self.path, 121 'init', 122@@ -298,7 +287,7 @@ class PasswordStore(object): 123 124 subprocess.call( 125 [ 126- 'git', 127+ '@git_exec@', 128 "--git-dir=%s" % self.git_dir, 129 "--work-tree=%s" % self.path, 130 'config', 131@@ -311,7 +300,7 @@ class PasswordStore(object): 132 133 subprocess.call( 134 [ 135- 'git', 136+ '@git_exec@', 137 "--git-dir=%s" % self.git_dir, 138 "--work-tree=%s" % self.path, 139 'config', 140@@ -326,7 +315,7 @@ class PasswordStore(object): 141 142 subprocess.call( 143 [ 144- 'git', 145+ '@git_exec@', 146 "--git-dir=%s" % self.git_dir, 147 "--work-tree=%s" % self.path, 148 'add', 149@@ -338,7 +327,7 @@ class PasswordStore(object): 150 if message: 151 subprocess.call( 152 [ 153- 'git', 154+ '@git_exec@', 155 "--git-dir=%s" % self.git_dir, 156 "--work-tree=%s" % self.path, 157 'commit', 158@@ -350,7 +339,7 @@ class PasswordStore(object): 159 else: 160 subprocess.call( 161 [ 162- 'git', 163+ '@git_exec@', 164 "--git-dir=%s" % self.git_dir, 165 "--work-tree=%s" % self.path, 166 'commit' 167diff --git a/pypass/tests/test_command.py b/pypass/tests/test_command.py 168index 4966b34..960a8ed 100644 169--- a/pypass/tests/test_command.py 170+++ b/pypass/tests/test_command.py 171@@ -127,7 +127,7 @@ class TestCommand(unittest.TestCase): 172 173 # Check if the password is in the clipoard 174 xclip = subprocess.Popen( 175- ['xclip', '-o', '-selection', 'clipboard'], 176+ ['@xclip_exec@', '-o', '-selection', 'clipboard'], 177 stdout=subprocess.PIPE) 178 xclip.wait() 179 self.assertEqual(xclip.stdout.read().decode('utf8'), 'clipme999') 180@@ -301,7 +301,7 @@ class TestCommand(unittest.TestCase): 181 # git init should set diff.gpg.binary to True 182 diff_gpg_binary = subprocess.Popen( 183 [ 184- 'git', 185+ '@git_exec@', 186 '--git-dir=%s' % os.path.join(self.dir, '.git'), 187 '--work-tree=%s' % self.dir, 188 'config', 189@@ -317,7 +317,7 @@ class TestCommand(unittest.TestCase): 190 # git init should set diff.gpg.textconv to 'gpg -d' 191 gpg = subprocess.Popen( 192 [ 193- 'git', 194+ '@git_exec@', 195 '--git-dir=%s' % os.path.join(self.dir, '.git'), 196 '--work-tree=%s' % self.dir, 197 'config', 198@@ -337,7 +337,7 @@ class TestCommand(unittest.TestCase): 199 200 subprocess.Popen( 201 [ 202- 'git', 203+ '@git_exec@', 204 '--git-dir=%s' % origin_git_dir, 205 '--work-tree=%s' % origin_dir, 206 'init', 207@@ -350,7 +350,7 @@ class TestCommand(unittest.TestCase): 208 209 subprocess.call( 210 [ 211- 'git', 212+ '@git_exec@', 213 '--git-dir=%s' % origin_git_dir, 214 '--work-tree=%s' % origin_dir, 215 'add', 'test_git_init_clone.gpg', 216@@ -359,7 +359,7 @@ class TestCommand(unittest.TestCase): 217 218 subprocess.call( 219 [ 220- 'git', 221+ '@git_exec@', 222 '--git-dir=%s' % origin_git_dir, 223 '--work-tree=%s' % origin_dir, 224 'commit', 225diff --git a/pypass/tests/test_passwordstore.py b/pypass/tests/test_passwordstore.py 226index 6decc5f..ceb5181 100644 227--- a/pypass/tests/test_passwordstore.py 228+++ b/pypass/tests/test_passwordstore.py 229@@ -171,7 +171,7 @@ class TestPasswordStore(unittest.TestCase): 230 231 subprocess.Popen( 232 [ 233- 'git', 234+ '@git_exec@', 235 '--git-dir=%s' % os.path.join(origin_dir, '.git'), 236 '--work-tree=%s' % origin_dir, 237 'init', 238@@ -184,7 +184,7 @@ class TestPasswordStore(unittest.TestCase): 239 240 subprocess.Popen( 241 [ 242- 'git', 243+ '@git_exec@', 244 '--git-dir=%s' % os.path.join(origin_dir, '.git'), 245 '--work-tree=%s' % origin_dir, 246 'add', 'test_git_init_clone.gpg', 247@@ -193,7 +193,7 @@ class TestPasswordStore(unittest.TestCase): 248 249 subprocess.Popen( 250 [ 251- 'git', 252+ '@git_exec@', 253 '--git-dir=%s' % os.path.join(origin_dir, '.git'), 254 '--work-tree=%s' % origin_dir, 255 'commit',