Merge pull request #4144 from step21/1.1-maint

misc backports to 1.1-maint
This commit is contained in:
TW 2018-11-02 23:57:51 +01:00 committed by GitHub
commit b2f887e4b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -30,8 +30,8 @@ from borg import xattr
@pytest.fixture(autouse=True)
def clean_env(tmpdir_factory, monkeypatch):
# 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_CACHE_HOME', tmpdir_factory.mktemp('xdg-cache-home'))
monkeypatch.setenv('XDG_CONFIG_HOME', str(tmpdir_factory.mktemp('xdg-config-home')))
monkeypatch.setenv('XDG_CACHE_HOME', str(tmpdir_factory.mktemp('xdg-cache-home')))
# also avoid to use anything from the outside environment:
keys = [key for key in os.environ if key.startswith('BORG_')]
for key in keys:

View File

@ -2674,7 +2674,7 @@ class Archiver:
if tag_files:
add_option('--exclude-caches', dest='exclude_caches', action='store_true',
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',
action='append', type=str,
help='exclude directories that are tagged by containing a filesystem object with '

View File

@ -516,7 +516,7 @@ def get_cache_dir():
fd.write(textwrap.dedent("""
# This file is a cache directory tag created by Borg.
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/
# http://www.bford.info/cachedir/spec.html
""").encode('ascii'))
return cache_dir
@ -594,7 +594,7 @@ def dir_is_cachedir(path):
"""Determines whether the specified path is a cache directory (and
therefore should potentially be excluded from the backup) according to
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)

View File

@ -62,4 +62,4 @@ def translate(pat, match_end=r"\Z"):
else:
res += re.escape(c)
return res + match_end + "(?ms)"
return "(?ms)" + res + match_end

View File

@ -67,7 +67,7 @@ class TestKey:
@pytest.fixture
def keys_dir(self, request, monkeypatch, tmpdir):
monkeypatch.setenv('BORG_KEYS_DIR', tmpdir)
monkeypatch.setenv('BORG_KEYS_DIR', str(tmpdir))
return tmpdir
@pytest.fixture(params=(