Debian Patches

Status for ostree-push/1.1.0-1

Patch Description Author Forwarded Bugs Origin Last update
0001-Reintroduce-compatibility-with-old-0.x-clients.patch Reintroduce compatibility with old 0.x clients
Currently the command that gets launched on the receiver side is
installed as `ostree-receive`, as it was before the transition to the
new reverse-pull-over-http protocol.

This means that once the server is upgraded, older clients break badly
since the receiver side no longer understands their protocol.

To address this issue and retain compatibility with old clients:

1. install the new server side code with an unambiguous name,
`ostree-receive-1`
2. make the new client do a lookup to see if `ostree-receive-1` is
available before falling back to the ambiguous `ostree-receive` name
3. revive the old 0.x code and install it as `ostree-receive-0`
4. add a `ostree-receive` script to exec the right version depending on
the invocation parameters (the `--repo` parameter is only used by the
old code)
Emanuele Aina <emanuele.aina@collabora.com> yes 2023-04-24
0002-push-Avoid-a-race-on-the-SSH-server-socket.patch push: Avoid a race on the SSH server socket
Sometimes the SSH server is slow to exit so the tempdir cleanup manages
to see its socket file before the server deletes it, and then fails when
trying to unlink it since it is already gone.

Wait for the SSH server to exit to avoid the issue. And do not trust it
to exit on SIGTERM to avoid getting stuck waiting indefinitely.

For instance, running the testsuite on Debian Buster I frequently get
this traceback:

def test_refs(self, source_repo, dest_repo, sshd, ssh_options,
tmp_files_path, capfd):
random_commit(source_repo, tmp_files_path, 'test1')
random_commit(source_repo, tmp_files_path, 'test2')
self.push_refs(source_repo, dest_repo, sshd, ssh_options, capfd,
refs=['test1'])
self.push_refs(source_repo, dest_repo, sshd, ssh_options, capfd,
> refs=['test2'])

tests/test_push.py:263:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_push.py:223: in push_refs
ssh_options=ssh_options, command='dumpenv')
otpush/push.py:346: in push_refs
ssh.run(cmd)
/usr/lib/python3.7/tempfile.py:944: in __exit__
self.cleanup()
/usr/lib/python3.7/tempfile.py:948: in cleanup
_rmtree(self.name)
/usr/lib/python3.7/shutil.py:491: in rmtree
_rmtree_safe_fd(fd, path, onerror)
/usr/lib/python3.7/shutil.py:449: in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

topfd = 26, path = '/tmp/ostree-push-673fumwk', onerror = <function rmtree.<locals>.onerror at 0x7f569eb728c8>

def _rmtree_safe_fd(topfd, path, onerror):
try:
with os.scandir(topfd) as scandir_it:
entries = list(scandir_it)
except OSError as err:
err.filename = path
onerror(os.scandir, path, sys.exc_info())
return
for entry in entries:
fullname = os.path.join(path, entry.name)
try:
is_dir = entry.is_dir(follow_symlinks=False)
if is_dir:
orig_st = entry.stat(follow_symlinks=False)
is_dir = stat.S_ISDIR(orig_st.st_mode)
except OSError:
is_dir = False
if is_dir:
try:
dirfd = os.open(entry.name, os.O_RDONLY, dir_fd=topfd)
except OSError:
onerror(os.open, fullname, sys.exc_info())
else:
try:
if os.path.samestat(orig_st, os.fstat(dirfd)):
_rmtree_safe_fd(dirfd, fullname, onerror)
try:
os.rmdir(entry.name, dir_fd=topfd)
except OSError:
onerror(os.rmdir, fullname, sys.exc_info())
else:
try:
# This can only happen if someone replaces
# a directory with a symlink after the call to
# os.scandir or stat.S_ISDIR above.
raise OSError("Cannot call rmtree on a symbolic "
"link")
except OSError:
onerror(os.path.islink, fullname, sys.exc_info())
finally:
os.close(dirfd)
else:
try:
> os.unlink(entry.name, dir_fd=topfd)
E FileNotFoundError: [Errno 2] No such file or directory: 'socket'

/usr/lib/python3.7/shutil.py:447: FileNotFoundError
Emanuele Aina <emanuele.aina@collabora.com> yes 2023-07-14
0003-tests-Fix-Path-exception-matching-for-Python-3.12.patch tests: Fix Path exception matching for Python 3.12
On Python 3.12 the `pathlib.Path()` exception string has changed to
`argument should be a str or an os.PathLike object where __fspath__
returns a str, not 'bool'`. Matching the whole exception string was
never a great idea, but it seems like `PathLike` will always be in it
somewhere.
Dan Nicholson <dbn@endlessos.org> yes debian 2024-01-11

All known versions for source package 'ostree-push'

Links