diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9287f59b..82bca84f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,15 +51,17 @@ py3: - TOXENV: py3 IMAGE: [python:3.6, python:3.7, python:3.8, python:3.9, python:3.10] -buster-rdiff-backup2: +rdiff-backup-beta: <<: *tox - image: python:3.7-buster + image: python:3.9-bullseye variables: TOXENV: buster + allow_failure: true before_script: - apt-get update - apt -y install librsync-dev - - pip install "rdiff-backup<3,>=2" tox + - pip install tox + - pip install -U --pre rdiff-backup debian: <<: *tox diff --git a/rdiffweb/core/librdiff.py b/rdiffweb/core/librdiff.py index 015323a2..c97d8042 100644 --- a/rdiffweb/core/librdiff.py +++ b/rdiffweb/core/librdiff.py @@ -1157,14 +1157,16 @@ def restore(self, path, restore_as_of, kind=None): stderr=subprocess.PIPE, env=None, ) - # Check if the processing is properly started - # Read stderr output until "Starting restore of" + # Check if the restore process is properly starting + # Read the first 100 line until "Processing changed file" + max_line = 100 output = b'' success = False line = proc.stderr.readline() - while line: + while max_line > 0 and line: + max_line -= 1 output += line - if b'Starting restore of' in line: + if b'Processing changed file' in line: success = True break line = proc.stderr.readline() diff --git a/rdiffweb/core/restore.py b/rdiffweb/core/restore.py index 4df6cd8d..bad7e07b 100644 --- a/rdiffweb/core/restore.py +++ b/rdiffweb/core/restore.py @@ -235,6 +235,9 @@ def restore(restore, restore_as_of, kind, encoding, dest, log=logger.debug): # Read the output of rdiff-backup with popen(cmd, env=env) as output: for line in output: + # Since rdiff-backup 2.1.2b1 the line start with b'* ' + if line.startswith(b'* '): + line = line[2:] line = line.rstrip(b'\n') log('rdiff-backup: %r' % line) if not line.startswith(TOKEN): diff --git a/rdiffweb/core/tests/test_restore.py b/rdiffweb/core/tests/test_restore.py index 0349617f..3cc8a363 100644 --- a/rdiffweb/core/tests/test_restore.py +++ b/rdiffweb/core/tests/test_restore.py @@ -30,9 +30,9 @@ import unittest from zipfile import ZipFile +import rdiffweb.test from rdiffweb.core.librdiff import popen from rdiffweb.core.restore import restore -from rdiffweb.test import AppTestCase EXPECTED = {} EXPECTED["이루마 YIRUMA - River Flows in You.mp3"] = 3636731 @@ -76,12 +76,12 @@ def restore_async(*args, **kwargs): thread.start() -class RestoreTest(AppTestCase): +class RestoreTest(rdiffweb.test.WebCase): maxDiff = None def setUp(self): - AppTestCase.setUp(self) + super().setUp() # Define path to be archived self.path = os.path.join(self.testcases.encode('ascii'), b'testcases')