From: Chris H. <ha...@de...> - 2005-06-09 10:34:57
|
Hi Bill, sorry for the long delay On Friday 20 May 2005 15:05, Bill Moseley wrote: > Another feature I would love is to be able to query apt-proxy and 1) > show when a package was installed (and what packages were installed > because of it) and 1) be able just see (and sort) by package > installation date ("what were those three CMS packages I was testing > out last week?"). With apt-proxy using twisted, it should be too difficult to generate extra web pages, although the access to the databases needs to be cleaned up first - there isn't any well documented set of access functions. > Ah, thanks. Ok, trying.... No, still not working. I agree, it's still not working :( It seems my existing install started working after the fixes but when I tried on a completely new cache directory, it didn't work either. > How does the import work? Does it look at the file name, then try to > find that file in Packages.gz (or related .db) and look up its path? I'll try and explain the complete flow, starting from an empty cache: 1. A client requests a Packages[.gz] file for a given backend [in apt-proxy daemon:] 2. The Packages file is downloaded 3. If it was Packages.gz, the file is uncompressed using gzip in the background. This was the step I broke :) 4. The uncompressed Packages file is registered in the database found at /var/cache/apt-proxy/.apt-proxy/backends/<backend name>/packages.db [in apt-proxy-import:] 5. apt-proxy-import is started 6. for each .deb, a-p-i extracts the package name 7. for each backend, a-p-i extracts a list of Packages files from the database 8. the contents of each Packages file is read using python-apt 9. a-p-i looks in the python-apt cache for the package name 10. if the exact version is found in a Packages file, it copies the file there 11. otherwise if a package with the same name but a different version is found, it will copy the file to the same path as the other version. So, going back to your original question, it looks at the package name embedded in the .deb, and tries to find that path in the Packages.gz. I have added a command line option to specify the configuration file, to make it easier to start a new a-p with an empty cache listening on a different port, but it needs some cleaning up before it is released. In my debugging I have established that step 8 is failing for some reason: The python-apt cache ends up being empty. I'm not sure yet why this is happening. Chris |