|
@@ -3,6 +3,8 @@ import os
|
|
|
import re
|
|
|
import platform
|
|
|
import subprocess
|
|
|
+from glob import glob
|
|
|
+from itertools import chain
|
|
|
|
|
|
from atticmatic.config import Section_format, option
|
|
|
from atticmatic.verbosity import VERBOSITY_SOME, VERBOSITY_LOTS
|
|
@@ -58,14 +60,15 @@ def initialize(storage_config, command):
|
|
|
|
|
|
def create_archive(
|
|
|
excludes_filename, verbosity, storage_config, source_directories, repository, command,
|
|
|
- one_file_system=None,
|
|
|
+ one_file_system=None
|
|
|
):
|
|
|
'''
|
|
|
Given an excludes filename (or None), a vebosity flag, a storage config dict, a space-separated
|
|
|
list of source directories, a local or remote repository path, and a command to run, create an
|
|
|
attic archive.
|
|
|
'''
|
|
|
- sources = tuple(re.split('\s+', source_directories))
|
|
|
+ sources = re.split('\s+', source_directories)
|
|
|
+ sources = tuple(chain.from_iterable([glob(x) if glob(x) else [x] for x in sources]))
|
|
|
exclude_flags = ('--exclude-from', excludes_filename) if excludes_filename else ()
|
|
|
compression = storage_config.get('compression', None)
|
|
|
compression_flags = ('--compression', compression) if compression else ()
|