Explorar el Código

Various bug fixes

Jonas Borgström hace 14 años
padre
commit
bee4c86719
Se han modificado 3 ficheros con 5 adiciones y 4 borrados
  1. 1 1
      darc/archive.py
  2. 1 0
      darc/archiver.py
  3. 3 3
      darc/keychain.py

+ 1 - 1
darc/archive.py

@@ -14,7 +14,7 @@ from .helpers import uid2user, user2uid, gid2group, group2gid, IntegrityError
 CHUNK_SIZE = 55001
 
 have_lchmod = hasattr(os, 'lchmod')
-linux = sys.platform == 'linux'
+linux = sys.platform == 'linux2'
 
 
 class Archive(object):

+ 1 - 0
darc/archiver.py

@@ -50,6 +50,7 @@ class Archiver(object):
         cache = Cache(store, keychain)
         for path in args.paths:
             for path, st in walk_dir(unicode(path)):
+                self.print_verbose(path)
                 if stat.S_ISDIR(st.st_mode):
                     archive.process_dir(path, st)
                 elif stat.S_ISLNK(st.st_mode):

+ 3 - 3
darc/keychain.py

@@ -37,12 +37,12 @@ class Keychain(object):
                 raise ValueError('Not a keychain')
             cdata = fd.read()
         self.password = ''
-        data = self._decrypt(cdata, '')
+        data = self.decrypt_keychain(cdata, '')
         while not data:
             self.password = getpass('Keychain password: ')
             if not self.password:
                 raise Exception('Keychain decryption failed')
-            data = self.decrypt(cdata, self.password)
+            data = self.decrypt_keychain(cdata, self.password)
             if not data:
                 print 'Incorrect password'
         chain = msgpack.unpackb(data)
@@ -71,7 +71,7 @@ class Keychain(object):
         }
         return msgpack.packb(d)
 
-    def _decrypt(self, data, password):
+    def decrypt_keychain(self, data, password):
         d = msgpack.unpackb(data)
         assert d['version'] == 1
         assert d['algorithm'] == 'SHA256'