Bug#45640: sources.list parsing with '/' for the dist name broken
Package: apt
Version: 0.3.13
i have the following line in my sources.list to handle packages that i
compiled locally (e.g. kernels):
deb file:/usr/local/debs /
After upgrading from apt-0.3.12 to apt-0.3.13, this line causes apt-get
update to fail. A complete transcript follows.
# apt-get update
E: The method driver /usr/lib/apt/methods/Packages.gz could not be found.
E: The method driver /usr/lib/apt/methods/Release could not be found.
Also, other operations (e.g. apt-get source) give the following warning
(incomplete transcript)
W: Couldn't stat source package list 'file:/usr/local/debs/ Packages'
(/var/state/apt/lists/Packages) - stat (2 No such file or directory)
i managed to track the problem to a piece of code in these two functions
in apt-pgk/sourcelist.cc.
string pkgSourceList::Item::PackagesURI() const
string pkgSourceList::Item::ReleaseURI() const
The code in question, identical in the two functions:
if (Dist[Dist.size() - 1] == '/')
{
if (Dist != "/")
Res = URI + Dist;
}
else
Res = URI + "dists/" + Dist + '/' + Section +
"/binary-" + _config->Find("APT::Architecture") + '/';
In particular, you'll notice that if Dist == "/", Res remains as "". Since
there's not even the proper method descriptor (in this case, 'file:') on
the front, apt gets confused and thinks it should use method Packages.gz
or Resources (depending which fuction).
I suggest something like the patch below to fix this problem, although
there could easily be better ways to do it.
--- apt-0.3.13/apt-pkg/sourcelist.cc Thu Sep 9 12:53:40 1999
+++ apt-0.3.13/apt-pkg/sourcelist.cc Mon Sep 20 23:39:34 1999
@@ -172,6 +172,8 @@
{
if (Dist != "/")
Res = URI + Dist;
+ else
+ Res = URI;
}
else
Res = URI + "dists/" + Dist + '/' + Section +
@@ -240,6 +242,8 @@
{
if (Dist != "/")
Res = URI + Dist;
+ else
+ Res = URI;
}
else
Res = URI + "dists/" + Dist + '/' + Section +
i am using Debian potato with a custom-compiled kernel version 2.2.12. All
packages Depended and Suggested are the latest potato versions from
http.us.debian.org as of the time of this email.
Reply to: