mirror of https://github.com/borgbackup/borg.git
Merge pull request #4144 from step21/1.1-maint
misc backports to 1.1-maint
This commit is contained in:
commit
b2f887e4b3
|
@ -30,8 +30,8 @@ from borg import xattr
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def clean_env(tmpdir_factory, monkeypatch):
|
def clean_env(tmpdir_factory, monkeypatch):
|
||||||
# avoid that we access / modify the user's normal .config / .cache directory:
|
# avoid that we access / modify the user's normal .config / .cache directory:
|
||||||
monkeypatch.setenv('XDG_CONFIG_HOME', tmpdir_factory.mktemp('xdg-config-home'))
|
monkeypatch.setenv('XDG_CONFIG_HOME', str(tmpdir_factory.mktemp('xdg-config-home')))
|
||||||
monkeypatch.setenv('XDG_CACHE_HOME', tmpdir_factory.mktemp('xdg-cache-home'))
|
monkeypatch.setenv('XDG_CACHE_HOME', str(tmpdir_factory.mktemp('xdg-cache-home')))
|
||||||
# also avoid to use anything from the outside environment:
|
# also avoid to use anything from the outside environment:
|
||||||
keys = [key for key in os.environ if key.startswith('BORG_')]
|
keys = [key for key in os.environ if key.startswith('BORG_')]
|
||||||
for key in keys:
|
for key in keys:
|
||||||
|
|
|
@ -2674,7 +2674,7 @@ class Archiver:
|
||||||
if tag_files:
|
if tag_files:
|
||||||
add_option('--exclude-caches', dest='exclude_caches', action='store_true',
|
add_option('--exclude-caches', dest='exclude_caches', action='store_true',
|
||||||
help='exclude directories that contain a CACHEDIR.TAG file '
|
help='exclude directories that contain a CACHEDIR.TAG file '
|
||||||
'(http://www.brynosaurus.com/cachedir/spec.html)')
|
'(http://www.bford.info/cachedir/spec.html)')
|
||||||
add_option('--exclude-if-present', metavar='NAME', dest='exclude_if_present',
|
add_option('--exclude-if-present', metavar='NAME', dest='exclude_if_present',
|
||||||
action='append', type=str,
|
action='append', type=str,
|
||||||
help='exclude directories that are tagged by containing a filesystem object with '
|
help='exclude directories that are tagged by containing a filesystem object with '
|
||||||
|
|
|
@ -516,7 +516,7 @@ def get_cache_dir():
|
||||||
fd.write(textwrap.dedent("""
|
fd.write(textwrap.dedent("""
|
||||||
# This file is a cache directory tag created by Borg.
|
# This file is a cache directory tag created by Borg.
|
||||||
# For information about cache directory tags, see:
|
# For information about cache directory tags, see:
|
||||||
# http://www.brynosaurus.com/cachedir/
|
# http://www.bford.info/cachedir/spec.html
|
||||||
""").encode('ascii'))
|
""").encode('ascii'))
|
||||||
return cache_dir
|
return cache_dir
|
||||||
|
|
||||||
|
@ -594,7 +594,7 @@ def dir_is_cachedir(path):
|
||||||
"""Determines whether the specified path is a cache directory (and
|
"""Determines whether the specified path is a cache directory (and
|
||||||
therefore should potentially be excluded from the backup) according to
|
therefore should potentially be excluded from the backup) according to
|
||||||
the CACHEDIR.TAG protocol
|
the CACHEDIR.TAG protocol
|
||||||
(http://www.brynosaurus.com/cachedir/spec.html).
|
(http://www.bford.info/cachedir/spec.html).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
tag_path = os.path.join(path, CACHE_TAG_NAME)
|
tag_path = os.path.join(path, CACHE_TAG_NAME)
|
||||||
|
|
|
@ -62,4 +62,4 @@ def translate(pat, match_end=r"\Z"):
|
||||||
else:
|
else:
|
||||||
res += re.escape(c)
|
res += re.escape(c)
|
||||||
|
|
||||||
return res + match_end + "(?ms)"
|
return "(?ms)" + res + match_end
|
||||||
|
|
|
@ -67,7 +67,7 @@ class TestKey:
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def keys_dir(self, request, monkeypatch, tmpdir):
|
def keys_dir(self, request, monkeypatch, tmpdir):
|
||||||
monkeypatch.setenv('BORG_KEYS_DIR', tmpdir)
|
monkeypatch.setenv('BORG_KEYS_DIR', str(tmpdir))
|
||||||
return tmpdir
|
return tmpdir
|
||||||
|
|
||||||
@pytest.fixture(params=(
|
@pytest.fixture(params=(
|
||||||
|
|
Loading…
Reference in New Issue