mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-11-26 11:42:14 +03:00
nar: throw error if there are collisions during unpacking
This commit is contained in:
parent
d35aa18e34
commit
67ea0d05b6
@ -99,7 +99,10 @@ streamNarIOWithOptions opts effs basePath yield = do
|
||||
if Nar.optUseCaseHack opts
|
||||
then undoCaseHack f
|
||||
else f
|
||||
in Map.insert name f acc
|
||||
in
|
||||
case Map.insertLookupWithKey (\_ n _ -> n) name f acc of
|
||||
(Nothing, newMap) -> newMap
|
||||
(Just conflict, _) -> error $ "File name collision between " ++ (path </> name) ++ " and " ++ (path </> conflict)
|
||||
) Map.empty fs
|
||||
yield $ strs ["type", "directory"]
|
||||
forM_ (Map.toAscList entries) $ \(unhacked, original) -> do
|
||||
|
Loading…
Reference in New Issue
Block a user