mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
freedombox Debian release 21.4.4
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWrbdQ+RCFWJSEvmd8DHXntlCAgFAmDx0YUACgkQd8DHXntl CAhYfg//dsc8XKiMWm0iBzfqoRw1n+vKWb7F/pKlCQztgK+tsUJ6kp6PCHH2P0tA HRuqmAbn+bSNefE8YhZYu0UDwE2Vo6zmc/z59ysGqJKEv6KS2mj0Ag//Lvi2X+cG xBVCexgvfB1z5l21fgOXE51KdmriXfJkFrK4VpQSQAMuxbPxpO1AStK9u2/CCKGi 7jmjlPpUTcA0AoF01bgYFVi1fIfSgpwrO27M4fMT5kTbS3iSxVjPfB97Jok7HBht W8IJ6LQCESoRyWHRSvv2N875HWpboV4oF9RaRiUtTKIlTfU3rQmZ7ByrBeGBghFr Wm2qXgmfdTKB2bik1cLWx2D9aYBgHLLyNUHqmv4qr2ExWy3RnfDiUDDein1tcnlh Amb35N/avQEV3gQnHMt0PetElOHdloFdOgepRW1e/clGL90SKJaoeMXg28trZaFv pixeC8aydoSHZqI+kzxbdKEXR/iH2tgj9JxZjdmSdRgl3SdbkYyUrGjLdRgmUpHp Y/WTgCkScuZ1/ysO0TCU7wytTqCncqmWwbvLVLKbkyHGBdwzNXOBwk6y52aVjEKc q6gqmOkiuXBbDOSq2VgGNk9y+tOmH160hpyl+qFR0mMt7JqxOiFhPb3m0mgppz0s bi2hc+cSiAMHFl+r+93u30UNVmV7jJ9XoTQE1H4Keutw0egcfBA= =AVVp -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWrbdQ+RCFWJSEvmd8DHXntlCAgFAmD8qzoACgkQd8DHXntl CAjpCxAAjIJC0VlhO0DQfSlmYZKXEfo3IhmADxO9BifM29CaMV6hBuqe2TskWsYF qHmKTpdQef+fUsbov3qOxAabWXUQVVBZmWWnp/OUR5Tf1YuMQM99wYWj/TdWXyoM tUK4137xijq4fTWe0mjCdG4HC8XOMG4uUlE3dR3nBLxa4m//o80UCresExfuW63z zj8blFXRsULIBYp5WL/+fyDjCq0pbYRQUWWErXECiTxevN5ToeGL0A0gzPSjEZ1o 0iDy7WhkWvgSZb4H/V2DUxi2LnZorCv1RME4LPGaFlwzjH3jvJyr9laTdF2tbP4v j4Aur7c33mdetcjTAjtaTW2qeioii9qWstEFR/h2rN3nuVB9lSSFRdfwHo9mVK4Y aKWPvnTxitQueaKBBT3U8ILuQrimEIGKjAAs0oB69DsS7tD1Z2v6GuzzS/J26sa0 4CmnCi1y1qY/BKH6v9TLbce6eADnWC6IL/ZvGTZHpw8mIkuTRS5mamDT5iWkNGGu gLbMSkFSTg+/xWdUL6IYHmwaCIIIdJUkyvjI+0K9M7tgZua9w8hGnS7RZoaf0jtx ml0EBOgvbco7QWLhAcZa+nRgIBzNdwqoMNMtqPSz9+3ihYfVsUqlK2zXG0xMWksa XBdczZetF98pyeXdEZWAHxfrLvo7Fzr6hBx7KaSBSHaSskhue5o= =fIO4 -----END PGP SIGNATURE----- Merge tag 'v21.4.4' into debian/buster-backports freedombox Debian release 21.4.4 Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
commit
6bfefbe9b6
@ -18,9 +18,8 @@ import apt.cache
|
|||||||
import apt_inst
|
import apt_inst
|
||||||
import apt_pkg
|
import apt_pkg
|
||||||
from plinth import cfg
|
from plinth import cfg
|
||||||
from plinth.action_utils import apt_hold, run_apt_command
|
from plinth.action_utils import (apt_hold_freedombox, is_package_manager_busy,
|
||||||
|
run_apt_command)
|
||||||
LOCK_FILE = '/var/lib/dpkg/lock'
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -93,7 +92,7 @@ def subcommand_install(arguments):
|
|||||||
extra_arguments += ['-o', 'Dpkg::Options::=--force-confmiss']
|
extra_arguments += ['-o', 'Dpkg::Options::=--force-confmiss']
|
||||||
|
|
||||||
subprocess.run(['dpkg', '--configure', '-a'])
|
subprocess.run(['dpkg', '--configure', '-a'])
|
||||||
with apt_hold():
|
with apt_hold_freedombox():
|
||||||
run_apt_command(['--fix-broken', 'install'])
|
run_apt_command(['--fix-broken', 'install'])
|
||||||
returncode = run_apt_command(['install'] + extra_arguments +
|
returncode = run_apt_command(['install'] + extra_arguments +
|
||||||
arguments.packages)
|
arguments.packages)
|
||||||
@ -115,12 +114,10 @@ def _assert_managed_packages(module, packages):
|
|||||||
|
|
||||||
|
|
||||||
def subcommand_is_package_manager_busy(_):
|
def subcommand_is_package_manager_busy(_):
|
||||||
"""Return whether package manager is busy.
|
"""Check whether package manager is busy.
|
||||||
This command uses the `lsof` command to check whether the dpkg lock file
|
|
||||||
is open which indicates that the package manager is busy"""
|
An exit code of zero indicates that package manager is busy."""
|
||||||
try:
|
if not is_package_manager_busy():
|
||||||
subprocess.check_output(['lsof', LOCK_FILE])
|
|
||||||
except subprocess.CalledProcessError:
|
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,9 +14,10 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from plinth.action_utils import (apt_hold, debconf_set_selections,
|
from plinth.action_utils import (apt_hold, apt_hold_flag, apt_hold_freedombox,
|
||||||
run_apt_command, service_daemon_reload,
|
apt_unhold_freedombox, debconf_set_selections,
|
||||||
service_restart)
|
is_package_manager_busy, run_apt_command,
|
||||||
|
service_daemon_reload, service_restart)
|
||||||
from plinth.modules.apache.components import check_url
|
from plinth.modules.apache.components import check_url
|
||||||
from plinth.modules.snapshot import (is_apt_snapshots_enabled, is_supported as
|
from plinth.modules.snapshot import (is_apt_snapshots_enabled, is_supported as
|
||||||
snapshot_is_supported, load_augeas as
|
snapshot_is_supported, load_augeas as
|
||||||
@ -141,6 +142,12 @@ def _run():
|
|||||||
"""Run unattended-upgrades"""
|
"""Run unattended-upgrades"""
|
||||||
subprocess.run(['dpkg', '--configure', '-a'])
|
subprocess.run(['dpkg', '--configure', '-a'])
|
||||||
run_apt_command(['--fix-broken', 'install'])
|
run_apt_command(['--fix-broken', 'install'])
|
||||||
|
|
||||||
|
# In case freedombox package was left in held state by an
|
||||||
|
# interrupted process, release it.
|
||||||
|
if apt_hold_flag.exists() and not is_package_manager_busy():
|
||||||
|
apt_unhold_freedombox()
|
||||||
|
|
||||||
subprocess.Popen(['systemctl', 'start', 'freedombox-manual-upgrade'],
|
subprocess.Popen(['systemctl', 'start', 'freedombox-manual-upgrade'],
|
||||||
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
|
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL, close_fds=True,
|
stderr=subprocess.DEVNULL, close_fds=True,
|
||||||
@ -432,7 +439,7 @@ def _perform_dist_upgrade():
|
|||||||
|
|
||||||
# Hold freedombox package during entire dist upgrade.
|
# Hold freedombox package during entire dist upgrade.
|
||||||
print('Holding freedombox package...', flush=True)
|
print('Holding freedombox package...', flush=True)
|
||||||
with apt_hold():
|
with apt_hold_freedombox():
|
||||||
print('Updating Apt cache...', flush=True)
|
print('Updating Apt cache...', flush=True)
|
||||||
run_apt_command(['update'])
|
run_apt_command(['update'])
|
||||||
|
|
||||||
@ -531,6 +538,11 @@ def subcommand_start_dist_upgrade(arguments):
|
|||||||
Check if a new stable release is available, and start dist-upgrade process
|
Check if a new stable release is available, and start dist-upgrade process
|
||||||
if updates are enabled.
|
if updates are enabled.
|
||||||
"""
|
"""
|
||||||
|
# In case freedombox package was left in held state by an
|
||||||
|
# interrupted process, release it.
|
||||||
|
if apt_hold_flag.exists() and not is_package_manager_busy():
|
||||||
|
apt_unhold_freedombox()
|
||||||
|
|
||||||
upgrade_ready, reason = _check_dist_upgrade(arguments.test)
|
upgrade_ready, reason = _check_dist_upgrade(arguments.test)
|
||||||
if upgrade_ready:
|
if upgrade_ready:
|
||||||
with open(DIST_UPGRADE_SERVICE_PATH, 'w') as service_file:
|
with open(DIST_UPGRADE_SERVICE_PATH, 'w') as service_file:
|
||||||
|
|||||||
10
debian/changelog
vendored
10
debian/changelog
vendored
@ -1,3 +1,13 @@
|
|||||||
|
freedombox (21.4.4) unstable; urgency=medium
|
||||||
|
|
||||||
|
* action_utils: Separate function to hold freedombox package
|
||||||
|
* action_utils: Use flag to indicate freedombox package has been held
|
||||||
|
* upgrades: Check for held freedombox package in manual update
|
||||||
|
* upgrades: Check for held freedombox package daily
|
||||||
|
* action_utils: Don't print when unholding freedombox package
|
||||||
|
|
||||||
|
-- James Valleroy <jvalleroy@mailbox.org> Fri, 16 Jul 2021 09:07:51 -0400
|
||||||
|
|
||||||
freedombox (21.4.3~bpo10+1) buster-backports; urgency=medium
|
freedombox (21.4.3~bpo10+1) buster-backports; urgency=medium
|
||||||
|
|
||||||
* Rebuild for buster-backports.
|
* Rebuild for buster-backports.
|
||||||
|
|||||||
@ -3,4 +3,4 @@
|
|||||||
Package init file.
|
Package init file.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = '21.4.3'
|
__version__ = '21.4.4'
|
||||||
|
|||||||
@ -5,6 +5,7 @@ Python action utility functions.
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
@ -15,6 +16,11 @@ logger = logging.getLogger(__name__)
|
|||||||
UWSGI_ENABLED_PATH = '/etc/uwsgi/apps-enabled/{config_name}.ini'
|
UWSGI_ENABLED_PATH = '/etc/uwsgi/apps-enabled/{config_name}.ini'
|
||||||
UWSGI_AVAILABLE_PATH = '/etc/uwsgi/apps-available/{config_name}.ini'
|
UWSGI_AVAILABLE_PATH = '/etc/uwsgi/apps-available/{config_name}.ini'
|
||||||
|
|
||||||
|
# Flag on disk to indicate if freedombox package was held by
|
||||||
|
# plinth. This is a backup in case the process is interrupted and hold
|
||||||
|
# is not released.
|
||||||
|
apt_hold_flag = pathlib.Path('/var/lib/freedombox/package-held')
|
||||||
|
|
||||||
|
|
||||||
def is_systemd_running():
|
def is_systemd_running():
|
||||||
"""Return if we are running under systemd."""
|
"""Return if we are running under systemd."""
|
||||||
@ -413,11 +419,8 @@ def run_apt_command(arguments):
|
|||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def apt_hold(packages=None, ignore_errors=False):
|
def apt_hold(packages, ignore_errors=False):
|
||||||
"""Prevent packages from being removed during apt operations."""
|
"""Prevent packages from being removed during apt operations."""
|
||||||
if not packages:
|
|
||||||
packages = ['freedombox']
|
|
||||||
|
|
||||||
current_hold = subprocess.check_output(['apt-mark', 'showhold'] + packages)
|
current_hold = subprocess.check_output(['apt-mark', 'showhold'] + packages)
|
||||||
try:
|
try:
|
||||||
yield current_hold or subprocess.run(['apt-mark', 'hold'] + packages,
|
yield current_hold or subprocess.run(['apt-mark', 'hold'] + packages,
|
||||||
@ -426,3 +429,42 @@ def apt_hold(packages=None, ignore_errors=False):
|
|||||||
if not current_hold:
|
if not current_hold:
|
||||||
subprocess.run(['apt-mark', 'unhold'] + packages,
|
subprocess.run(['apt-mark', 'unhold'] + packages,
|
||||||
check=not ignore_errors)
|
check=not ignore_errors)
|
||||||
|
|
||||||
|
|
||||||
|
@contextmanager
|
||||||
|
def apt_hold_freedombox():
|
||||||
|
"""Prevent freedombox package from being removed during apt operations."""
|
||||||
|
current_hold = subprocess.check_output(
|
||||||
|
['apt-mark', 'showhold', 'freedombox'])
|
||||||
|
try:
|
||||||
|
if current_hold:
|
||||||
|
# Package is already held, possibly by administrator.
|
||||||
|
yield current_hold
|
||||||
|
else:
|
||||||
|
# Set the flag.
|
||||||
|
apt_hold_flag.touch(mode=0o660)
|
||||||
|
yield subprocess.check_call(['apt-mark', 'hold', 'freedombox'])
|
||||||
|
finally:
|
||||||
|
# Was the package held, either in this process or a previous one?
|
||||||
|
if not current_hold or apt_hold_flag.exists():
|
||||||
|
apt_unhold_freedombox()
|
||||||
|
|
||||||
|
|
||||||
|
def apt_unhold_freedombox():
|
||||||
|
"""Remove any hold on freedombox package, and clear flag."""
|
||||||
|
subprocess.run(['apt-mark', 'unhold', 'freedombox'],
|
||||||
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
if apt_hold_flag.exists():
|
||||||
|
apt_hold_flag.unlink()
|
||||||
|
|
||||||
|
|
||||||
|
def is_package_manager_busy():
|
||||||
|
"""Return whether package manager is busy.
|
||||||
|
This command uses the `lsof` command to check whether the dpkg lock file
|
||||||
|
is open which indicates that the package manager is busy"""
|
||||||
|
LOCK_FILE = '/var/lib/dpkg/lock'
|
||||||
|
try:
|
||||||
|
subprocess.check_output(['lsof', LOCK_FILE])
|
||||||
|
return True
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
return False
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user