Here is an alternate patch, using _error->Notice instead of
_error->Warning. Using Notice leaves _error->empty false and hence the
apt-get update warning is not printed. For comparison. here the output
of the two patches:

apt-unreadable_sources.patch:

$ apt-cache policy apache2
apache2:
  Installed: (none)
  Candidate: 2.2.22-1ubuntu1
  Version table:
     2.2.22-1ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main i386 Packages
     2.2.14-5ubuntu8 0
        500 http://archive.ubuntu.com/ubuntu/ lucid/main i386 Packages
W: Can not read /etc/apt/sources.list.d/a.list, ignore the apt-get update 
warning below
W: You may want to run apt-get update to correct these problems

apt-unreadable_sources_notice.patch:

$  apt-cache policy apache2
apache2:
  Installed: (none)
  Candidate: 2.2.22-1ubuntu1
  Version table:
     2.2.22-1ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main i386 Packages
     2.2.14-5ubuntu8 0
        500 http://archive.ubuntu.com/ubuntu/ lucid/main i386 Packages
N: Can not read /etc/apt/sources.list.d/a.list.


** Patch added: "apt-unreadable_sources_notice.patch"
   
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/849736/+attachment/2796485/+files/apt-unreadable_sources_notice.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/849736

Title:
  apt-cache policy silently shows inaccurate information when any file
  in /etc/apt/sources.list.d is unreadable

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/849736/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to