-
Notifications
You must be signed in to change notification settings - Fork 461
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
Conversation
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'] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@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. |
There was a problem hiding this comment.
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 :).
Looks good to me, squash and merge! |
closing in favor of #494 |
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 😞.