014e38 Add support for a different lookaside structure

Authored and Committed by pingou 2 years ago
    Add support for a different lookaside structure
    
    There is a will to offer SIGs the possibility to use a similar lookaside
    structure as the one used by CentOS Stream and Fedora which is not tied
    to the name of the archive but to its hash.
    The idea though is to offer the new structure as opt-in and thus keep
    the old structure working.
    We thus need to adjust the get_sources.sh script to support both
    structure.
    This commit makes it so, it allows both exploded-srpm and flat dist-git
    structures to use either the old or new lookaside cache structure. The
    way this is achieved is simply to first call the URL corresponding to
    the old lookaside structure. If that call returns a http code in the 200
    range, then the script stops, otherwise, the script will call the URL
    corresponding to the new lookaside structure.
    
    This commit also makes consistent the different curl calls and add
    --retry 5 on all of them (which does not work for 404 replies, so
    using the new structure will not results in 6 requests to the old one
    before moving on, but just 1).
    
    Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
    
        
file modified
+34 -13