Multiple fixes for issues reported to BTS and Launchpad #83

Merged
merged 32 commits into from Dec 21, 2017

Conversation

Projects
None yet
4 participants
Collaborator

rbalint commented Dec 14, 2017

No description provided.

rbalint and others added some commits Oct 16, 2017

Fix log file location in man page
Thanks: Jaakov
Closes: #817974
Process packages needing smaller upgrade sets earlier in generating m…
…inimal upgrade sets

Inspired by Michael Vogt's partition pre-calculation code
Install upgrades from ${distro_codename}, label=Debian by default
This enables updates from stable point releases but also lets testing
and sid being updated with the package updates.
Fixes #33.

Closes: #787945, #597061
Stop asking debconf question about Origins-Pattern
50unattended-upgrades now contains multiple origins by default and setting
them from debconf can't be made really easy. Users should change the
configuration file itself instead.

LP: #1577215
Test upgrading a full system with desktop packages in autopkgtest
Also pick different shapshots with which does not contain
broken packages.
debian/tests/upgrade-between-snapshots
@@ -16,7 +16,8 @@ case "$(lsb_release -s -i)" in
# install u-u to pull in dependencies and mark python3.5-minimal
# because otherwise u-u autoremoves it while running python3.5 code
chroot $chroot_dir apt-get install -y unattended-upgrades python3.5-minimal
- # TODO add a few interesting packages to upgrade
+ # add package set with many dependencies
+ chroot $chroot_dir apt-get install -y xfce4

mvo5 approved these changes Dec 20, 2017

Nice! Tiny nitpick/question inside.

+
+set -e
+
+chroot_dir=$AUTOPKGTEST_TMP/chroot
@mvo5

mvo5 Dec 20, 2017

Owner

Nice test!

@@ -504,15 +504,39 @@ def upgrade_in_minimal_steps(cache, # type: apt.Cache
# double check any changes we do
allowed_origins = get_allowed_origins()
+ # pre-calculate set sizes to process sets which are expected to be smaller
+ # earlier
+ upgrade_set_sizes = {}
@mvo5

mvo5 Dec 20, 2017

Owner

Won't this need a mypy type annotation?

@rbalint

rbalint Dec 21, 2017

Collaborator

I have not used mypy on this project but now trying it it reports several issues which I'll resolve in the next PR.
I'm also adding an annotation for this variable.

@mvo5

mvo5 Dec 21, 2017

Owner

Thanks! I added mypy hints a while ago, I thought I also added a corresponding test that is run in travis. Let me check what is going on there.

pkg_conffiles = deb.control.extractdata("conffiles").strip().decode(
"utf-8")
+ except SystemError as e:
+ print(_("Apt returned an error, exiting"))
+ print(_("error message: '%s'") % e)
@mvo5

mvo5 Dec 20, 2017

Owner

Maybe remove this print and just raise again at the sys.exit(1) point?

@rbalint

rbalint Dec 21, 2017

Collaborator

For the users raising the issue would be as informative as printing it, but I'd like to avoid reporting known and handled errors to errors.ubuntu.com.

@@ -759,6 +789,15 @@ def conffile_prompt(destFile, prefix=""):
# record for later
dpkg_status_conffiles[conf_file] = md5
+ # the package replaces a directory wih a configuration file
@mvo5

mvo5 Dec 20, 2017

Owner

Nice catch

@rbalint rbalint merged commit 43a717c into mvo5:master Dec 21, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment