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

Manage /etc/apt/preferences in the same way as /etc/sources.list #199

Closed
wmarler opened this issue Dec 20, 2013 · 5 comments
Closed

Manage /etc/apt/preferences in the same way as /etc/sources.list #199

wmarler opened this issue Dec 20, 2013 · 5 comments

Comments

@wmarler
Copy link

wmarler commented Dec 20, 2013

Debian apt-get will look in both /etc/apt/preferences as well as files in /etc/apt/preferences.d for pinning information. This module will purge /etc/apt/sources.list, but will not touch /etc/apt/preferences.

I have code to address this issue, though there is an underlying issue with 'apt-get upgrade' that requires a valid entry in /etc/apt/preferences to function. An empty file, or a file with a single comment, will throw an error (see Debian bug 641245). It makes the Puppet solution look a little sloppy.

@daenney
Copy link

daenney commented Feb 21, 2014

If you read through the 641245 you'll notice that it's not a bug, it's defined behaviour in Apt.

If you want to add a comment to Apt you simply start a line with Explanation: the rest of the comment.

Therefor you can do something like this:

file { '/etc/apt/preferences':
  ensure => file,
  content => 'Explanation: preferences are being managed by Puppet in preferences.d',
}

If you have a pull request to fix this I'd be more than willing to review it and help out with the tests.

@wmarler
Copy link
Author

wmarler commented Feb 21, 2014

Wrong. If you had bothered to test you would have seen that this commenting
style does not work. See
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732746 .

On Fri, Feb 21, 2014 at 11:56 AM, Daniele Sluijters <
notifications@github.com> wrote:

If you read through the 641245https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=641245you'll notice that it's not a bug, it's defined behaviour in Apt.

If you want to add a comment to Apt you simply start a line with Explanation:
the rest of the comment.


Reply to this email directly or view it on GitHubhttps://github.com//issues/199#issuecomment-35761167
.

@daenney
Copy link

daenney commented Feb 21, 2014

Wrong.

You pointed us to bug 641245 which has nothing to do with empty files or the Explanation tag not working, it has to do with a faulty comment style which led me to assume you tried the # style of comments.

If you had bothered to test

I did test. However my testing machines are Debian Unstable / Sid and the issue has already been solved there.

I'm just another community member trying to help people get their fixes in. I do this in my free time to try and help others out, no need to be rude.

As I said before, if you have code to fix this I'm more than happy to look it over and see if I can get it merged in.

@wmarler
Copy link
Author

wmarler commented Feb 22, 2014

I am sorry that I was snarky and said "if you'd bothered to test" -- I do
not use Jesse or Sid (I'm working with production machines), and it didn't
occur to me that you would. I'm glad to hear the fix makes my bug report
seem non-reproducible, and I appreciate you donating your time.

I am sorry to say I don't have a fix to contribute anymore : (.

Please note that in Squeeze and Wheezy (at least as of today) the apt
version is still too old, and having either an empty preferences file, one
with #-style comments, or one with a single "Explanation: ..." style
comment will not work. Using a single "Explanation: ..." style comment will
work, as long as it's followed with "Package: " line. The
"" does not have to be a valid package.

On Fri, Feb 21, 2014 at 4:46 PM, Daniele Sluijters <notifications@github.com

wrote:

Wrong.

You pointed us to bug 641245 which has nothing to do with empty files, it
has to do with a faulty comment style which led me to assume you tried the

style of comments.

If you had bothered to test

I did test. However my testing machines are Debian Unstable / Sid and the
issue has already been solved there.

I'm just another community member trying to help people get their fixes
in. I do this in my free time to try and help others out, no need to be
rude.

As I said before, if you have code to fix this I'm more than happy to look
it over and see if I can get it merged in.


Reply to this email directly or view it on GitHubhttps://github.com//issues/199#issuecomment-35785724
.

@daenney
Copy link

daenney commented Feb 22, 2014

@wmarler I just pushed PR #240 . Could you test it and see if it works for you?

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

No branches or pull requests

2 participants