Skip to content

Commit

Permalink
updater: auto-resolve conffiles conflicts only if qubes-updater is used
Browse files Browse the repository at this point in the history
previous version change behavior permanently
  • Loading branch information
piotrbartman committed Oct 2, 2024
1 parent 009d2e4 commit 0d9f8a0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 38 deletions.
2 changes: 2 additions & 0 deletions vmupdate/agent/source/apt/apt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def upgrade_internal(self, remove_obsolete: bool) -> ProcessResult:
Path(os.path.join(
apt_pkg.config.find_dir("Dir::Cache::Archives"), "partial")
).mkdir(parents=True, exist_ok=True)
apt_pkg.config.set('Dpkg::Options::', "--force-confdef")
apt_pkg.config.set('Dpkg::Options::', "--force-confold")
self.log.debug("Committing upgrade...")
self.apt_cache.commit(
self.progress.fetch_progress,
Expand Down
4 changes: 3 additions & 1 deletion vmupdate/agent/source/apt/apt_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ def get_action(self, remove_obsolete: bool) -> List[str]:
"""
Return command `upgrade` or `dist-upgrade` if `remove_obsolete`.
"""
result = ["-y"]
result = ["-y",
"-o", 'Dpkg::Options::="--force-confdef"',
"-o", 'Dpkg::Options::="--force-confold"']
result += ["dist-upgrade"] if remove_obsolete else ["upgrade"]
return result

Expand Down
37 changes: 0 additions & 37 deletions vmupdate/agent/source/plugins/apt_keep_old_conffiles.py

This file was deleted.

0 comments on commit 0d9f8a0

Please sign in to comment.