From ae325018eb1da51f6450a2112e45ee3cf16218f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Aug 2020 16:49:09 -0400 Subject: [PATCH] fix build failure on i386-ancient Standalone: tmp/git-annex.linux/usr/lib/i386-linux-gnu/i686: renameFile: inappropriate type (is a directory) --- Build/LinuxMkLibs.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Build/LinuxMkLibs.hs b/Build/LinuxMkLibs.hs index 7bb5c1de4b..60af30f1a4 100644 --- a/Build/LinuxMkLibs.hs +++ b/Build/LinuxMkLibs.hs @@ -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