Part of lp.archivepublisher.diskpool View In Hierarchy
Creating a DiskPoolEntry performs disk reads, so don't create an instance of this class unless you need to know what's already on the disk for this file.
'tempath' must be in the same filesystem as 'rootpath', it will be used to store the instalation candidate while it is being downloaded from the Librarian.
Remaining files in the 'temppath' indicated installation failures and require manual removal after further investigation.
|Method||pathFor||Return the path for this file in the given component.|
|Method||preferredComponent||Return the appropriate component for the real file.|
|Method||file_hash||Return the SHA1 sum of this file.|
|Method||removeFile||Remove a file from a given component; return bytes freed.|
|Method||_reallyRemove||Remove file and return file size.|
|Method||_shufflesymlinks||Shuffle the symlinks for filename so that targetcomponent contains|
|Method||_sanitiseLinks||Ensure the real file is in the most preferred component.|
If add is passed, add it to the list before calculating. If remove is passed, remove it before calculating. Thus, we can calcuate which component should contain the main file after the addition or removal we are working on.
Remove a file from a given component; return bytes freed.
This method handles three situations:
Remove the file from the filesystem and from our data structures.
If this file is in more than one component, ensure the real file is in the most preferred component and the other components use symlinks.
It's important that the real file be in the most preferred component because partial mirrors may only take a subset of components, and these partial mirrors must not have broken symlinks where they should have working files.