mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-23 12:41:58 +01:00
etc/diskspace: testing + tweaks
[skip ci]
This commit is contained in:
parent
fe12dba59c
commit
2d9b1e1726
@ -33,6 +33,7 @@ cleanStackWorkInstall =
|
|||||||
$ withOneDirectory_ -- hash
|
$ withOneDirectory_ -- hash
|
||||||
$ withOneDirectory $ \ghcver ->
|
$ withOneDirectory $ \ghcver ->
|
||||||
withCurrentDirectory ("lib" </> "x86_64-linux-ghc-" ++ ghcver) $ do
|
withCurrentDirectory ("lib" </> "x86_64-linux-ghc-" ++ ghcver) $ do
|
||||||
|
getCurrentDirectory >>= putStrLn
|
||||||
files <- sort <$> listDirectory "."
|
files <- sort <$> listDirectory "."
|
||||||
let (dynlibs,libdirs) = partition (".so" `isExtensionOf`) files
|
let (dynlibs,libdirs) = partition (".so" `isExtensionOf`) files
|
||||||
pkglibdirs = groupBy samePkgLibDir libdirs
|
pkglibdirs = groupBy samePkgLibDir libdirs
|
||||||
@ -64,7 +65,7 @@ cleanStackWorkInstall =
|
|||||||
|
|
||||||
removeOlder remover files = do
|
removeOlder remover files = do
|
||||||
oldfiles <- drop keepBuilds . reverse <$> sortByAge files
|
oldfiles <- drop keepBuilds . reverse <$> sortByAge files
|
||||||
mapM_ remover oldfiles
|
mapM_ putStrLn oldfiles
|
||||||
where
|
where
|
||||||
sortByAge files = do
|
sortByAge files = do
|
||||||
timestamps <- mapM getModificationTime files
|
timestamps <- mapM getModificationTime files
|
||||||
@ -80,12 +81,13 @@ cleanStackWorkPackages =
|
|||||||
withCurrentDirectory "unpacked" $ do
|
withCurrentDirectory "unpacked" $ do
|
||||||
pkgs <- listDirectory "."
|
pkgs <- listDirectory "."
|
||||||
forM_ pkgs $ \pkg -> do
|
forM_ pkgs $ \pkg -> do
|
||||||
withCurrentDirectory ".stack-work/dist/x86_64-linux-tinfo6"
|
withCurrentDirectory $ pkg </> ".stack-work/dist/x86_64-linux-tinfo6"
|
||||||
$ withOneDirectory_ -- "Cabal-3.8.1.0"
|
$ withOneDirectory_ -- "Cabal-3.8.1.0"
|
||||||
$ withCurrentDirectory "build" $ do
|
$ withCurrentDirectory "build" $ do
|
||||||
ls <- sort <$> listDirectory "."
|
ls <- sort <$> listDirectory "."
|
||||||
files <- filterM doesFileExist ls
|
files <- filterM doesFileExist ls
|
||||||
let (dynlibs,statlibs) = partition (".so" `isExtensionOf`) files
|
let (dynlibs,others) = partition (".so" `isExtensionOf`) files
|
||||||
|
statlibs = filter (".a" `isExtensionOf`) others
|
||||||
removeOlder removeFile dynlibs
|
removeOlder removeFile dynlibs
|
||||||
removeOlder removeFile statlibs
|
removeOlder removeFile statlibs
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user