Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#345057: aptitude does not parse whitespace in /etc/apt/preferences correctly

9 views
Skip to first unread message

Hugo Graumann

unread,
Dec 28, 2005, 1:40:11 PM12/28/05
to
Package: aptitude
Version: 0.2.15.9-2

I am running Debian stable.

When the /etc/apt/preferences file has comments added to it
in certain patterns, the command "aptitude update" can fail.

If the preferences file contains the following contents:
# some comment
#
# Sid
Package: *
Pin: release a=unstable
Pin-priority: 80
Then "aptitude update" works normally and gives the output
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done
Hit http://ftp.debian.org stable/main Packages
Hit http://ftp.debian.org stable/main Release
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done

On the other hand, if the preferences file contains the following contents:
# some comment

# Sid
Package: *
Pin: release a=unstable
Pin-priority: 80
Then "aptitude update" fails and gives the output
Reading Package Lists... Done
E: Invalid record in the preferences file, no Package header

Blank lines in /etc/apt/prefences do not always generate this error,
but the above pattern seems to be the simplest reproducible case
that forces out the problem.

I came across the problem when I was trying to nicely comment
the /etc/apt/preferences file.

The command "apt-get update" works normally for both cases.

As far as I can tell, the bug remains, regardless of the contents
of the /etc/apt/sources.list file.

Salutations,
Hugo Graumann


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Daniel Burrows

unread,
Jan 2, 2006, 1:40:15 PM1/2/06
to
 This is just due to the fact that aptitude loads the preferences file
in "update" and apt-get doesn't. I suppose this could be avoided by not
initializing as many structures in "update".

Daniel

signature.asc
0 new messages