fix build failure on i386-ancient
authorJoey Hess <joeyh@joeyh.name>
Mon, 10 Aug 2020 20:49:09 +0000 (16:49 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 10 Aug 2020 20:49:09 +0000 (16:49 -0400)
Standalone: tmp/git-annex.linux/usr/lib/i386-linux-gnu/i686: renameFile: inappropriate type (is a directory)

Build/LinuxMkLibs.hs

index 7bb5c1de4bd3fa1c436779cccbf8c123d81e4051..60af30f1a4aacc42525e34856817b40434769d69 100644 (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