avoid head warnings with recent ghc versions
authorJoey Hess <joeyh@joeyh.name>
Wed, 12 Feb 2025 16:43:03 +0000 (12:43 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 12 Feb 2025 16:43:03 +0000 (12:43 -0400)
Build/LinuxMkLibs.hs

index d5854dd77491db94c395ab6142e734f662603615..c081dd83d552b5863c77192b0e3d91e204c8b9b2 100644 (file)
@@ -49,11 +49,15 @@ mklibs top _installedbins = do
        -- linker shims.
        writeFile (fromOsPath (top </> literalOsPath "libdirs"))
                (unlines (map fromOsPath libdirs'))
-       writeFile (fromOsPath (top </> literalOsPath "gconvdir"))
-               (fromOsPath (parentDir $ Prelude.head gconvlibs))
+       writeFile (fromOsPath (top </> literalOsPath "gconvdir")) $
+               case gconvlibs of
+                       [] -> ""
+                       (p:_) -> fromOsPath (parentDir p)
        
        mapM_ (installLib installFile top) linkers
-       let linker = Prelude.head linkers
+       linker <- case linkers of
+               [] -> error "unable to find linker"
+               (l:_) -> return l
        mapM_ (installLinkerShim top linker) exes
        
        return (any hwcaplibdir libdirs)