fix build failure on i386-ancient

Standalone: tmp/git-annex.linux/usr/lib/i386-linux-gnu/i686: renameFile: inappropriate type (is a directory)
This commit is contained in:
Joey Hess 2020-08-10 16:49:09 -04:00
parent 4466c1001d
commit ae325018eb
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -74,11 +74,12 @@ consolidateUsrLib top libdirs = go [] libdirs
go c (x:rest) = case filter (\d -> ("/usr" ++ d) == x) libdirs of
(d:_) -> do
fs <- getDirectoryContents (inTop top x)
forM_ fs $ \f ->
forM_ fs $ \f -> do
let src = inTop top (x </> f)
let dst = inTop top (d </> f)
unless (dirCruft f) $
renameFile
(inTop top (x </> f))
(inTop top (d </> f))
unlessM (doesDirectoryExist src) $
renameFile src dst
go c rest
_ -> go (x:c) rest