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

New acquire code.



Okay, I think the new acqurie code is pretty much stable, as before it is
in the 'apt' cvs tree. It works to the point that Adam can start
converting the ftp method at his leasure. 

To test it check it out and compile it up as usual except do a make -C
test/ as well to include my current test program. You'll want to create a
striped down sources.list and put something like this in
/etc/apt/apt.conf:

Dir {
  State "/tmp/lists/";
  Cache "/tmp/";
  Etc::sourcelist "sources.list.test";
  Bin::methods "/home/jgg/work/apt/build/bin/methods/";
};

Debug {
  pkgAcquire "true";
  pkgAcquire::Worker "true";
};  

Stick this in /etc/apt/sources.list.test
deb file:/ tmp/ 

Be sure to create /tmp/lists/partial, also write empty files to
/tmp/Packages /tmp/Release

When 'scratch-test' is run it will do the same sequence of events as
apt-get update minus the fancyness [it's only 10 lines!]. Currently file
URIs are completely working so you should end up with
/tmp/lists/{tmp_Packages,tmp_Release} if all goes well. It will also print
out the entire method<->APT chat that occures [if you set the debug flags]

The sequence of events is much like described in the doc/method.sgml file
[there are some updates but they might be there by the time anyone reads
this..] However it is worth nothing that there is the internal concept of
a 'copy' and a 'gzip' URI. In the example situation above the following
URI's would be fetched,

file:/tmp/Packages.gz -> /tmp/lists/partial/tmp_Packages
file:/tmp/Release -> /tmp/lists/partial/tmp_Release
copy:/tmp/Packages -> /tmp/lists/partial/tmp_Packages.decomp
copy:/tmp/Release -> tmp/lists/partial/tmp_Release

If the ungziped version did not exist then instead of copy: there would be
a:

gzip:/tmp/Packages.gz -> /tmp/lists/partial/tmp_Packages.decomp

The use of copy and gzip URI's allows the parrallization of time consuming
IO operations within the context of the acquire framework. The old version
of APT did this too but it was a very big special case :>

A http update would go something like:

http://..../binary-i386/Packages.gz -> /tmp/lists/partial/tmp_Packages
gzip:/tmp/lists/partial/tmp_Packages -> /tmp/lists/partial/tmp_Packages.decomp

After all the fetches for a specific object have completed the object is
then renamed to it's final position in .. 

methods/file.cc provides an example implementation of the method interface
code and methods/gzip.cc shows how to deal with configuration items. 

The progression of the forked branch is going well, this code is the final
major peice preventing the re-activation of a functional apt-get.. If
Bradon wasn't so busy with X I'd say this would be a good time to update
the documentation and to perpare the debian/ directory.

Jason


Reply to: