Eliminate the substituter mechanism
Substitution is now simply a Store -> Store copy operation, most typically from BinaryCacheStore to LocalStore.
This commit is contained in:
		
							parent
							
								
									21e9d183cc
								
							
						
					
					
						commit
						aa3bc3d5dc
					
				
					 16 changed files with 166 additions and 597 deletions
				
			
		| 
						 | 
				
			
			@ -501,4 +501,39 @@ static RegisterStoreImplementation regStore([](const std::string & uri) -> std::
 | 
			
		|||
});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
std::list<ref<Store>> getDefaultSubstituters()
 | 
			
		||||
{
 | 
			
		||||
    struct State {
 | 
			
		||||
        bool done = false;
 | 
			
		||||
        std::list<ref<Store>> stores;
 | 
			
		||||
    };
 | 
			
		||||
    static Sync<State> state_;
 | 
			
		||||
 | 
			
		||||
    auto state(state_.lock());
 | 
			
		||||
 | 
			
		||||
    if (state->done) return state->stores;
 | 
			
		||||
 | 
			
		||||
    StringSet done;
 | 
			
		||||
 | 
			
		||||
    auto addStore = [&](const std::string & uri) {
 | 
			
		||||
        if (done.count(uri)) return;
 | 
			
		||||
        done.insert(uri);
 | 
			
		||||
        state->stores.push_back(openStoreAt(uri));
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    for (auto uri : settings.get("substituters", Strings()))
 | 
			
		||||
        addStore(uri);
 | 
			
		||||
 | 
			
		||||
    for (auto uri : settings.get("binary-caches", Strings()))
 | 
			
		||||
        addStore(uri);
 | 
			
		||||
 | 
			
		||||
    for (auto uri : settings.get("extra-binary-caches", Strings()))
 | 
			
		||||
        addStore(uri);
 | 
			
		||||
 | 
			
		||||
    state->done = true;
 | 
			
		||||
 | 
			
		||||
    return state->stores;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue