Package: unattended-upgrades
Version: 0.93.1
Severity: important

In order to coordinate with the new split downloading and installing
in the systemd timer in apt 1.4.6, unattended-upgrades needs to gain
a --download-only flag (the flag needs precisely that name, that is
what apt is querying for).

Without the --download-only flag, downloads of new updates all happen
within a fairly short time window, potentially causing issues with
traffic load.

For more details, see https://bugs.debian.org/861357 and 
https://bugs.launchpad.net/bugs/1686470

Draft of a patch attached, needs testing.

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (900, 'unstable'), (500, 'unstable-debug'), (500, 
'buildd-unstable'), (500, 'testing'), (100, 'experimental'), (1, 
'experimental-debug')
Architecture: amd64
 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.11.0-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages unattended-upgrades depends on:
ii  apt                    1.4.3~1.gbpf45046
ii  apt-utils              1.4.3~1.gbpf45046
ii  debconf [debconf-2.0]  1.5.60
ii  init-system-helpers    1.48
ii  lsb-base               9.20161125
ii  lsb-release            9.20161125
ii  python3                3.5.3-1
ii  python3-apt            1.4.0~beta3
ii  ucf                    3.0036
ii  xz-utils               5.2.2-1.2+b1

Versions of packages unattended-upgrades recommends:
ii  anacron             2.3-23
ii  cron [cron-daemon]  3.0pl1-128+b1

Versions of packages unattended-upgrades suggests:
ii  bsd-mailx                         8.1.2-0.20160123cvs-4
ii  esmtp-run [mail-transport-agent]  1.2-14
pn  needrestart                       <none>

-- debconf information excluded

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev
                  |  Ubuntu Core Developer |
When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to ('inline').  Thank you.
diff -Nru unattended-upgrades-0.93.1/debian/changelog unattended-upgrades-0.93.1+nmu1/debian/changelog
--- unattended-upgrades-0.93.1/debian/changelog	2016-12-11 11:31:26.000000000 +0100
+++ unattended-upgrades-0.93.1+nmu1/debian/changelog	2017-06-01 08:45:07.000000000 +0200
@@ -1,3 +1,10 @@
+unattended-upgrades (0.93.1+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add a --download-only option (see #863859)
+
+ -- Julian Andres Klode <[email protected]>  Thu, 01 Jun 2017 08:45:07 +0200
+
 unattended-upgrades (0.93.1) unstable; urgency=medium
 
   [ Brian Murray ]
diff -Nru unattended-upgrades-0.93.1/test/unattended_upgrade.py unattended-upgrades-0.93.1+nmu1/test/unattended_upgrade.py
--- unattended-upgrades-0.93.1/test/unattended_upgrade.py	2016-12-11 11:31:26.000000000 +0100
+++ unattended-upgrades-0.93.1+nmu1/test/unattended_upgrade.py	2017-06-01 08:44:48.000000000 +0200
@@ -1310,6 +1310,9 @@
     res = fetcher.run()
     logging.debug("fetch.run() result: %s", res)
 
+    if options.download_only:
+        return
+
     if dpkg_conffile_prompt():
         # now check the downloaded debs for conffile conflicts and build
         # a blacklist
@@ -1516,6 +1519,9 @@
     parser.add_option("", "--dry-run",
                       action="store_true", default=False,
                       help=_("Simulation, download but do not install"))
+    parser.add_option("", "--download-only",
+                      action="store_true", default=False,
+                      help=_("Only download, do not even try to install."))
     parser.add_option("", "--minimal-upgrade-steps",
                       action="store_true", default=False,
                       help=_("Upgrade in minimal steps (and allow "
diff -Nru unattended-upgrades-0.93.1/unattended-upgrade unattended-upgrades-0.93.1+nmu1/unattended-upgrade
--- unattended-upgrades-0.93.1/unattended-upgrade	2016-12-11 11:31:26.000000000 +0100
+++ unattended-upgrades-0.93.1+nmu1/unattended-upgrade	2017-06-01 08:44:48.000000000 +0200
@@ -1310,6 +1310,9 @@
     res = fetcher.run()
     logging.debug("fetch.run() result: %s", res)
 
+    if options.download_only:
+        return
+
     if dpkg_conffile_prompt():
         # now check the downloaded debs for conffile conflicts and build
         # a blacklist
@@ -1516,6 +1519,9 @@
     parser.add_option("", "--dry-run",
                       action="store_true", default=False,
                       help=_("Simulation, download but do not install"))
+    parser.add_option("", "--download-only",
+                      action="store_true", default=False,
+                      help=_("Only download, do not even try to install."))
     parser.add_option("", "--minimal-upgrade-steps",
                       action="store_true", default=False,
                       help=_("Upgrade in minimal steps (and allow "

Reply via email to