[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#641245: marked as done (apt is unable to parse file /etc/apt/preferences when it has comments.)



Your message dated Tue, 24 Jul 2012 22:17:44 +0200
with message-id <500F02E8.4060802@igalia.com>
and subject line Re: Bug#641245: apt is unable to parse file /etc/apt/preferences when it has comments.
has caused the Debian Bug report #641245,
regarding apt is unable to parse file /etc/apt/preferences when it has comments.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
641245: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=641245
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Version: 0.8.15.6
Severity: normal

Dear Maintainer,
If you have a preferences file where all the lines are commented out apt throws out the following error when trying to do use it.
root@troy-pc:/home/troy# apt-get dist-upgrade
Reading package lists... Done
E: Unable to parse package file /etc/apt/preferences (1)

I think this is pretty bad behavior for apt as sometimes no packages need to be pinned and thus commenting out all the lines for the time being would be desirable.

-- Package-specific info:

-- apt-config dump --

APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "1";
APT::Install-Suggests "0";
APT::Authentication "";
APT::Authentication::TrustCDROM "true";
APT::NeverAutoRemove "";
APT::NeverAutoRemove:: "^firmware-linux.*";
APT::NeverAutoRemove:: "^linux-firmware$";
APT::NeverAutoRemove:: "^linux-image.*";
APT::NeverAutoRemove:: "^kfreebsd-image.*";
APT::NeverAutoRemove:: "^linux-restricted-modules.*";
APT::NeverAutoRemove:: "^linux-ubuntu-modules-.*";
APT::NeverAutoRemove:: "^gnumach$";
APT::NeverAutoRemove:: "^gnumach-image.*";
APT::Never-MarkAuto-Sections "";
APT::Never-MarkAuto-Sections:: "metapackages";
APT::Never-MarkAuto-Sections:: "restricted/metapackages";
APT::Never-MarkAuto-Sections:: "universe/metapackages";
APT::Never-MarkAuto-Sections:: "multiverse/metapackages";
APT::Never-MarkAuto-Sections:: "oldlibs";
APT::Never-MarkAuto-Sections:: "restricted/oldlibs";
APT::Never-MarkAuto-Sections:: "universe/oldlibs";
APT::Never-MarkAuto-Sections:: "multiverse/oldlibs";
APT::Update "";
APT::Update::Post-Invoke-Success "";
APT::Update::Post-Invoke-Success:: "/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null; /bin/echo > /dev/null";
APT::Default-Release "unstable";
APT::Architectures "";
APT::Architectures:: "amd64";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::mirrors "mirrors/";
Dir::State::extended_states "extended_states";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::vendorlist "vendors.list";
Dir::Etc::vendorparts "vendors.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::netrc "auth.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Etc::preferencesparts "preferences.d";
Dir::Etc::trusted "trusted.gpg";
Dir::Etc::trustedparts "trusted.gpg.d";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::dpkg "/usr/bin/dpkg";
Dir::Media "";
Dir::Media::MountPath "/media/cdrom";
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
Dir::Log::History "history.log";
Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Acquire "";
Acquire::cdrom "";
Acquire::cdrom::mount "/media/cdrom";
Acquire::Languages "";
Acquire::Languages:: "en";
Acquire::Languages:: "none";
DPkg "";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/apt-listbugs apt || exit 10";
DPkg::Pre-Install-Pkgs:: "/usr/bin/apt-listchanges --apt || test $? -ne 10";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
DPkg::Tools "";
DPkg::Tools::Options "";
DPkg::Tools::Options::/usr/sbin/apt-listbugs "";
DPkg::Tools::Options::/usr/sbin/apt-listbugs::Version "2";
DPkg::Tools::Options::/usr/bin/apt-listchanges "";
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
DPkg::Post-Invoke "";
DPkg::Post-Invoke:: "/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null; /bin/echo > /dev/null";
CommandLine "";
CommandLine::AsString "apt-config dump";

-- /etc/apt/preferences --

# Packages tracked from experimental
Package: iceweasel icedove
Pin: release a=experimental
Pin-Priority: 991

# Packages held back to testing versions
#Package:
#Pin: release a=testing
#Pin-Priority: 1001

# Packages held back to specific versions
#Package: 
#Pin: version 
#Pin-Priority: 1001

-- /etc/apt/sources.list --

## Debian Stable
#deb http://ftp.us.debian.org/debian/ stable main contrib non-free
#deb-src http://ftp.us.debian.org/debian/ stable main contrib non-free
#deb http://security.debian.org/ stable/updates main contrib non-free
#deb-src http://security.debian.org/ stable/updates main contrib non-free

## Debian Testing
deb http://ftp.us.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.us.debian.org/debian/ testing main contrib non-free
deb http://security.debian.org/ testing/updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free

## Debian Unstable
deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free

## Debian Experimental
deb http://ftp.us.debian.org/debian/ experimental main contrib non-free
deb-src http://ftp.us.debian.org/debian/ experimental main contrib non-free

## Debian Multimedia
#deb http://ftp.debian-multimedia.org/ stable main non-free
#deb http://ftp.debian-multimedia.org/ testing main non-free
#deb http://ftp.debian-multimedia.org/ unstable main non-free

## Debian Mozilla
deb http://mozilla.debian.net/ experimental iceweasel-aurora

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt depends on:
ii  debian-archive-keyring  2010.08.28      
ii  gnupg                   1.4.11-3        
ii  libc6                   2.13-20         
ii  libgcc1                 1:4.6.1-10      
ii  libstdc++6              4.6.1-10        
ii  zlib1g                  1:1.2.3.4.dfsg-3

apt recommends no packages.

Versions of packages apt suggests:
ii  apt-doc     <none> 
ii  aptitude    0.6.4-1
ii  bzip2       1.0.5-7
ii  dpkg-dev    <none> 
ii  lzma        4.43-14
ii  python-apt  0.8.0  

-- no debconf information



--- End Message ---
--- Begin Message ---
On 24/07/12 22:10, David Prévot wrote:
> Hi,
> 
> Le 23/07/2012 20:18, Carlos Alberto Lopez Perez a écrit :
>> retitle 641245 apt is unable to parse file /etc/apt/preferences when it has comments.
> 
> - From apt_preferences(5):
> 
>    Optional Lines in an APT Preferences Record
>        Each record in the APT preferences file can optionally begin
>        with one or more lines beginning with the word Explanation:.
>        This provides a place for comments.
> 
>> This bug happens also when the file has any comment at the end.
> 
>> $ cat /etc/apt/preferences
> [...]
>> # just a comment
> 
> The comment fails to actually starts with “Explanation:”.
> 
> Regards
> 
> David
> 
> 

Well... in the 99% of the configuration files of the system the orthodox
way to put comments is to prefix them with the # character.

Why make this different? Its kinda confusing and prone to errors. Even
in the rest of the configuration files of /etc/apt/* all comments are
prefixed with #

Please don't reinvent the wheel, we already have an standardized way to
prefix comments on the system that is with the # character.

Thanks!

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply to: