mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-11 23:08:30 +01:00
etc/diskspace: fixup pkg platform build dir paths
[skip ci]
This commit is contained in:
parent
3bd98e48e8
commit
bf7ce0e101
@ -92,13 +92,15 @@ cleanStackWorkPackages =
|
|||||||
platforms <- listDirectory "." -- "x86_64-linux-tinfo6*"
|
platforms <- listDirectory "." -- "x86_64-linux-tinfo6*"
|
||||||
forM platforms $ \pl ->
|
forM platforms $ \pl ->
|
||||||
withCurrentDirectory pl $
|
withCurrentDirectory pl $
|
||||||
withOneDirectory_ -- "Cabal-*"
|
withOneDirectory -- "Cabal-*"
|
||||||
$ withCurrentDirectory "build" $ do
|
$ \cbl ->
|
||||||
|
withCurrentDirectory "build" $ do
|
||||||
ls <- sort <$> listDirectory "."
|
ls <- sort <$> listDirectory "."
|
||||||
files <- filterM doesFileExist ls
|
files <- filterM doesFileExist ls
|
||||||
let (dynlibs,others) = partition (".so" `isExtensionOf`) files
|
let (dynlibs,others) = partition (".so" `isExtensionOf`) files
|
||||||
statlibs = filter (".a" `isExtensionOf`) others
|
statlibs = filter (".a" `isExtensionOf`) others
|
||||||
return (dynlibs,statlibs)
|
let dir = pl </> cbl </> "build"
|
||||||
|
return (map (dir </>) dynlibs, map (dir </>) statlibs)
|
||||||
removeOlder removeFile $ concatMap fst libs
|
removeOlder removeFile $ concatMap fst libs
|
||||||
removeOlder removeFile $ concatMap snd libs
|
removeOlder removeFile $ concatMap snd libs
|
||||||
|
|
||||||
@ -111,7 +113,7 @@ withOneDirectory_ act = do
|
|||||||
cwd <- getCurrentDirectory
|
cwd <- getCurrentDirectory
|
||||||
error $ "more than one directory found in " ++ cwd ++ ": " ++ unwords ls
|
error $ "more than one directory found in " ++ cwd ++ ": " ++ unwords ls
|
||||||
|
|
||||||
withOneDirectory :: (FilePath -> IO ()) -> IO ()
|
withOneDirectory :: (FilePath -> IO a) -> IO a
|
||||||
withOneDirectory act = do
|
withOneDirectory act = do
|
||||||
ls <- listDirectory "."
|
ls <- listDirectory "."
|
||||||
case ls of
|
case ls of
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user