Jonas Borgström 12 gadi atpakaļ
vecāks
revīzija
b718a443a8

+ 1 - 1
.travis.yml

@@ -7,4 +7,4 @@ install:
   - "pip install --use-mirrors Cython"
   - "pip install --use-mirrors Cython"
   - "pip install -e ."
   - "pip install -e ."
 # command to run tests
 # command to run tests
-script: fakeroot python -m darc.testsuite.run -vb
+script: fakeroot python -m attic.testsuite.run -vb

+ 16 - 16
README.rst

@@ -1,16 +1,16 @@
-What is darc?
--------------
-Darc is a Deduplicating ARChiver written in Python. The main goal of darc is
-to provide an efficient and secure way to backup data. The data deduplication
-technique used makes darc suitable for daily backups since only actual changes
+What is Attic?
+--------------
+Attic is a deduplicating backup program. The main goal of attic is to provide
+an efficient and secure way to backup data. The data deduplication
+technique used makes Attic suitable for daily backups since only actual changes
 are stored.
 are stored.
 
 
 Easy to use
 Easy to use
 ~~~~~~~~~~~
 ~~~~~~~~~~~
 Initialze backup repository and create a backup archive::
 Initialze backup repository and create a backup archive::
 
 
-    $ darc init /usbdrive/my-backup.darc
-    $ darc create -v /usbdrive/my-backup.darc::documents ~/Documents
+    $ attic init /usbdrive/my-backup.attic
+    $ attic create -v /usbdrive/my-backup.attic::documents ~/Documents
 
 
 Main features
 Main features
 ~~~~~~~~~~~~~
 ~~~~~~~~~~~~~
@@ -25,36 +25,36 @@ Optional data encryption
     and authenticity is verified using HMAC-SHA256.
     and authenticity is verified using HMAC-SHA256.
 
 
 Off-site backups
 Off-site backups
-    darc can store data on any remote host accessible over SSH as long as
-    darc is installed.
+    attic can store data on any remote host accessible over SSH as long as
+    attic is installed.
 
 
 What do I need?
 What do I need?
 ---------------
 ---------------
-Darc requires Python 3.2 or above to work. Besides Python darc also requires 
+Attic requires Python 3.2 or above to work. Besides Python attic also requires 
 msgpack-python and sufficiently recent OpenSSL (>= 1.0.0).
 msgpack-python and sufficiently recent OpenSSL (>= 1.0.0).
 
 
 How do I install it?
 How do I install it?
 --------------------
 --------------------
 ::
 ::
 
 
-  $ pip install darc
+  $ pip install Attic
 
 
 Where are the docs?
 Where are the docs?
 -------------------
 -------------------
-Go to https://pythonhosted.org/darc/ for a prebuilt version of the docs. You
+Go to https://pythonhosted.org/Attic/ for a prebuilt version of the docs. You
 can also build them yourself form the docs folder.
 can also build them yourself form the docs folder.
 
 
 Where are the tests?
 Where are the tests?
 --------------------
 --------------------
-The tests are in the darc/testsuite package. To run the test suite use the
+The tests are in the attic/testsuite package. To run the test suite use the
 following command::
 following command::
 
 
-  $ python -m darc.testsuite.run
+  $ python -m attic.testsuite.run
 
 
 Contribute
 Contribute
 ----------
 ----------
-Found a bug? Have any ideas to improve darc? Add bug reports and feature
-requests to the `issue tracker <https://github.com/jborg/darc/issues>`_.
+Found a bug? Have any ideas to improve attic? Add bug reports and feature
+requests to the `issue tracker <https://github.com/jborg/attic/issues>`_.
 
 
 You can also ask the author a question directly by
 You can also ask the author a question directly by
 `email <mailto:jonas@borgstrom.se>`_.
 `email <mailto:jonas@borgstrom.se>`_.

+ 0 - 0
darc/__init__.py → attic/__init__.py


+ 0 - 0
darc/_chunker.c → attic/_chunker.c


+ 1 - 1
darc/_hashindex.c → attic/_hashindex.c

@@ -35,7 +35,7 @@ typedef struct {
     int upper_limit;
     int upper_limit;
 } HashIndex;
 } HashIndex;
 
 
-#define MAGIC "DARCHASH"
+#define MAGIC "ATTICIDX"
 #define EMPTY ((int32_t)-1)
 #define EMPTY ((int32_t)-1)
 #define DELETED ((int32_t)-2)
 #define DELETED ((int32_t)-2)
 #define MAX_BUCKET_SIZE 512
 #define MAX_BUCKET_SIZE 512

+ 0 - 0
darc/archive.py → attic/archive.py


+ 3 - 3
darc/archiver.py → attic/archiver.py

@@ -32,7 +32,7 @@ class Archiver:
     def print_error(self, msg, *args):
     def print_error(self, msg, *args):
         msg = args and msg % args or msg
         msg = args and msg % args or msg
         self.exit_code = 1
         self.exit_code = 1
-        print('darc: ' + msg, file=sys.stderr)
+        print('attic: ' + msg, file=sys.stderr)
 
 
     def print_verbose(self, msg, *args, **kw):
     def print_verbose(self, msg, *args, **kw):
         if self.verbose:
         if self.verbose:
@@ -76,7 +76,7 @@ class Archiver:
         archive = Archive(repository, key, manifest, args.archive.archive, cache=cache,
         archive = Archive(repository, key, manifest, args.archive.archive, cache=cache,
                           create=True, checkpoint_interval=args.checkpoint_interval,
                           create=True, checkpoint_interval=args.checkpoint_interval,
                           numeric_owner=args.numeric_owner)
                           numeric_owner=args.numeric_owner)
-        # Add darc cache dir to inode_skip list
+        # Add Attic cache dir to inode_skip list
         skip_inodes = set()
         skip_inodes = set()
         try:
         try:
             st = os.stat(get_cache_dir())
             st = os.stat(get_cache_dir())
@@ -314,7 +314,7 @@ class Archiver:
                             default=False,
                             default=False,
                             help='verbose output')
                             help='verbose output')
 
 
-        parser = argparse.ArgumentParser(description='Darc - Deduplicating Archiver')
+        parser = argparse.ArgumentParser(description='Attic - Deduplicated Backups')
         subparsers = parser.add_subparsers(title='Available subcommands')
         subparsers = parser.add_subparsers(title='Available subcommands')
 
 
         subparser = subparsers.add_parser('serve', parents=[common_parser])
         subparser = subparsers.add_parser('serve', parents=[common_parser])

+ 3 - 3
darc/cache.py → attic/cache.py

@@ -35,7 +35,7 @@ class Cache(object):
         """
         """
         os.makedirs(self.path)
         os.makedirs(self.path)
         with open(os.path.join(self.path, 'README'), 'w') as fd:
         with open(os.path.join(self.path, 'README'), 'w') as fd:
-            fd.write('This is a DARC cache')
+            fd.write('This is an Attic cache')
         config = RawConfigParser()
         config = RawConfigParser()
         config.add_section('cache')
         config.add_section('cache')
         config.set('cache', 'version', '1')
         config.set('cache', 'version', '1')
@@ -49,14 +49,14 @@ class Cache(object):
 
 
     def open(self):
     def open(self):
         if not os.path.isdir(self.path):
         if not os.path.isdir(self.path):
-            raise Exception('%s Does not look like a darc cache' % self.path)
+            raise Exception('%s Does not look like an Attic cache' % self.path)
         self.lock_fd = open(os.path.join(self.path, 'README'), 'r+')
         self.lock_fd = open(os.path.join(self.path, 'README'), 'r+')
         fcntl.flock(self.lock_fd, fcntl.LOCK_EX)
         fcntl.flock(self.lock_fd, fcntl.LOCK_EX)
         self.rollback()
         self.rollback()
         self.config = RawConfigParser()
         self.config = RawConfigParser()
         self.config.read(os.path.join(self.path, 'config'))
         self.config.read(os.path.join(self.path, 'config'))
         if self.config.getint('cache', 'version') != 1:
         if self.config.getint('cache', 'version') != 1:
-            raise Exception('%s Does not look like a darc cache')
+            raise Exception('%s Does not look like an Attic cache')
         self.id = self.config.get('cache', 'repository')
         self.id = self.config.get('cache', 'repository')
         self.manifest_id = unhexlify(self.config.get('cache', 'manifest'))
         self.manifest_id = unhexlify(self.config.get('cache', 'manifest'))
         self.chunks = ChunkIndex(os.path.join(self.path, 'chunks').encode('utf-8'))
         self.chunks = ChunkIndex(os.path.join(self.path, 'chunks').encode('utf-8'))

+ 0 - 0
darc/chunker.pyx → attic/chunker.pyx


+ 0 - 0
darc/crypto.py → attic/crypto.py


+ 0 - 0
darc/hashindex.pyx → attic/hashindex.pyx


+ 4 - 4
darc/helpers.py → attic/helpers.py

@@ -82,14 +82,14 @@ class Statistics:
 
 
 def get_keys_dir():
 def get_keys_dir():
     """Determine where to repository keys and cache"""
     """Determine where to repository keys and cache"""
-    return os.environ.get('DARC_KEYS_DIR',
-                          os.path.join(os.path.expanduser('~'), '.darc', 'keys'))
+    return os.environ.get('ATTIC_KEYS_DIR',
+                          os.path.join(os.path.expanduser('~'), '.attic', 'keys'))
 
 
 
 
 def get_cache_dir():
 def get_cache_dir():
     """Determine where to repository keys and cache"""
     """Determine where to repository keys and cache"""
-    return os.environ.get('DARC_CACHE_DIR',
-                          os.path.join(os.path.expanduser('~'), '.cache', 'darc'))
+    return os.environ.get('ATTIC_CACHE_DIR',
+                          os.path.join(os.path.expanduser('~'), '.cache', 'attic'))
 
 
 
 
 def to_localtime(ts):
 def to_localtime(ts):

+ 6 - 6
darc/key.py → attic/key.py

@@ -137,7 +137,7 @@ class PassphraseKey(AESKeyBase):
     @classmethod
     @classmethod
     def create(cls, repository, args):
     def create(cls, repository, args):
         key = cls()
         key = cls()
-        passphrase = os.environ.get('DARC_PASSPHRASE')
+        passphrase = os.environ.get('ATTIC_PASSPHRASE')
         if passphrase is not None:
         if passphrase is not None:
             passphrase2 = passphrase
             passphrase2 = passphrase
         else:
         else:
@@ -159,7 +159,7 @@ class PassphraseKey(AESKeyBase):
     def detect(cls, repository, manifest_data):
     def detect(cls, repository, manifest_data):
         prompt = 'Enter passphrase for %s: ' % repository._location.orig
         prompt = 'Enter passphrase for %s: ' % repository._location.orig
         key = cls()
         key = cls()
-        passphrase = os.environ.get('DARC_PASSPHRASE')
+        passphrase = os.environ.get('ATTIC_PASSPHRASE')
         if passphrase is None:
         if passphrase is None:
             passphrase = getpass(prompt)
             passphrase = getpass(prompt)
         while True:
         while True:
@@ -177,7 +177,7 @@ class PassphraseKey(AESKeyBase):
 
 
 
 
 class KeyfileKey(AESKeyBase):
 class KeyfileKey(AESKeyBase):
-    FILE_ID = 'DARC KEY'
+    FILE_ID = 'ATTIC KEY'
     TYPE = 0x00
     TYPE = 0x00
 
 
     @classmethod
     @classmethod
@@ -185,7 +185,7 @@ class KeyfileKey(AESKeyBase):
         key = cls()
         key = cls()
         path = cls.find_key_file(repository)
         path = cls.find_key_file(repository)
         prompt = 'Enter passphrase for key file %s: ' % path
         prompt = 'Enter passphrase for key file %s: ' % path
-        passphrase = os.environ.get('DARC_PASSPHRASE', '')
+        passphrase = os.environ.get('ATTIC_PASSPHRASE', '')
         while not key.load(path, passphrase):
         while not key.load(path, passphrase):
             passphrase = getpass(prompt)
             passphrase = getpass(prompt)
         key.init_ciphers(PREFIX + long_to_bytes(key.extract_iv(manifest_data) + 1000))
         key.init_ciphers(PREFIX + long_to_bytes(key.extract_iv(manifest_data) + 1000))
@@ -199,7 +199,7 @@ class KeyfileKey(AESKeyBase):
             filename = os.path.join(keys_dir, name)
             filename = os.path.join(keys_dir, name)
             with open(filename, 'r') as fd:
             with open(filename, 'r') as fd:
                 line = fd.readline().strip()
                 line = fd.readline().strip()
-                if line and line.startswith(cls.FILE_ID) and line[9:] == id:
+                if line and line.startswith(cls.FILE_ID) and line[10:] == id:
                     return filename
                     return filename
         raise Exception('Key file for repository with ID %s not found' % id)
         raise Exception('Key file for repository with ID %s not found' % id)
 
 
@@ -278,7 +278,7 @@ class KeyfileKey(AESKeyBase):
         while os.path.exists(path):
         while os.path.exists(path):
             i += 1
             i += 1
             path = filename + '.%d' % i
             path = filename + '.%d' % i
-        passphrase = os.environ.get('DARC_PASSPHRASE')
+        passphrase = os.environ.get('ATTIC_PASSPHRASE')
         if passphrase is not None:
         if passphrase is not None:
             passphrase2 = passphrase
             passphrase2 = passphrase
         else:
         else:

+ 0 - 0
darc/lrucache.py → attic/lrucache.py


+ 2 - 2
darc/remote.py → attic/remote.py

@@ -81,9 +81,9 @@ class RemoteRepository(object):
         self.msgid = 0
         self.msgid = 0
         self.received_msgid = 0
         self.received_msgid = 0
         if location.host == '__testsuite__':
         if location.host == '__testsuite__':
-            args = [sys.executable, '-m', 'darc.archiver', 'serve']
+            args = [sys.executable, '-m', 'attic.archiver', 'serve']
         else:
         else:
-            args = ['ssh', '-p', str(location.port), '%s@%s' % (location.user or getpass.getuser(), location.host), 'darc', 'serve']
+            args = ['ssh', '-p', str(location.port), '%s@%s' % (location.user or getpass.getuser(), location.host), 'attic', 'serve']
         self.p = Popen(args, bufsize=0, stdin=PIPE, stdout=PIPE)
         self.p = Popen(args, bufsize=0, stdin=PIPE, stdout=PIPE)
         self.stdin_fd = self.p.stdin.fileno()
         self.stdin_fd = self.p.stdin.fileno()
         self.stdout_fd = self.p.stdout.fileno()
         self.stdout_fd = self.p.stdout.fileno()

+ 5 - 7
darc/repository.py → attic/repository.py

@@ -5,8 +5,6 @@ import os
 import re
 import re
 import shutil
 import shutil
 import struct
 import struct
-import tempfile
-import unittest
 from zlib import crc32
 from zlib import crc32
 
 
 from .hashindex import NSIndex
 from .hashindex import NSIndex
@@ -14,7 +12,7 @@ from .helpers import IntegrityError, read_msgpack, write_msgpack, unhexlify
 from .lrucache import LRUCache
 from .lrucache import LRUCache
 
 
 MAX_OBJECT_SIZE = 20 * 1024 * 1024
 MAX_OBJECT_SIZE = 20 * 1024 * 1024
-
+MAGIC = b'ATTICSEG'
 TAG_PUT = 0
 TAG_PUT = 0
 TAG_DELETE = 1
 TAG_DELETE = 1
 TAG_COMMIT = 2
 TAG_COMMIT = 2
@@ -57,7 +55,7 @@ class Repository(object):
         if not os.path.exists(path):
         if not os.path.exists(path):
             os.mkdir(path)
             os.mkdir(path)
         with open(os.path.join(path, 'README'), 'w') as fd:
         with open(os.path.join(path, 'README'), 'w') as fd:
-            fd.write('This is a DARC repository\n')
+            fd.write('This is an Attic repository\n')
         os.mkdir(os.path.join(path, 'data'))
         os.mkdir(os.path.join(path, 'data'))
         config = RawConfigParser()
         config = RawConfigParser()
         config.add_section('repository')
         config.add_section('repository')
@@ -78,7 +76,7 @@ class Repository(object):
         self.config = RawConfigParser()
         self.config = RawConfigParser()
         self.config.read(os.path.join(self.path, 'config'))
         self.config.read(os.path.join(self.path, 'config'))
         if self.config.getint('repository', 'version') != 1:
         if self.config.getint('repository', 'version') != 1:
-            raise Exception('%s Does not look like a darc repository')
+            raise Exception('%s Does not look like an Attic repository')
         self.max_segment_size = self.config.getint('repository', 'max_segment_size')
         self.max_segment_size = self.config.getint('repository', 'max_segment_size')
         self.segments_per_dir = self.config.getint('repository', 'segments_per_dir')
         self.segments_per_dir = self.config.getint('repository', 'segments_per_dir')
         self.id = unhexlify(self.config.get('repository', 'id').strip())
         self.id = unhexlify(self.config.get('repository', 'id').strip())
@@ -325,7 +323,7 @@ class LoggedIO(object):
                 if not os.path.exists(dirname):
                 if not os.path.exists(dirname):
                     os.mkdir(dirname)
                     os.mkdir(dirname)
             self._write_fd = open(self.segment_filename(self.segment), 'ab')
             self._write_fd = open(self.segment_filename(self.segment), 'ab')
-            self._write_fd.write(b'DSEGMENT')
+            self._write_fd.write(MAGIC)
             self.offset = 8
             self.offset = 8
         return self._write_fd
         return self._write_fd
 
 
@@ -346,7 +344,7 @@ class LoggedIO(object):
     def iter_objects(self, segment, lookup=None, include_data=False):
     def iter_objects(self, segment, lookup=None, include_data=False):
         fd = self.get_fd(segment)
         fd = self.get_fd(segment)
         fd.seek(0)
         fd.seek(0)
-        if fd.read(8) != b'DSEGMENT':
+        if fd.read(8) != MAGIC:
             raise IntegrityError('Invalid segment header')
             raise IntegrityError('Invalid segment header')
         offset = 8
         offset = 8
         header = fd.read(self.header_fmt.size)
         header = fd.read(self.header_fmt.size)

+ 2 - 2
darc/testsuite/__init__.py → attic/testsuite/__init__.py

@@ -1,7 +1,7 @@
 import unittest
 import unittest
 
 
 
 
-class DarcTestCase(unittest.TestCase):
+class AtticTestCase(unittest.TestCase):
     """
     """
     """
     """
     assert_equal = unittest.TestCase.assertEqual
     assert_equal = unittest.TestCase.assertEqual
@@ -25,7 +25,7 @@ class TestLoader(unittest.TestLoader):
     """A customzied test loader that properly detects and filters our test cases
     """A customzied test loader that properly detects and filters our test cases
     """
     """
     def loadTestsFromName(self, pattern, module=None):
     def loadTestsFromName(self, pattern, module=None):
-        suite = self.discover('darc.testsuite', '*.py')
+        suite = self.discover('attic.testsuite', '*.py')
         tests = unittest.TestSuite()
         tests = unittest.TestSuite()
         for test in get_tests(suite):
         for test in get_tests(suite):
             if pattern.lower() in test.id().lower():
             if pattern.lower() in test.id().lower():

+ 43 - 43
darc/testsuite/archiver.py → attic/testsuite/archiver.py

@@ -5,10 +5,10 @@ import stat
 import sys
 import sys
 import shutil
 import shutil
 import tempfile
 import tempfile
-from darc import xattr
-from darc.archiver import Archiver
-from darc.repository import Repository
-from darc.testsuite import DarcTestCase
+from attic import xattr
+from attic.archiver import Archiver
+from attic.repository import Repository
+from attic.testsuite import AtticTestCase
 
 
 has_mtime_ns = sys.version >= '3.3'
 has_mtime_ns = sys.version >= '3.3'
 utime_supports_fd = os.utime in getattr(os, 'supports_fd', {})
 utime_supports_fd = os.utime in getattr(os, 'supports_fd', {})
@@ -27,7 +27,7 @@ class changedir:
         os.chdir(self.old)
         os.chdir(self.old)
 
 
 
 
-class ArchiverTestCase(DarcTestCase):
+class ArchiverTestCase(AtticTestCase):
 
 
     prefix = ''
     prefix = ''
 
 
@@ -40,8 +40,8 @@ class ArchiverTestCase(DarcTestCase):
         self.output_path = os.path.join(self.tmpdir, 'output')
         self.output_path = os.path.join(self.tmpdir, 'output')
         self.keys_path = os.path.join(self.tmpdir, 'keys')
         self.keys_path = os.path.join(self.tmpdir, 'keys')
         self.cache_path = os.path.join(self.tmpdir, 'cache')
         self.cache_path = os.path.join(self.tmpdir, 'cache')
-        os.environ['DARC_KEYS_DIR'] = self.keys_path
-        os.environ['DARC_CACHE_DIR'] = self.cache_path
+        os.environ['ATTIC_KEYS_DIR'] = self.keys_path
+        os.environ['ATTIC_CACHE_DIR'] = self.cache_path
         os.mkdir(self.input_path)
         os.mkdir(self.input_path)
         os.mkdir(self.output_path)
         os.mkdir(self.output_path)
         os.mkdir(self.keys_path)
         os.mkdir(self.keys_path)
@@ -53,7 +53,7 @@ class ArchiverTestCase(DarcTestCase):
         shutil.rmtree(self.tmpdir)
         shutil.rmtree(self.tmpdir)
         os.chdir(self._old_wd)
         os.chdir(self._old_wd)
 
 
-    def darc(self, *args, **kwargs):
+    def attic(self, *args, **kwargs):
         exit_code = kwargs.get('exit_code', 0)
         exit_code = kwargs.get('exit_code', 0)
         args = list(args)
         args = list(args)
         try:
         try:
@@ -70,8 +70,8 @@ class ArchiverTestCase(DarcTestCase):
             sys.stdout, sys.stderr = stdout, stderr
             sys.stdout, sys.stderr = stdout, stderr
 
 
     def create_src_archive(self, name):
     def create_src_archive(self, name):
-        self.darc('init', self.repository_location)
-        self.darc('create', self.repository_location + '::' + name, src_dir)
+        self.attic('init', self.repository_location)
+        self.attic('create', self.repository_location + '::' + name, src_dir)
 
 
     def create_regual_file(self, name, size=0):
     def create_regual_file(self, name, size=0):
         filename = os.path.join(self.input_path, name)
         filename = os.path.join(self.input_path, name)
@@ -132,91 +132,91 @@ class ArchiverTestCase(DarcTestCase):
         os.symlink('somewhere', os.path.join(self.input_path, 'link1'))
         os.symlink('somewhere', os.path.join(self.input_path, 'link1'))
         # FIFO node
         # FIFO node
         os.mkfifo(os.path.join(self.input_path, 'fifo1'))
         os.mkfifo(os.path.join(self.input_path, 'fifo1'))
-        self.darc('init', self.repository_location)
-        self.darc('create', self.repository_location + '::test', 'input')
-        self.darc('create', self.repository_location + '::test.2', 'input')
+        self.attic('init', self.repository_location)
+        self.attic('create', self.repository_location + '::test', 'input')
+        self.attic('create', self.repository_location + '::test.2', 'input')
         with changedir('output'):
         with changedir('output'):
-            self.darc('extract', self.repository_location + '::test')
-        self.assert_equal(len(self.darc('list', self.repository_location).splitlines()), 2)
-        self.assert_equal(len(self.darc('list', self.repository_location + '::test').splitlines()), 9)
+            self.attic('extract', self.repository_location + '::test')
+        self.assert_equal(len(self.attic('list', self.repository_location).splitlines()), 2)
+        self.assert_equal(len(self.attic('list', self.repository_location + '::test').splitlines()), 9)
         self.diff_dirs('input', 'output/input')
         self.diff_dirs('input', 'output/input')
-        info_output = self.darc('info', self.repository_location + '::test')
+        info_output = self.attic('info', self.repository_location + '::test')
         shutil.rmtree(self.cache_path)
         shutil.rmtree(self.cache_path)
-        info_output2 = self.darc('info', self.repository_location + '::test')
+        info_output2 = self.attic('info', self.repository_location + '::test')
         # info_output2 starts with some "initializing cache" text but should
         # info_output2 starts with some "initializing cache" text but should
         # end the same way as info_output
         # end the same way as info_output
         assert info_output2.endswith(info_output)
         assert info_output2.endswith(info_output)
 
 
     def test_extract_include_exclude(self):
     def test_extract_include_exclude(self):
-        self.darc('init', self.repository_location)
+        self.attic('init', self.repository_location)
         self.create_regual_file('file1', size=1024 * 80)
         self.create_regual_file('file1', size=1024 * 80)
         self.create_regual_file('file2', size=1024 * 80)
         self.create_regual_file('file2', size=1024 * 80)
         self.create_regual_file('file3', size=1024 * 80)
         self.create_regual_file('file3', size=1024 * 80)
         self.create_regual_file('file4', size=1024 * 80)
         self.create_regual_file('file4', size=1024 * 80)
-        self.darc('create', '--exclude=input/file4', self.repository_location + '::test', 'input')
+        self.attic('create', '--exclude=input/file4', self.repository_location + '::test', 'input')
         with changedir('output'):
         with changedir('output'):
-            self.darc('extract', self.repository_location + '::test', 'input/file1', )
+            self.attic('extract', self.repository_location + '::test', 'input/file1', )
         self.assert_equal(sorted(os.listdir('output/input')), ['file1'])
         self.assert_equal(sorted(os.listdir('output/input')), ['file1'])
         with changedir('output'):
         with changedir('output'):
-            self.darc('extract', '--exclude=input/file2', self.repository_location + '::test')
+            self.attic('extract', '--exclude=input/file2', self.repository_location + '::test')
         self.assert_equal(sorted(os.listdir('output/input')), ['file1', 'file3'])
         self.assert_equal(sorted(os.listdir('output/input')), ['file1', 'file3'])
 
 
     def test_overwrite(self):
     def test_overwrite(self):
         self.create_regual_file('file1', size=1024 * 80)
         self.create_regual_file('file1', size=1024 * 80)
         self.create_regual_file('dir2/file2', size=1024 * 80)
         self.create_regual_file('dir2/file2', size=1024 * 80)
-        self.darc('init', self.repository_location)
-        self.darc('create', self.repository_location + '::test', 'input')
+        self.attic('init', self.repository_location)
+        self.attic('create', self.repository_location + '::test', 'input')
         # Overwriting regular files and directories should be supported
         # Overwriting regular files and directories should be supported
         os.mkdir('output/input')
         os.mkdir('output/input')
         os.mkdir('output/input/file1')
         os.mkdir('output/input/file1')
         os.mkdir('output/input/dir2')
         os.mkdir('output/input/dir2')
         with changedir('output'):
         with changedir('output'):
-            self.darc('extract', self.repository_location + '::test')
+            self.attic('extract', self.repository_location + '::test')
         self.diff_dirs('input', 'output/input')
         self.diff_dirs('input', 'output/input')
         # But non-empty dirs should fail
         # But non-empty dirs should fail
         os.unlink('output/input/file1')
         os.unlink('output/input/file1')
         os.mkdir('output/input/file1')
         os.mkdir('output/input/file1')
         os.mkdir('output/input/file1/dir')
         os.mkdir('output/input/file1/dir')
         with changedir('output'):
         with changedir('output'):
-            self.darc('extract', self.repository_location + '::test', exit_code=1)
+            self.attic('extract', self.repository_location + '::test', exit_code=1)
 
 
     def test_delete(self):
     def test_delete(self):
         self.create_regual_file('file1', size=1024 * 80)
         self.create_regual_file('file1', size=1024 * 80)
         self.create_regual_file('dir2/file2', size=1024 * 80)
         self.create_regual_file('dir2/file2', size=1024 * 80)
-        self.darc('init', self.repository_location)
-        self.darc('create', self.repository_location + '::test', 'input')
-        self.darc('create', self.repository_location + '::test.2', 'input')
-        self.darc('verify', self.repository_location + '::test')
-        self.darc('verify', self.repository_location + '::test.2')
-        self.darc('delete', self.repository_location + '::test')
-        self.darc('verify', self.repository_location + '::test.2')
-        self.darc('delete', self.repository_location + '::test.2')
+        self.attic('init', self.repository_location)
+        self.attic('create', self.repository_location + '::test', 'input')
+        self.attic('create', self.repository_location + '::test.2', 'input')
+        self.attic('verify', self.repository_location + '::test')
+        self.attic('verify', self.repository_location + '::test.2')
+        self.attic('delete', self.repository_location + '::test')
+        self.attic('verify', self.repository_location + '::test.2')
+        self.attic('delete', self.repository_location + '::test.2')
         # Make sure all data except the manifest has been deleted
         # Make sure all data except the manifest has been deleted
         repository = Repository(self.repository_path)
         repository = Repository(self.repository_path)
         self.assert_equal(repository._len(), 1)
         self.assert_equal(repository._len(), 1)
 
 
     def test_corrupted_repository(self):
     def test_corrupted_repository(self):
         self.create_src_archive('test')
         self.create_src_archive('test')
-        self.darc('verify', self.repository_location + '::test')
+        self.attic('verify', self.repository_location + '::test')
         name = sorted(os.listdir(os.path.join(self.tmpdir, 'repository', 'data', '0')), reverse=True)[0]
         name = sorted(os.listdir(os.path.join(self.tmpdir, 'repository', 'data', '0')), reverse=True)[0]
         fd = open(os.path.join(self.tmpdir, 'repository', 'data', '0', name), 'r+')
         fd = open(os.path.join(self.tmpdir, 'repository', 'data', '0', name), 'r+')
         fd.seek(100)
         fd.seek(100)
         fd.write('X')
         fd.write('X')
         fd.close()
         fd.close()
-        self.darc('verify', self.repository_location + '::test', exit_code=1)
+        self.attic('verify', self.repository_location + '::test', exit_code=1)
 
 
     def test_prune_repository(self):
     def test_prune_repository(self):
-        self.darc('init', self.repository_location)
-        self.darc('create', self.repository_location + '::test1', src_dir)
-        self.darc('create', self.repository_location + '::test2', src_dir)
-        self.darc('prune', self.repository_location, '--daily=2')
-        output = self.darc('list', self.repository_location)
+        self.attic('init', self.repository_location)
+        self.attic('create', self.repository_location + '::test1', src_dir)
+        self.attic('create', self.repository_location + '::test2', src_dir)
+        self.attic('prune', self.repository_location, '--daily=2')
+        output = self.attic('list', self.repository_location)
         assert 'test1' not in output
         assert 'test1' not in output
         assert 'test2' in output
         assert 'test2' in output
 
 
     def test_usage(self):
     def test_usage(self):
-        self.assert_raises(SystemExit, lambda: self.darc())
-        self.assert_raises(SystemExit, lambda: self.darc('-h'))
+        self.assert_raises(SystemExit, lambda: self.attic())
+        self.assert_raises(SystemExit, lambda: self.attic('-h'))
 
 
 
 
 class RemoteArchiverTestCase(ArchiverTestCase):
 class RemoteArchiverTestCase(ArchiverTestCase):

+ 3 - 3
darc/testsuite/chunker.py → attic/testsuite/chunker.py

@@ -1,9 +1,9 @@
-from darc.chunker import chunkify, buzhash, buzhash_update
-from darc.testsuite import DarcTestCase
+from attic.chunker import chunkify, buzhash, buzhash_update
+from attic.testsuite import AtticTestCase
 from io import BytesIO
 from io import BytesIO
 
 
 
 
-class ChunkerTestCase(DarcTestCase):
+class ChunkerTestCase(AtticTestCase):
 
 
     def test_chunkify(self):
     def test_chunkify(self):
         data = b'0' * 1024 * 1024 * 15 + b'Y'
         data = b'0' * 1024 * 1024 * 15 + b'Y'

+ 3 - 3
darc/testsuite/crypto.py → attic/testsuite/crypto.py

@@ -1,9 +1,9 @@
 from binascii import hexlify
 from binascii import hexlify
-from darc.testsuite import DarcTestCase
-from darc.crypto import AES, bytes_to_long, bytes_to_int, long_to_bytes, pbkdf2_sha256, get_random_bytes
+from attic.testsuite import AtticTestCase
+from attic.crypto import AES, bytes_to_long, bytes_to_int, long_to_bytes, pbkdf2_sha256, get_random_bytes
 
 
 
 
-class CryptoTestCase(DarcTestCase):
+class CryptoTestCase(AtticTestCase):
 
 
     def test_bytes_to_int(self):
     def test_bytes_to_int(self):
         self.assert_equal(bytes_to_int(b'\0\0\0\1'), 1)
         self.assert_equal(bytes_to_int(b'\0\0\0\1'), 1)

+ 5 - 5
darc/testsuite/hashindex.py → attic/testsuite/hashindex.py

@@ -1,10 +1,10 @@
 import hashlib
 import hashlib
 import tempfile
 import tempfile
-from darc.hashindex import NSIndex, ChunkIndex
-from darc.testsuite import DarcTestCase
+from attic.hashindex import NSIndex, ChunkIndex
+from attic.testsuite import AtticTestCase
 
 
 
 
-class HashIndexTestCase(DarcTestCase):
+class HashIndexTestCase(AtticTestCase):
 
 
     def _generic_test(self, cls, make_value, sha):
     def _generic_test(self, cls, make_value, sha):
         idx_name = tempfile.NamedTemporaryFile()
         idx_name = tempfile.NamedTemporaryFile()
@@ -41,8 +41,8 @@ class HashIndexTestCase(DarcTestCase):
         self.assert_equal(len(cls(idx_name.name)), 0)
         self.assert_equal(len(cls(idx_name.name)), 0)
 
 
     def test_nsindex(self):
     def test_nsindex(self):
-        self._generic_test(NSIndex, lambda x: (x, x), '9a6f9cb3c03d83ed611265eeef1f9a9d69c2f0417a35ac14d56ce573d0c8b356')
+        self._generic_test(NSIndex, lambda x: (x, x), '369a18ae6a52524eb2884a3c0fdc2824947edd017a2688c5d4d7b3510c245ab9')
 
 
     def test_chunkindex(self):
     def test_chunkindex(self):
-        self._generic_test(ChunkIndex, lambda x: (x, x, x), '9c35f237e533b6d2533d2646da127052d615ab9b66de65a795cd922b337741ca')
+        self._generic_test(ChunkIndex, lambda x: (x, x, x), 'ed22e8a883400453c0ee79a06c54df72c994a54eeefdc6c0989efdc5ee6d07b7')
 
 

+ 7 - 7
darc/testsuite/helpers.py → attic/testsuite/helpers.py

@@ -1,9 +1,9 @@
 from datetime import datetime
 from datetime import datetime
-from darc.helpers import Location, format_timedelta, IncludePattern, ExcludePattern
-from darc.testsuite import DarcTestCase
+from attic.helpers import Location, format_timedelta, IncludePattern, ExcludePattern
+from attic.testsuite import AtticTestCase
 
 
 
 
-class LocationTestCase(DarcTestCase):
+class LocationTestCase(AtticTestCase):
 
 
     def test(self):
     def test(self):
         self.assert_equal(
         self.assert_equal(
@@ -19,8 +19,8 @@ class LocationTestCase(DarcTestCase):
             "Location(proto='ssh', user='user', host='host', port=22, path='/some/path', archive='archive')"
             "Location(proto='ssh', user='user', host='host', port=22, path='/some/path', archive='archive')"
         )
         )
         self.assert_equal(
         self.assert_equal(
-            repr(Location('mybackup.darc::archive')),
-            "Location(proto='file', user=None, host=None, port=None, path='mybackup.darc', archive='archive')"
+            repr(Location('mybackup.attic::archive')),
+            "Location(proto='file', user=None, host=None, port=None, path='mybackup.attic', archive='archive')"
         )
         )
         self.assert_equal(
         self.assert_equal(
             repr(Location('/some/absolute/path::archive')),
             repr(Location('/some/absolute/path::archive')),
@@ -32,7 +32,7 @@ class LocationTestCase(DarcTestCase):
         )
         )
 
 
 
 
-class FormatTimedeltaTestCase(DarcTestCase):
+class FormatTimedeltaTestCase(AtticTestCase):
 
 
     def test(self):
     def test(self):
         t0 = datetime(2001, 1, 1, 10, 20, 3, 0)
         t0 = datetime(2001, 1, 1, 10, 20, 3, 0)
@@ -43,7 +43,7 @@ class FormatTimedeltaTestCase(DarcTestCase):
         )
         )
 
 
 
 
-class PatternTestCase(DarcTestCase):
+class PatternTestCase(AtticTestCase):
 
 
     def test(self):
     def test(self):
         self.assert_equal(IncludePattern('/usr').match('/usr'), True)
         self.assert_equal(IncludePattern('/usr').match('/usr'), True)

+ 11 - 18
darc/testsuite/key.py → attic/testsuite/key.py

@@ -3,19 +3,19 @@ import re
 import shutil
 import shutil
 import tempfile
 import tempfile
 from binascii import hexlify
 from binascii import hexlify
-from darc.crypto import bytes_to_long
-from darc.testsuite import DarcTestCase
-from darc.key import PlaintextKey, PassphraseKey, KeyfileKey
-from darc.helpers import Location, unhexlify
+from attic.crypto import bytes_to_long
+from attic.testsuite import AtticTestCase
+from attic.key import PlaintextKey, PassphraseKey, KeyfileKey
+from attic.helpers import Location, unhexlify
 
 
 
 
-class KeyTestCase(DarcTestCase):
+class KeyTestCase(AtticTestCase):
 
 
     class MockArgs(object):
     class MockArgs(object):
         repository = Location(tempfile.mkstemp()[1])
         repository = Location(tempfile.mkstemp()[1])
 
 
     keyfile2_key_file = """
     keyfile2_key_file = """
-        DARC KEY 0000000000000000000000000000000000000000000000000000000000000000
+        ATTIC KEY 0000000000000000000000000000000000000000000000000000000000000000
         hqppdGVyYXRpb25zzgABhqCkaGFzaNoAIMyonNI+7Cjv0qHi0AOBM6bLGxACJhfgzVD2oq
         hqppdGVyYXRpb25zzgABhqCkaGFzaNoAIMyonNI+7Cjv0qHi0AOBM6bLGxACJhfgzVD2oq
         bIS9SFqWFsZ29yaXRobaZzaGEyNTakc2FsdNoAINNK5qqJc1JWSUjACwFEWGTdM7Nd0a5l
         bIS9SFqWFsZ29yaXRobaZzaGEyNTakc2FsdNoAINNK5qqJc1JWSUjACwFEWGTdM7Nd0a5l
         1uBGPEb+9XM9p3ZlcnNpb24BpGRhdGHaANAYDT5yfPpU099oBJwMomsxouKyx/OG4QIXK2
         1uBGPEb+9XM9p3ZlcnNpb24BpGRhdGHaANAYDT5yfPpU099oBJwMomsxouKyx/OG4QIXK2
@@ -32,7 +32,7 @@ class KeyTestCase(DarcTestCase):
 
 
     def setUp(self):
     def setUp(self):
         self.tmppath = tempfile.mkdtemp()
         self.tmppath = tempfile.mkdtemp()
-        os.environ['DARC_KEYS_DIR'] = self.tmppath
+        os.environ['ATTIC_KEYS_DIR'] = self.tmppath
 
 
     def tearDown(self):
     def tearDown(self):
         shutil.rmtree(self.tmppath)
         shutil.rmtree(self.tmppath)
@@ -44,13 +44,6 @@ class KeyTestCase(DarcTestCase):
         _location = _Location()
         _location = _Location()
         id = bytes(32)
         id = bytes(32)
 
 
-    def setUp(self):
-        self.tmpdir = tempfile.mkdtemp()
-        os.environ['DARC_KEYS_DIR'] = self.tmpdir
-
-    def tearDown(self):
-        shutil.rmtree(self.tmpdir)
-
     def test_plaintext(self):
     def test_plaintext(self):
         key = PlaintextKey.create(None, None)
         key = PlaintextKey.create(None, None)
         data = b'foo'
         data = b'foo'
@@ -58,7 +51,7 @@ class KeyTestCase(DarcTestCase):
         self.assert_equal(data, key.decrypt(key.id_hash(data), key.encrypt(data)))
         self.assert_equal(data, key.decrypt(key.id_hash(data), key.encrypt(data)))
 
 
     def test_keyfile(self):
     def test_keyfile(self):
-        os.environ['DARC_PASSPHRASE'] = 'test'
+        os.environ['ATTIC_PASSPHRASE'] = 'test'
         key = KeyfileKey.create(self.MockRepository(), self.MockArgs())
         key = KeyfileKey.create(self.MockRepository(), self.MockArgs())
         self.assert_equal(bytes_to_long(key.enc_cipher.iv, 8), 0)
         self.assert_equal(bytes_to_long(key.enc_cipher.iv, 8), 0)
         manifest = key.encrypt(b'')
         manifest = key.encrypt(b'')
@@ -72,14 +65,14 @@ class KeyTestCase(DarcTestCase):
         self.assert_equal(data, key2.decrypt(key.id_hash(data), key.encrypt(data)))
         self.assert_equal(data, key2.decrypt(key.id_hash(data), key.encrypt(data)))
 
 
     def test_keyfile2(self):
     def test_keyfile2(self):
-        with open(os.path.join(os.environ['DARC_KEYS_DIR'], 'keyfile'), 'w') as fd:
+        with open(os.path.join(os.environ['ATTIC_KEYS_DIR'], 'keyfile'), 'w') as fd:
             fd.write(self.keyfile2_key_file)
             fd.write(self.keyfile2_key_file)
-        os.environ['DARC_PASSPHRASE'] = 'passphrase'
+        os.environ['ATTIC_PASSPHRASE'] = 'passphrase'
         key = KeyfileKey.detect(self.MockRepository(), self.keyfile2_cdata)
         key = KeyfileKey.detect(self.MockRepository(), self.keyfile2_cdata)
         self.assert_equal(key.decrypt(self.keyfile2_id, self.keyfile2_cdata), b'payload')
         self.assert_equal(key.decrypt(self.keyfile2_id, self.keyfile2_cdata), b'payload')
 
 
     def test_passphrase(self):
     def test_passphrase(self):
-        os.environ['DARC_PASSPHRASE'] = 'test'
+        os.environ['ATTIC_PASSPHRASE'] = 'test'
         key = PassphraseKey.create(self.MockRepository(), None)
         key = PassphraseKey.create(self.MockRepository(), None)
         self.assert_equal(bytes_to_long(key.enc_cipher.iv, 8), 0)
         self.assert_equal(bytes_to_long(key.enc_cipher.iv, 8), 0)
         self.assert_equal(hexlify(key.id_key), b'793b0717f9d8fb01c751a487e9b827897ceea62409870600013fbc6b4d8d7ca6')
         self.assert_equal(hexlify(key.id_key), b'793b0717f9d8fb01c751a487e9b827897ceea62409870600013fbc6b4d8d7ca6')

+ 3 - 3
darc/testsuite/lrucache.py → attic/testsuite/lrucache.py

@@ -1,8 +1,8 @@
-from darc.lrucache import LRUCache
-from darc.testsuite import DarcTestCase
+from attic.lrucache import LRUCache
+from attic.testsuite import AtticTestCase
 
 
 
 
-class LRUCacheTestCase(DarcTestCase):
+class LRUCacheTestCase(AtticTestCase):
 
 
     def test(self):
     def test(self):
         c = LRUCache(2)
         c = LRUCache(2)

+ 5 - 5
darc/testsuite/repository.py → attic/testsuite/repository.py

@@ -1,13 +1,13 @@
 import os
 import os
 import shutil
 import shutil
 import tempfile
 import tempfile
-from darc.helpers import Location
-from darc.remote import RemoteRepository
-from darc.repository import Repository
-from darc.testsuite import DarcTestCase
+from attic.helpers import Location
+from attic.remote import RemoteRepository
+from attic.repository import Repository
+from attic.testsuite import AtticTestCase
 
 
 
 
-class RepositoryTestCase(DarcTestCase):
+class RepositoryTestCase(AtticTestCase):
 
 
     def open(self, create=False):
     def open(self, create=False):
         return Repository(os.path.join(self.tmppath, 'repository'), create=create)
         return Repository(os.path.join(self.tmppath, 'repository'), create=create)

+ 1 - 1
darc/testsuite/run.py → attic/testsuite/run.py

@@ -1,5 +1,5 @@
 import unittest
 import unittest
-from darc.testsuite import TestLoader
+from attic.testsuite import TestLoader
 
 
 
 
 def main():
 def main():

+ 3 - 3
darc/testsuite/xattr.py → attic/testsuite/xattr.py

@@ -1,12 +1,12 @@
 import os
 import os
 import tempfile
 import tempfile
 import unittest
 import unittest
-from darc.testsuite import DarcTestCase
-from darc.xattr import lsetxattr, llistxattr, lgetxattr, get_all, set, flistxattr, fgetxattr, fsetxattr, is_enabled
+from attic.testsuite import AtticTestCase
+from attic.xattr import lsetxattr, llistxattr, lgetxattr, get_all, set, flistxattr, fgetxattr, fsetxattr, is_enabled
 
 
 
 
 @unittest.skipUnless(is_enabled(), 'xattr not enabled on filesystem')
 @unittest.skipUnless(is_enabled(), 'xattr not enabled on filesystem')
-class XattrTestCase(DarcTestCase):
+class XattrTestCase(AtticTestCase):
 
 
     def setUp(self):
     def setUp(self):
         self.tmpfile = tempfile.NamedTemporaryFile()
         self.tmpfile = tempfile.NamedTemporaryFile()

+ 0 - 0
darc/xattr.py → attic/xattr.py


+ 4 - 4
docs/Makefile

@@ -73,17 +73,17 @@ qthelp:
 	@echo
 	@echo
 	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
 	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
 	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
 	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
-	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Darc.qhcp"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/attic.qhcp"
 	@echo "To view the help file:"
 	@echo "To view the help file:"
-	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Darc.qhc"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/attic.qhc"
 
 
 devhelp:
 devhelp:
 	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
 	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
 	@echo
 	@echo
 	@echo "Build finished."
 	@echo "Build finished."
 	@echo "To view the help file:"
 	@echo "To view the help file:"
-	@echo "# mkdir -p $$HOME/.local/share/devhelp/Darc"
-	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Darc"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/attic"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/attic"
 	@echo "# devhelp"
 	@echo "# devhelp"
 
 
 epub:
 epub:

+ 8 - 8
docs/conf.py

@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 #
 #
-# Darc documentation build configuration file, created by
+# Attic documentation build configuration file, created by
 # sphinx-quickstart on Sat Sep 10 18:18:25 2011.
 # sphinx-quickstart on Sat Sep 10 18:18:25 2011.
 #
 #
 # This file is execfile()d with the current directory set to its containing dir.
 # This file is execfile()d with the current directory set to its containing dir.
@@ -11,7 +11,7 @@
 # All configuration values have a default; values that are commented out
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 # serve to show the default.
 
 
-import sys, os, darc
+import sys, os, attic
 
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # add these directories to sys.path here. If the directory is relative to the
@@ -40,7 +40,7 @@ source_suffix = '.rst'
 master_doc = 'index'
 master_doc = 'index'
 
 
 # General information about the project.
 # General information about the project.
-project = 'Darc - Deduplicating Archiver'
+project = 'Attic - Deduplicating Archiver'
 copyright = '2010-2013, Jonas Borgström'
 copyright = '2010-2013, Jonas Borgström'
 
 
 # The version info for the project you're documenting, acts as replacement for
 # The version info for the project you're documenting, acts as replacement for
@@ -48,9 +48,9 @@ copyright = '2010-2013, Jonas Borgström'
 # built documents.
 # built documents.
 #
 #
 # The short X.Y version.
 # The short X.Y version.
-version = darc.__version__
+version = attic.__version__
 # The full version, including alpha/beta/rc tags.
 # The full version, including alpha/beta/rc tags.
-release = darc.__release__
+release = attic.__release__
 
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 # for a list of supported languages.
@@ -164,7 +164,7 @@ html_static_path = ['_static']
 #html_file_suffix = None
 #html_file_suffix = None
 
 
 # Output file base name for HTML help builder.
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'Darcdoc'
+htmlhelp_basename = 'atticdoc'
 
 
 
 
 # -- Options for LaTeX output --------------------------------------------------
 # -- Options for LaTeX output --------------------------------------------------
@@ -178,7 +178,7 @@ htmlhelp_basename = 'Darcdoc'
 # Grouping the document tree into LaTeX files. List of tuples
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, documentclass [howto/manual]).
 # (source start file, target name, title, author, documentclass [howto/manual]).
 latex_documents = [
 latex_documents = [
-  ('index', 'Darc.tex', 'Darc Documentation',
+  ('index', 'Attic.tex', 'Attic Documentation',
    'Jonas Borgström', 'manual'),
    'Jonas Borgström', 'manual'),
 ]
 ]
 
 
@@ -211,6 +211,6 @@ latex_documents = [
 # One entry per manual page. List of tuples
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 # (source start file, name, description, authors, manual section).
 man_pages = [
 man_pages = [
-    ('index', 'darc', 'Darc Documentation',
+    ('index', 'attic', 'Attic Documentation',
      ['Jonas Borgström'], 1)
      ['Jonas Borgström'], 1)
 ]
 ]

+ 2 - 2
docs/faq.rst

@@ -12,8 +12,8 @@ Currently Linux and MacOS X are supported.
 Can I backup VM disk images?
 Can I backup VM disk images?
 ----------------------------
 ----------------------------
 
 
-Yes, the :ref:`deduplication <deduplication_def>` technique used by darc will
-make sure only the modified parts of the file is stored.
+Yes, the :ref:`deduplication <deduplication_def>` technique used by |project_name|
+makes sure only the modified parts of the file are stored.
 
 
 Which file attributes are preserved?
 Which file attributes are preserved?
 ------------------------------------
 ------------------------------------

+ 12 - 12
docs/generalusage.rst

@@ -12,39 +12,39 @@ Initialize a local :ref:`repository <repository_def>` to store backup
 :ref:`archives <archive_def>` in (See :ref:`encrypted_repos` and
 :ref:`archives <archive_def>` in (See :ref:`encrypted_repos` and
 :ref:`remote_repos` for more details)::
 :ref:`remote_repos` for more details)::
 
 
-    $ darc init /somewhere/my-backup.darc
+    $ attic init /somewhere/my-backup.attic
 
 
 Create an archive containing the ``~/src`` and ``~/Documents`` directories::
 Create an archive containing the ``~/src`` and ``~/Documents`` directories::
 
 
-    $ darc create -v /somwhere/my-backup.darc::first-backup ~/src ~/Documents
+    $ attic create -v /somwhere/my-backup.attic::first-backup ~/src ~/Documents
 
 
 Create another archive the next day. This backup will be a lot quicker since
 Create another archive the next day. This backup will be a lot quicker since
 only new data is stored. The ``--stats`` option tells |project_name| to print
 only new data is stored. The ``--stats`` option tells |project_name| to print
 statistics about the newly created archive such as the amount of unique data
 statistics about the newly created archive such as the amount of unique data
 (not shared with other archives)::
 (not shared with other archives)::
 
 
-    $ darc create -v --stats /somwhere/my-backup.darc::second-backup ~/src ~/Documents
+    $ attic create -v --stats /somwhere/my-backup.attic::second-backup ~/src ~/Documents
 
 
 List all archives in the repository::
 List all archives in the repository::
 
 
-    $ darc list /somewhere/my-backup.darc
+    $ attic list /somewhere/my-backup.attic
 
 
 List the files in the *first-backup* archive::
 List the files in the *first-backup* archive::
 
 
-    $ darc list /somewhere/my-backup.darc::first-backup
+    $ attic list /somewhere/my-backup.attic::first-backup
 
 
 Restore the *first-backup* archive::
 Restore the *first-backup* archive::
 
 
-    $ darc extract -v /somwhere/my-backup.darc::first-backup
+    $ attic extract -v /somwhere/my-backup.attic::first-backup
 
 
 Recover disk space by manually deleting the *first-backup* archive::
 Recover disk space by manually deleting the *first-backup* archive::
 
 
-    $ darc delete /somwhere/my-backup.darc::first-backup
+    $ attic delete /somwhere/my-backup.attic::first-backup
 
 
 Use the ``prune`` subcommand to delete all archives except a given number of
 Use the ``prune`` subcommand to delete all archives except a given number of
 *daily*, *weekly*, *monthly* and *yearly* archives::
 *daily*, *weekly*, *monthly* and *yearly* archives::
 
 
-    $ darc prune /somwhere/my-backup.darc --daily=7 --weekly=2 --monthly=6
+    $ attic prune /somwhere/my-backup.attic --daily=7 --weekly=2 --monthly=6
 
 
 
 
 .. _encrypted_repos:
 .. _encrypted_repos:
@@ -54,7 +54,7 @@ Repository encryption
 
 
 Repository encryption is enabled at repository encryption time::
 Repository encryption is enabled at repository encryption time::
 
 
-    $ darc init --passphrase | --key-file
+    $ attic init --passphrase | --key-file
 
 
 When repository encryption is enabled all data is encrypted using 256-bit AES_
 When repository encryption is enabled all data is encrypted using 256-bit AES_
 encryption and the integrity and authenticity is verified using `HMAC-SHA256`_.
 encryption and the integrity and authenticity is verified using `HMAC-SHA256`_.
@@ -68,7 +68,7 @@ Passphrase based encryption
 
 
 Key file based encryption
 Key file based encryption
     This method generates random keys at repository initialization time that
     This method generates random keys at repository initialization time that
-    are stored in a password protected file in the ``~/.darc/keys/`` directory.
+    are stored in a password protected file in the ``~/.attic/keys/`` directory.
     This method is secure and suitable for automated backups.
     This method is secure and suitable for automated backups.
 
 
     .. Note::
     .. Note::
@@ -86,8 +86,8 @@ host is accessible using SSH and |project_name| is installed.
 
 
 The following syntax is used to address remote repositories::
 The following syntax is used to address remote repositories::
 
 
-  $ darc init user@hostname:repository.darc
+  $ attic init user@hostname:repository.attic
 
 
 or::
 or::
 
 
-  $ darc init ssh://user@hostname:port/repository.darc
+  $ attic init ssh://user@hostname:port/repository.attic

+ 6 - 6
docs/global.rst.inc

@@ -1,17 +1,17 @@
-.. |project_name| replace:: ``darc``
+.. |project_name| replace:: ``Attic``
 .. |project_version| replace:: 0.6
 .. |project_version| replace:: 0.6
-.. |package_dirname| replace:: darc-|project_version|
+.. |package_dirname| replace:: Attic-|project_version|
 .. |package_filename| replace:: |package_dirname|.tar.gz
 .. |package_filename| replace:: |package_dirname|.tar.gz
-.. |package_url| replace:: https://pypi.python.org/packages/source/d/darc/darc-0.6.tar.gz
-
+.. |package_url| replace:: https://pypi.python.org/packages/source/A/Attic/Attic-0.6.tar.gz
+.. |git_url| replace:: https://github.com/jborg/attic.git
 .. _deduplication: https://en.wikipedia.org/wiki/Data_deduplication
 .. _deduplication: https://en.wikipedia.org/wiki/Data_deduplication
 .. _AES: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
 .. _AES: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
 .. _HMAC-SHA256: http://en.wikipedia.org/wiki/HMAC
 .. _HMAC-SHA256: http://en.wikipedia.org/wiki/HMAC
 .. _PBKDF2: https://en.wikipedia.org/wiki/PBKDF2
 .. _PBKDF2: https://en.wikipedia.org/wiki/PBKDF2
 .. _ACL: https://en.wikipedia.org/wiki/Access_control_list
 .. _ACL: https://en.wikipedia.org/wiki/Access_control_list
-.. _github: https://github.com/jborg/darc
+.. _github: https://github.com/jborg/attic
 .. _OpenSSL: https://www.openssl.org/
 .. _OpenSSL: https://www.openssl.org/
 .. _Python: http://www.python.org/
 .. _Python: http://www.python.org/
 .. _`msgpack-python`: https://pypi.python.org/pypi/msgpack-python/
 .. _`msgpack-python`: https://pypi.python.org/pypi/msgpack-python/
 .. _homebrew: http://mxcl.github.io/homebrew/
 .. _homebrew: http://mxcl.github.io/homebrew/
-.. _issue tracker: https://github.com/jborg/darc/issues
+.. _issue tracker: https://github.com/jborg/attic/issues

+ 6 - 6
docs/index.rst

@@ -1,8 +1,8 @@
 .. include:: global.rst.inc
 .. include:: global.rst.inc
 
 
-Darc
-====
-|project_name| is a Deduplicating ARChiver written in Python.
+Attic
+=====
+|project_name| is a deduplicating backup program written in Python.
 The main goal of |project_name| is to provide an efficient and secure way
 The main goal of |project_name| is to provide an efficient and secure way
 to backup data. The data deduplication technique used makes |project_name|
 to backup data. The data deduplication technique used makes |project_name|
 suitable for daily backups since only actual changes are stored.
 suitable for daily backups since only actual changes are stored.
@@ -28,8 +28,8 @@ Easy to use
 Initialize a new backup :ref:`repository <repository_def>` and create your
 Initialize a new backup :ref:`repository <repository_def>` and create your
 first backup :ref:`archive <archive_def>` in two lines::
 first backup :ref:`archive <archive_def>` in two lines::
 
 
-    $ darc init /usbdrive/my-backup.darc
-    $ darc create -v /usbdrive/my-backup.darc::documents ~/Documents
+    $ attic init /usbdrive/my-backup.attic
+    $ attic create -v /usbdrive/my-backup.attic::documents ~/Documents
 
 
 See the :ref:`generalusage` section for more detailed examples.
 See the :ref:`generalusage` section for more detailed examples.
 
 
@@ -37,7 +37,7 @@ Easy installation
 -----------------
 -----------------
 You can use pip to install |project_name| quickly and easily::
 You can use pip to install |project_name| quickly and easily::
 
 
-    $ pip install darc
+    $ pip install attic
 
 
 Need more help with installing? See :ref:`installation`
 Need more help with installing? See :ref:`installation`
 
 

+ 5 - 5
docs/installation.rst

@@ -20,21 +20,21 @@ Installing from PyPI using pip
 ------------------------------
 ------------------------------
 ::
 ::
 
 
-    $ pip install darc
+    $ pip install Attic
 
 
 Installing from source tarballs
 Installing from source tarballs
 -------------------------------
 -------------------------------
 .. parsed-literal::
 .. parsed-literal::
 
 
     $ curl -O |package_url|
     $ curl -O |package_url|
-    $ tar -xvzf darc-|package_filename|
+    $ tar -xvzf |package_filename|
     $ cd |package_dirname|
     $ cd |package_dirname|
     $ python setup.py install
     $ python setup.py install
 
 
 Installing from git
 Installing from git
 -------------------
 -------------------
-::
+.. parsed-literal::
 
 
-    $ git clone https://github.com/jborg/darc.git
-    $ cd darc
+    $ git clone |git_url|
+    $ cd attic
     $ python setup.py install
     $ python setup.py install

+ 3 - 3
docs/update_usage.sh

@@ -1,7 +1,7 @@
 #!/usr/bin/bash
 #!/usr/bin/bash
 echo -n > usage.rst 
 echo -n > usage.rst 
 for cmd in init create extract delete prune verify change-passphrase; do
 for cmd in init create extract delete prune verify change-passphrase; do
-  LINE=`echo -n darc $cmd | tr 'a-z ' '~'`
-  echo -e ".. _usage_darc_$cmd:\n\ndarc $cmd\n$LINE\n::\n" >> usage.rst
-  darc $cmd -h >> usage.rst
+  LINE=`echo -n attic $cmd | tr 'a-z ' '~'`
+  echo -e ".. _usage_attic_$cmd:\n\nattic $cmd\n$LINE\n::\n" >> usage.rst
+  attic $cmd -h >> usage.rst
 done
 done

+ 33 - 33
docs/usage.rst

@@ -1,10 +1,10 @@
-.. _usage_darc_init:
+.. _usage_attic_init:
 
 
-darc init
-~~~~~~~~~
+attic init
+~~~~~~~~~~
 ::
 ::
 
 
-usage: darc init [-h] [-v] [--key-file] [--passphrase] repository
+usage: attic init [-h] [-v] [--key-file] [--passphrase] repository
 
 
 Initialize a new repository
 Initialize a new repository
 
 
@@ -16,15 +16,15 @@ optional arguments:
   -v, --verbose  verbose output
   -v, --verbose  verbose output
   --key-file     enable key file based encryption
   --key-file     enable key file based encryption
   --passphrase   enable passphrase based encryption
   --passphrase   enable passphrase based encryption
-.. _usage_darc_create:
+.. _usage_attic_create:
 
 
-darc create
-~~~~~~~~~~~
+attic create
+~~~~~~~~~~~~
 ::
 ::
 
 
-usage: darc create [-h] [-v] [-s] [-e PATTERN] [-c SECONDS]
-                   [--do-not-cross-mountpoints] [--numeric-owner]
-                   ARCHIVE PATH [PATH ...]
+usage: attic create [-h] [-v] [-s] [-e PATTERN] [-c SECONDS]
+                    [--do-not-cross-mountpoints] [--numeric-owner]
+                    ARCHIVE PATH [PATH ...]
 
 
 Create new archive
 Create new archive
 
 
@@ -43,14 +43,14 @@ optional arguments:
   --do-not-cross-mountpoints
   --do-not-cross-mountpoints
                         do not cross mount points
                         do not cross mount points
   --numeric-owner       only store numeric user and group identifiers
   --numeric-owner       only store numeric user and group identifiers
-.. _usage_darc_extract:
+.. _usage_attic_extract:
 
 
-darc extract
-~~~~~~~~~~~~
+attic extract
+~~~~~~~~~~~~~
 ::
 ::
 
 
-usage: darc extract [-h] [-v] [-e PATTERN] [--numeric-owner]
-                    ARCHIVE [PATH [PATH ...]]
+usage: attic extract [-h] [-v] [-e PATTERN] [--numeric-owner]
+                     ARCHIVE [PATH [PATH ...]]
 
 
 Extract archive contents
 Extract archive contents
 
 
@@ -64,13 +64,13 @@ optional arguments:
   -e PATTERN, --exclude PATTERN
   -e PATTERN, --exclude PATTERN
                         exclude paths matching PATTERN
                         exclude paths matching PATTERN
   --numeric-owner       only obey numeric user and group identifiers
   --numeric-owner       only obey numeric user and group identifiers
-.. _usage_darc_delete:
+.. _usage_attic_delete:
 
 
-darc delete
-~~~~~~~~~~~
+attic delete
+~~~~~~~~~~~~
 ::
 ::
 
 
-usage: darc delete [-h] [-v] ARCHIVE
+usage: attic delete [-h] [-v] ARCHIVE
 
 
 Delete archive
 Delete archive
 
 
@@ -80,15 +80,15 @@ positional arguments:
 optional arguments:
 optional arguments:
   -h, --help     show this help message and exit
   -h, --help     show this help message and exit
   -v, --verbose  verbose output
   -v, --verbose  verbose output
-.. _usage_darc_prune:
+.. _usage_attic_prune:
 
 
-darc prune
-~~~~~~~~~~
+attic prune
+~~~~~~~~~~~
 ::
 ::
 
 
-usage: darc prune [-h] [-v] [-H HOURLY] [-d DAILY] [-w WEEKLY] [-m MONTHLY]
-                  [-y YEARLY] [-p PREFIX]
-                  REPOSITORY
+usage: attic prune [-h] [-v] [-H HOURLY] [-d DAILY] [-w WEEKLY] [-m MONTHLY]
+                   [-y YEARLY] [-p PREFIX]
+                   REPOSITORY
 
 
 Prune repository archives according to specified rules
 Prune repository archives according to specified rules
 
 
@@ -110,13 +110,13 @@ optional arguments:
                         number of yearly archives to keep
                         number of yearly archives to keep
   -p PREFIX, --prefix PREFIX
   -p PREFIX, --prefix PREFIX
                         only consider archive names starting with this prefix
                         only consider archive names starting with this prefix
-.. _usage_darc_verify:
+.. _usage_attic_verify:
 
 
-darc verify
-~~~~~~~~~~~
+attic verify
+~~~~~~~~~~~~
 ::
 ::
 
 
-usage: darc verify [-h] [-v] [-e PATTERN] ARCHIVE [PATH [PATH ...]]
+usage: attic verify [-h] [-v] [-e PATTERN] ARCHIVE [PATH [PATH ...]]
 
 
 Verify archive consistency
 Verify archive consistency
 
 
@@ -129,13 +129,13 @@ optional arguments:
   -v, --verbose         verbose output
   -v, --verbose         verbose output
   -e PATTERN, --exclude PATTERN
   -e PATTERN, --exclude PATTERN
                         exclude paths matching PATTERN
                         exclude paths matching PATTERN
-.. _usage_darc_change-passphrase:
+.. _usage_attic_change-passphrase:
 
 
-darc change-passphrase
-~~~~~~~~~~~-~~~~~~~~~~
+attic change-passphrase
+~~~~~~~~~~~~-~~~~~~~~~~
 ::
 ::
 
 
-usage: darc change-passphrase [-h] [-v] repository
+usage: attic change-passphrase [-h] [-v] repository
 
 
 Change passphrase on repository key file
 Change passphrase on repository key file
 
 

+ 4 - 0
scripts/attic

@@ -0,0 +1,4 @@
+#!/usr/bin/env python
+from attic.archiver import main
+main()
+

+ 0 - 4
scripts/darc

@@ -1,4 +0,0 @@
-#!/usr/bin/env python
-from darc.archiver import main
-main()
-

+ 16 - 16
setup.py

@@ -2,11 +2,11 @@
 import os
 import os
 import sys
 import sys
 from glob import glob
 from glob import glob
-import darc
+import attic
 
 
 min_python = (3, 2)
 min_python = (3, 2)
 if sys.version_info < min_python:
 if sys.version_info < min_python:
-    print("Darc requires Python %d.%d or later" % min_python)
+    print("Attic requires Python %d.%d or later" % min_python)
     sys.exit(1)
     sys.exit(1)
 
 
 try:
 try:
@@ -15,8 +15,8 @@ except ImportError:
     from distutils.core import setup, Extension
     from distutils.core import setup, Extension
 from distutils.command.sdist import sdist
 from distutils.command.sdist import sdist
 
 
-chunker_source = 'darc/chunker.pyx'
-hashindex_source = 'darc/hashindex.pyx'
+chunker_source = 'attic/chunker.pyx'
+hashindex_source = 'attic/hashindex.pyx'
 
 
 try:
 try:
     from Cython.Distutils import build_ext
     from Cython.Distutils import build_ext
@@ -24,13 +24,13 @@ try:
 
 
     class Sdist(sdist):
     class Sdist(sdist):
         def __init__(self, *args, **kwargs):
         def __init__(self, *args, **kwargs):
-            for src in glob('darc/*.pyx'):
-                cython_compiler.compile(glob('darc/*.pyx'),
+            for src in glob('attic/*.pyx'):
+                cython_compiler.compile(glob('attic/*.pyx'),
                                         cython_compiler.default_options)
                                         cython_compiler.default_options)
             sdist.__init__(self, *args, **kwargs)
             sdist.__init__(self, *args, **kwargs)
 
 
         def make_distribution(self):
         def make_distribution(self):
-            self.filelist.extend(['darc/chunker.c', 'darc/_chunker.c', 'darc/hashindex.c', 'darc/_hashindex.c'])
+            self.filelist.extend(['attic/chunker.c', 'attic/_chunker.c', 'attic/hashindex.c', 'attic/_hashindex.c'])
             super(Sdist, self).make_distribution()
             super(Sdist, self).make_distribution()
 
 
 except ImportError:
 except ImportError:
@@ -42,18 +42,18 @@ except ImportError:
     hashindex_source = hashindex_source.replace('.pyx', '.c')
     hashindex_source = hashindex_source.replace('.pyx', '.c')
     from distutils.command.build_ext import build_ext
     from distutils.command.build_ext import build_ext
     if not os.path.exists(chunker_source) or not os.path.exists(hashindex_source):
     if not os.path.exists(chunker_source) or not os.path.exists(hashindex_source):
-        raise ImportError('The GIT version of darc needs Cython. Install Cython or use a released version')
+        raise ImportError('The GIT version of attic needs Cython. Install Cython or use a released version')
 
 
 with open('README.rst', 'r') as fd:
 with open('README.rst', 'r') as fd:
     long_description = fd.read()
     long_description = fd.read()
 
 
 setup(
 setup(
-    name='darc',
-    version=darc.__release__,
+    name='Attic',
+    version=attic.__release__,
     author='Jonas Borgström',
     author='Jonas Borgström',
     author_email='jonas@borgstrom.se',
     author_email='jonas@borgstrom.se',
-    url='http://github.com/jborg/darc/',
-    description='Deduplicating ARChiver written in Python',
+    url='http://github.com/jborg/attic/',
+    description='Deduplicated backups',
     long_description=long_description,
     long_description=long_description,
     license='BSD',
     license='BSD',
     platforms=['Linux', 'MacOS X'],
     platforms=['Linux', 'MacOS X'],
@@ -68,12 +68,12 @@ setup(
         'Topic :: Security :: Cryptography',
         'Topic :: Security :: Cryptography',
         'Topic :: System :: Archiving :: Backup',
         'Topic :: System :: Archiving :: Backup',
     ],
     ],
-    packages=['darc', 'darc.testsuite'],
-    scripts=['scripts/darc'],
+    packages=['attic', 'attic.testsuite'],
+    scripts=['scripts/attic'],
     cmdclass={'build_ext': build_ext, 'sdist': Sdist},
     cmdclass={'build_ext': build_ext, 'sdist': Sdist},
     ext_modules=[
     ext_modules=[
-        Extension('darc.chunker', [chunker_source]),
-        Extension('darc.hashindex', [hashindex_source])
+        Extension('attic.chunker', [chunker_source]),
+        Extension('attic.hashindex', [hashindex_source])
     ],
     ],
     install_requires=['msgpack-python']
     install_requires=['msgpack-python']
 )
 )

+ 1 - 1
tox.ini

@@ -4,4 +4,4 @@ envlist = py32, py33
 [testenv]
 [testenv]
 # Change dir to avoid import problem
 # Change dir to avoid import problem
 changedir = docs
 changedir = docs
-commands = {envpython} -m darc.testsuite.run -bv []
+commands = {envpython} -m attic.testsuite.run -bv []