Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports and pinning #492

Closed
wants to merge 7 commits into from
Closed

Backports and pinning #492

wants to merge 7 commits into from

Conversation

daenney
Copy link

@daenney daenney commented Apr 7, 2015

First commit introduces support for complex pins on apt::source, essentially in the same way we support complex keys.

The second commit re-introduces the backports class but is currently lacking tests 😞.

daenney added 2 commits April 7, 2015 13:52
This adds support for passing in a full pin declaration as the pin
parameter on a source declaration.

It keeps the old behaviour intact, you can still simply do `pin => '10'`
and it will pin on origin with a priority of 10.

Should that not be what you want you can now pass in a full pin
declaration instead. We make no assumptions here, whatever you pass in
will be passed through to pin as-is with the exception of the values for
`ensure` and `before` which are always overridden by us to ensure
everything keeps working as designed.
This is currently lacking tests.
$_location = $::apt::backports['location']
$_release = "${::apt::xfacts['lsbdistcodename']}-backports"
$_repos = $::apt::backports['repos']
$_key = $::apt::backports['key']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should probably have these be the default values, but still allow the user to pass custom location, release, repos, or key? Right now this just ignores the params if you're on debian or ubuntu.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. I'm just not sure how to do it in a clean way that doesn't get in your way if you're on Debian/Ubuntu but does by default nag at you if you're not.

I considered binding it as a parameter but then you have to go like this:

if (($::apt::xfacts['lsbdistid'] != 'debian' or
   $::apt::xfacts['lsbdistid'] != 'ubuntu') and
   $location == $::apt::backports['location']) {
    fail('If you're not on Debian/Ubuntu you need to explicitly pass location')
}

It gets very scary.

@underscorgan underscorgan added this to the 2.0 milestone Apr 7, 2015
@underscorgan
Copy link

@daenney can you review my doc/test/code updates? If I get a 👍 I'm willing to press the merge button (though maybe should squash first)


By default, this class drops a pin-file for backports, pinning it to a priority of 200. This is lower than the normal Debian archive, which gets a priority of 500 to ensure that packages with `ensure => latest` don't get magically upgraded from backports without your explicit permission.

If you raise the priority through the `pin_priority` parameter to 500---identical to the rest of the Debian mirrors---normal policy goes into effect, and Apt installs or upgrades to the newest version. This means that if a package is available from backports, it and its dependencies are pulled in from backports unless you explicitly set the `ensure` attribute of the `package` resource to `installed`/`present` or a specific version.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pin, not pin_priority anymore :).

@daenney
Copy link
Author

daenney commented Apr 8, 2015

Looks good to me, squash and merge!

@underscorgan
Copy link

closing in favor of #494

@underscorgan underscorgan deleted the hello-backports branch April 8, 2015 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants