Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-6288

Cannot upgrade packages from standard to backports version

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: PUP 3.8.7
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Environment:

      Debian system with backports configured

    • Template:

      Description

      There is a bug in the apt-provider that will not let you upgrade a package from the standard repo to the version from the backports repo although install_options => [ '-t', "${lsbdistcodename}-backports" ] was given.

      As described on http://backports.debian.org/Instructions/ all backports are disabled by default. That is: the packages are pinned to 100 (or anything between 100 and 500) which means that you have to explicitly install a backport package (apt-get install -t jessie-backports somepackage) but from then on it will be upgraded automaticallly.
      Please consider the following code:
      package

      {'foobar': ensure => latest, install_options => [ '-t', 'jessie-backports' ], }

      And consider the following situations:
      1. package foobar is not installed
      2. package foobar from the standard repo is installed but there is a newer version in backports
      3. package foobar from the backports repo is installed but there is a newer version in backports
      Puppet will execute "apt-cache policy foobar" and parse the output to determine if the package needs updating, and "apt-get install foobar -t jessie-backports" if it thinks it does.

      In situation 1 apt-cache outputs:
      Installed: (none)
      Candidate: the version from the standard repo
      Puppet will execute "apt-get install foobar -t jessie-backports" and the system gets the version from backports, although Puppet expected the standard version to be installed.
      This case turns out correctly by accident.

      In situation 2 apt-cache outputs:
      Installed: the version from the standard repo
      Candidate: that same version
      Puppet assumes wrongly there is no action needed because the installed version and candidate version are the same.

      In situation 3 apt-cache outputs:
      Installed: the version from the backports repo
      Candidate: a newer version from the backports repo
      Puppet will execute "apt-get install foobar -t jessie-backports" and the system gets the newer version from backports. This case turns out correctly more or less by accident because the installed version already was from the backports repo.

      Solution for all situations:
      What Puppet should do is recognize that -t (or --target-release or --default-release) is present in install_option and use that in the apt-cache command as well. Those options (aliases of each other) "control the default input to the policy engine" according to the man-page of apt-get. They are not mentioned in the manual of apt-cache, but apt-cache handles them correctly: in situation 2 "apt-cache policy foobar -t jessie-backports" would output:
      Installed: the version from the standard repo
      Candidate: the version from the backports repo
      and Puppet would install the newer version from backports.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            rj667 Robert Scheer
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support