[debpool] Refactoring the main loop

Magnus Holmgren holmgren at lysator.liu.se
Wed Apr 11 17:49:08 UTC 2007


I have identified four or five sections of the foreach $changefile loop that 
can be broken out into one subroutine each to make the code more 
understandable:

1. Check_Files(): Parse the .changes file; check that all the files it lists 
are there and have the correct MD5 checksum; check that the list of files is 
consistent with the Source, Binary, and Architecture fields, and that there 
are no unrecognized files. Parse the .dsc file if source is uploaded; check 
that all files listed have the same properties as in the .changes file and/or 
(for a .orig.tar.gz) as the existing file in the archive, that the file names 
are consistent with the Version field and Source fields, and that there are 
no unrecognized files. While we're at it, why not perform similar checks on 
the debs too? Hmm, if we're going to perform such extensive checking I guess 
it could be broken down further.

2. Check_Versions() (skipped when --rollback is used): Check that all files 
are newer than the ones in the target distribution, and that they pass 
additional checks as discussed in the other thread.

3. Do_Install(): Install the packages in the archive and remove versions that 
are no longer referenced (maybe this doesn't have to be a separate sub).

4-5. Do_Generate_Dist_Info(): Rebuild the Packages, Sources, and Release files 
as well as the optional compressed versions and gpg signatures. I'm thinking 
that this should be done in two steps per dist: first all files are generated 
and their names and destinations are put in a list; then all files are 
installed in the archive. This should minimize the chance that the archive 
ends up in an inconsistent state. Actually, it's better if old packages are 
cleaned out last instead of in step 3.

Please comment!

-- 
Magnus Holmgren        holmgren at lysator.liu.se
                       (No Cc of list mail needed, thanks)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/debpool-devel/attachments/20070411/cde91dae/attachment.pgp


More information about the Debpool-devel mailing list