apt.conf man page should indicate # is also used for comments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
According to apt.conf(5) man page, the only valid comments in apt config files are:
"Lines starting with // are treated as comments (ignored), as well as all text between /* and */, just like C/C++ comments."
There are comments in debian/
1)
Description: Ubuntu 14.04 LTS
Release: 14.04
2) apt:
Installed: 1.0.1ubuntu2
Candidate: 1.0.1ubuntu2
Version table:
*** 1.0.1ubuntu2 0
500 http://
100 /var/lib/
The file can be patched by running:
$ sed -i "s/#/\/\//" apt.conf.autoremove
Changed in apt (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Medium |
summary: |
- Invalid comments in debian/apt.conf.autoremove + apt.conf man page should indicate # is also used for comments |
As I implemented this years ago I am obviously biased, but I think not supporting "#" as a comment is a mistake as sources.list and preferences support it and most other config files you come across do comments with '#'. The autokernelremove code was an "external" contribution and it just shows that the default assumption is in fact '#'.
(all apt config files I have on my systems include #-comments btw, and I doubt I am the only one)
We should just document this fact properly instead of reverting support for it…
I wonder more why augeas is parsing our config file (but then again, I have no idea what augeas is). We have the apt-config tool to extract settings as well as python-apt, libapt-perl and libapt proper. Doing it on your own leads to a disaster sooner or later…
(just compare it with sources.list parsers… a simple codesearch reveals that most of them are fundamentally broken even in perfectly documented cases; but in most cases I have no idea why they they try to parse it in the first place…)