univention.updater.scripts package#
Submodules#
univention.updater.scripts.actualize module#
- class univention.updater.scripts.actualize.Tee(files: Sequence[str] = [], stdout: bool = True, filter: str | None = None)[source]#
Bases:
objectWrites the given string to several files at once. Could by used with the print statement
- univention.updater.scripts.actualize.getUpdate() None[source]#
Small function waiting for apt lockfile to vanish then starts apt-get update
- univention.updater.scripts.actualize.check(configRegistry: ConfigRegistry, dist_upgrade: bool = False) bool[source]#
Just probe if there are packages to add or remove
- Parameters:
dist_upgrade – Perform distribution upgrade instead of package updates.
- Returns:
True if there are package changes.
- univention.updater.scripts.actualize.getPackageList(configRegistry: ConfigRegistry, job: Literal['add', 'remove']) list[str][source]#
Get a list of packages to remove or add, depending on the value of job.
- Parameters:
configRegistry – UCR instance.
job – add or remove.
- Returns:
List of package names.
univention.updater.scripts.kernel module#
Prune no longer required Linux kernel packages.
univention.updater.scripts.list_installed_unmaintained_packages module#
This script lists all currently installed packages that are not maintained by Univention.
- univention.updater.scripts.list_installed_unmaintained_packages.get_unmaintained_packages(maintained: IO[str]) set[str][source]#
- univention.updater.scripts.list_installed_unmaintained_packages.get_installed_packages() tuple[set[str], set[str]][source]#
- univention.updater.scripts.list_installed_unmaintained_packages.get_maintained_packages(maintained: IO[str]) set[str][source]#
- univention.updater.scripts.list_installed_unmaintained_packages.print_packages(packages: set[str]) None[source]#
- univention.updater.scripts.list_installed_unmaintained_packages.print_unmaintained_packages(packages: set[str]) None[source]#
univention.updater.scripts.policy_maintenance module#
- univention.updater.scripts.policy_maintenance.write_cron_job(configRegistry: ConfigRegistry, cron: str, updateto: str, reboot: str, try_release_update: bool) None[source]#
univention.updater.scripts.policy_repo_server module#
- univention.updater.scripts.policy_repo_server.query_policy(ldap_hostdn: str) tuple[str, str][source]#
Retrieve updateServer and version from policy.
univention.updater.scripts.policy_repo_sync module#
univention.updater.scripts.repo_create module#
Creates a local repository.
- univention.updater.scripts.repo_create.check_preconditions(options: Namespace) None[source]#
Check for already existing mirror and for debmirror package
univention.updater.scripts.repo_update module#
Update a local repository.
- univention.updater.scripts.repo_update.copy_repository(options: Namespace, source: str, version: UCS_Version) None[source]#
Copy packages and scripts belonging to version from source directory into local repository
univention.updater.scripts.statistics module#
- univention.updater.scripts.statistics.encode_number(number: int, significant_digits: int = 3) str[source]#
univention.updater.scripts.updater module#
Tool for updating local system
- exception univention.updater.scripts.updater.UpdateError(msg: str, errorsource: Literal['SETTINGS', 'PREPARATION', 'PREUP', 'UPDATE', 'POSTUP'])[source]#
Bases:
ExceptionException to signal errors on update.
- Parameters:
msg – Human readable message.
errorsource – One of ‘SETTINGS’, ‘PREPARATION’, ‘PREUP’, ‘UPDATE’, ‘POSTUP’
- univention.updater.scripts.updater.dprint(str: Any) None[source]#
Print message to stdout and LOGNAME.
- univention.updater.scripts.updater.update_status(**kwargs: str) None[source]#
update updater_status and write status to disk
Keys: - current_version ==> UCS_Version ==> 2.3-1 - next_version ==> UCS_Version ==> 2.3-2 - target_version ==> UCS_Version ==> 2.4-0 - type ==> (LOCAL|NET) - status ==> (RUNNING|FAILED|DONE) - phase ==> (PREPARATION|PREUP|UPDATE|POSTUP) ==> only valid if status=RUNNING - errorsource ==> (SETTINGS|PREPARATION|PREUP|UPDATE|POSTUP)
- univention.updater.scripts.updater.get_status() dict[str, str][source]#
Read Updater status from file.
- Returns:
Dictionary with status
See also
- univention.updater.scripts.updater.remove_temporary_sources_list() None[source]#
Add the temporary sources.list.
- univention.updater.scripts.updater.add_temporary_sources_list(temporary_sources_list: Iterable[str]) None[source]#
Add line to a temporary sources.list.
- univention.updater.scripts.updater.update_available(opt: Namespace, ucr: ConfigRegistry) tuple[UniventionUpdater, UCS_Version | None][source]#
Checks if there is an update available. Returns the next version, or None if up-to-date, or throws an UpdateError if the next version can not be identified.
- univention.updater.scripts.updater.update_local(opt: Namespace, ucr: ConfigRegistry) tuple[UniventionUpdater, UCS_Version | None][source]#
- univention.updater.scripts.updater.update_net(opt: Namespace, ucr: ConfigRegistry) tuple[UniventionUpdater, UCS_Version | None][source]#
- univention.updater.scripts.updater.call_local(opt: Namespace) NoReturn[source]#
Call updater in “local” mode.
- univention.updater.scripts.updater.parse_args(args: Sequence[str] | None = None) Namespace[source]#
Parse command line arguments.
- univention.updater.scripts.updater.setup_logging(opt: Namespace, ucr: ConfigRegistry) IO[str][source]#
- univention.updater.scripts.updater.check(opt: Namespace, ucr: ConfigRegistry) bool[source]#
Return pending update status.
- univention.updater.scripts.updater.find(opt: Namespace, ucr: ConfigRegistry) tuple[UniventionUpdater, UCS_Version] | None[source]#
- univention.updater.scripts.updater.run(opt: Namespace, ucr: ConfigRegistry, updater: UniventionUpdater, nextversion: UCS_Version) None[source]#
univention.updater.scripts.upgrade module#
Install UCS release and errata updates.
- univention.updater.scripts.upgrade.dprint(silent: bool, msg: str, newline: bool = True, debug: bool = False) None[source]#
Print debug output.
- univention.updater.scripts.upgrade.update_status(**kwargs: str) None[source]#
update updater_status and write status to disk
Keys: - current_version ==> UCS_Version ==> 2.3-1 - next_version ==> UCS_Version ==> 2.3-2 - updatetype ==> (LOCAL|NET) - status ==> (RUNNING|FAILED|DONE) - errorsource ==> (SETTINGS|PREPARATION|PREUP|UPDATE|POSTUP)
- univention.updater.scripts.upgrade.readcontinue(msg: str) bool[source]#
Print message and read yes/no/abort answer.
- univention.updater.scripts.upgrade.performUpdate(options: Namespace, checkForUpdates: bool = False, silent: bool = False) bool | None[source]#
- univention.updater.scripts.upgrade.do_release_update(options: Namespace, checkForUpdates: bool, silent: bool) bool[source]#
- univention.updater.scripts.upgrade.do_package_updates(options: Namespace, checkForUpdates: bool, silent: bool) bool[source]#