-
Notifications
You must be signed in to change notification settings - Fork 462
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
Fix for debian/ubuntu hold and a way to add debian src only #333
Conversation
wilman0
commented
Jul 18, 2014
- modules "apt hold" handling is broken in debian stable cause files in /etc/apt/preferences.d will be silently ignored if files will be split by a blank
- add a way to add deb-src to sources.list (useful for build server like jenkins)
@@ -83,8 +84,9 @@ | |||
if param_hash[:architecture] | |||
arch = "[arch=#{param_hash[:architecture]}] " | |||
end | |||
content << "\ndeb #{arch}#{param_hash[:location]} #{param_hash[:release]} #{param_hash[:repos]}\n" | |||
|
|||
if param_hash [:include_debsrc] |
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.
How is this different from include_src
?
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.
correct me if im wrong
include_src is just an additional parameter to include a deb + a deb-src line to sources.list. its not possible to include a src line without an deb line using parameter include_src. right?
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.
Sure. But then I don't understand what you're trying to do.
If you want only a deb-src
line and no deb
line it would have to be named differently, like only_debsrc
, check if include_src
is actually set to true and on a combination of those conditions only write out a deb-src
line and make sure a deb
line doesn't exist. Your commit also doesn't seem to do anything with regard to deb-src
lines, it writes a deb
line.
I also don't understand what your perceive to benefit from only having deb-src
lines instead of having both deb
and deb-src
.
code updated: include_deb now behave like a switch for "include_deb". the default is include_deb = true like already mentioned this feature is useful for debian/ubuntu build servers. on a debian wheezy build server you want to include deb-src lines for debian/testing or debian/sid aswell (there is no need for a "debian/testing deb" entry on these servers. |
Right, now I'm starting to get what you want to do. |
You've broken a few of the tests:
|
i think the problem is one of my changes and your tests ;) according to debian manpage its impossible to set hold for a package by creating a file "/etc/apt/preferenced.d/hold vim at 1.1.1" all files in path /etc/apt/preferences.d/ delimited by a blank will be silently ignored (give me some time to find the manpage section) correct and debian valid name would be "hold_packagename" with delimiter "_" next problem and part of my pull request: please dont create hold files name scheme "hold packagename at versionnumber". we use the pupperlabs-apt module to handle puppet/puppet-common version and to update our puppet version (on all servers) a change in our puppetlabs-apt manifest to increase the version of puppet results in two different files in /etc/apt/preferences.d example workflow:
or is there a way to purge all the files in /etc/apt/preferences.d/ before creating a new hold file? |
The spec failure is your own mistake, not my tests. You've modified the title of the file passed in by My tests were correctly checking the previous behaviour, which is why the build was nice and green. Even though the previous behaviour might be wrong the tests correctly replicated it. Since you've altered the behaviour, ergo the catalog that's being generated, you need to alter the tests that go with it too. Until the build goes green this PR won't be considered for merge. |
oh sorry....never used/touched a travis service....thought these checks are only a part of travis-ci/travis configuration. give me a moment to fix this |
Oh this is fun, now it's only complaining about Puppet 3. I'll look into that. |
can you give me a hint on this one (for future tests) if "include_deb" is true deb line will be added to "content" var (line 87) Failures:
|
any chance to get this code upstream? do you need more tests...more infos...more code? with these changes we can switch back to upstream module... |
i'd also like to see this fix applied. @wilman0 i think it would get merged if travis builds clean. maybe you can have a look at that? :) |
Is it possible to move apt::hold fix to a separate pull request? It would be easier to merge it then. |
@@ -83,8 +84,9 @@ | |||
if param_hash[:architecture] | |||
arch = "[arch=#{param_hash[:architecture]}] " | |||
end | |||
content << "\ndeb #{arch}#{param_hash[:location]} #{param_hash[:release]} #{param_hash[:repos]}\n" | |||
|
|||
if param_hash [:include_deb] |
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.
@wilman0 there's an extra space that's causing unit test failures. Should be
if param_hash[:include_deb]
Since you added a new parameter @wilman0 for the include_deb it probably requires a documentation update, and if you could squash down to one or two commits that would also be helpful (maybe one commit covering hold, and one commit for include_deb?) |
@mhaskel i added 'include_deb' to the readme file. i hope thats enough (i dont think that i should write doku to include src only ... since thats only a corner case for build servers ect) @everybody ...learnings for next time:
|
@@ -203,6 +203,7 @@ Adds an apt source to `/etc/apt/sources.list.d/`. | |||
key_server => 'subkeys.pgp.net', | |||
pin => '-10', | |||
include_src => true | |||
include_deb => true |
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.
There should be a comma on the preceding line.
@wilman0 Other than the typo in the README I think the only other thing we're missing before we'll be able to merge this is a squash. Right now you have 8 commits, but I'd like to see this at one or two commits before merging. Thanks! |
@mhaskel good idea...can you please tell me how to do it? im a sysop not a dev ;) do i have to delete the repo...reapply all the changes manually...than create another merge request? |
@wilman0 |
@mhaskel git rebase -i HEAD~9 |
@wilman0 ok, when you're rebasing you need to edit all the commits except for the first one to have 'squash' instead of 'pick'. There's a useful section on squashing commits at http://git-scm.com/book/en/Git-Tools-Rewriting-History |
fix for default debian installations all files in /etc/apt/preferences without _ will be silently ignore according to debian manpage. Addionally its not a good idea to write versionnumber in filename cause there is no way to delete this files if you increase versionumber Update source_spec.rb add a way to include debsrc only (useful for debian/ubuntu build server ... jenkins ect) Update source_spec.rb var rename Update source.list.erb add include_deb "switch" Update source.pp "include_deb" defaultvalue = true Update hold_spec.rb change the name of the preferences file (hold) Update source_spec.rb Update README.md Doku: 'include_deb' included next to 'include_src' in examples Update README.md typo
@mhaskel thx again !! |
@wilman0 thanks for the contribution! |
Fix for debian/ubuntu hold and a way to add debian src only