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

Bug#227805: /usr/bin/apt-cache: using a command-line specified sources.list (apt-cache -o, -p oddities)

Package: apt
Version: 0.5.14
Severity: normal
File: /usr/bin/apt-cache

I was trying to query a different sourcelist for a particular package
without changing my /etc/apt/sources.list.  So I seem to have ventured
into unchartered terretory.

I did the following.

1. Created a file in /test/my_source, in it I had

deb ftp://ftp.nerim.net/debian-marillat/ testing main non-free contrib

The actual URI is immaterial - you can replace 'ftp.nerim.net/debian-marillat'
with say 'archive.progeny.com/debian' or whatever (same problem).

2. I then try to do a search on this new source list file via (as both
   normal user and 'root'),

apt-cache -o=Dir::Etc::SourceList=/test/my_source -p /tmp/my_db search moo

and I get some odd errors about,

W: Couldn't stat source package list ftp://ftp.nerim.net
testing/main Packages
- stat (2 No such file or directory)

which leads me to question why is it going to /var/lib/apt/lists (I did
use the -p option which ought to be have it be reside somewhere else, no?).
If I use something that is listed in /var/lib/apt/lists/, I get the following
error if I run as non-root,

E: Could not open file /var/cache/apt/srcpkgcache.bin - open
(13 Permission denied)

The fundemental problem I have with all of this, is that one is unable
to query outside what is listed in /etc/apt/sources.list and it seems
to me some of the hooks are there to get that done (or maybe I'm
misunderstanding things).  It seems that in order to do a search a
cache file must be generted and to generate a cache file one has to
do a 'apt-get update' and with the above I would screw my system
over, so isn't there a way to search a different source list without
completely changing my system.  If not, why are all those options
availble on the command-line on 'apt-cache' and 'apt-get' (namely
"pkg-cache", "Dir::Etc::SourceList", etc) ?

In passing, apt-cache's (and apt-get's) manpages about the '-o'
syntax option is VERY confusing.  I believe it needs to be
'-o=CONF_VAR=value' and not '-o CONF_VAR=value' or '-o=CONF value'
as is noted in the man page (it would be best if '-o CONF=value'
was made to work).  In the manpages there is also no mention of
using multiple '-o' options.  So is '-o=CONF_VAR1=value1
-o=CONF_VAR2=value2' (ie. two -o on the same command-line) legal ?
It would be nice if the manpage noted something with this regard.


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux sina 2.4.22 #2 Thu Sep 18 20:47:45 PDT 2003 i686

Versions of packages apt depends on:
ii  libc6                       2.3.2.ds1-10 GNU C Library: Shared libraries an
ii  libgcc1                     1:3.3.2-4    GCC support library
ii  libstdc++5                  1:3.3.2-4    The GNU Standard C++ Library v3

-- no debconf information

Reply to: