mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-11 23:08:30 +01:00
etc/diskspace: enable removals
[skip ci]
This commit is contained in:
parent
2d9b1e1726
commit
7369901a8c
@ -354,7 +354,7 @@ resolve any issues before the next curator shift the coming monday.
|
|||||||
|
|
||||||
* You can detect the problem by running `df`. If you see that `/` is out of space, we have a problem.
|
* You can detect the problem by running `df`. If you see that `/` is out of space, we have a problem.
|
||||||
* If you see that `/var/stackage/` is out of space, you can:
|
* If you see that `/var/stackage/` is out of space, you can:
|
||||||
* run `./etc/diskspace/clean-old-stack-libs.sh [nightly|lts-XX]`
|
* run `./etc/diskspace/clean-old-stack-libs.hs [nightly|lts-XX]`
|
||||||
* If that is insufficient then remove all the old builds under the previous ghc/Cabal version:
|
* If that is insufficient then remove all the old builds under the previous ghc/Cabal version:
|
||||||
* `rm -r /var/stackage/stackage/automated/work/[nightly|lts-XX]/unpack-dir/unpacked/*/.stack-work/dist/x86_64-linux/Cabal-X.Y.0.0/`
|
* `rm -r /var/stackage/stackage/automated/work/[nightly|lts-XX]/unpack-dir/unpacked/*/.stack-work/dist/x86_64-linux/Cabal-X.Y.0.0/`
|
||||||
|
|
||||||
|
|||||||
@ -22,8 +22,9 @@ main = do
|
|||||||
home <- getHomeDirectory
|
home <- getHomeDirectory
|
||||||
withCurrentDirectory (home </> "stackage/automated/work" </> stream </> "unpack-dir") $ do
|
withCurrentDirectory (home </> "stackage/automated/work" </> stream </> "unpack-dir") $ do
|
||||||
cleanStackWorkInstall
|
cleanStackWorkInstall
|
||||||
|
putStrLn ""
|
||||||
cleanStackWorkPackages
|
cleanStackWorkPackages
|
||||||
_ -> error "arg should be 'lts' or 'nightly'"
|
_ -> error "arg should be 'lts-XX' or 'nightly'"
|
||||||
|
|
||||||
-- navigates to: .stack-work/install/x86_64-linux*/*/*/lib/x86_64-linux-ghc-*
|
-- navigates to: .stack-work/install/x86_64-linux*/*/*/lib/x86_64-linux-ghc-*
|
||||||
cleanStackWorkInstall :: IO ()
|
cleanStackWorkInstall :: IO ()
|
||||||
@ -65,7 +66,7 @@ cleanStackWorkInstall =
|
|||||||
|
|
||||||
removeOlder remover files = do
|
removeOlder remover files = do
|
||||||
oldfiles <- drop keepBuilds . reverse <$> sortByAge files
|
oldfiles <- drop keepBuilds . reverse <$> sortByAge files
|
||||||
mapM_ putStrLn oldfiles
|
mapM_ remover oldfiles
|
||||||
where
|
where
|
||||||
sortByAge files = do
|
sortByAge files = do
|
||||||
timestamps <- mapM getModificationTime files
|
timestamps <- mapM getModificationTime files
|
||||||
@ -79,6 +80,7 @@ removeOlder remover files = do
|
|||||||
cleanStackWorkPackages :: IO ()
|
cleanStackWorkPackages :: IO ()
|
||||||
cleanStackWorkPackages =
|
cleanStackWorkPackages =
|
||||||
withCurrentDirectory "unpacked" $ do
|
withCurrentDirectory "unpacked" $ do
|
||||||
|
getCurrentDirectory >>= putStrLn
|
||||||
pkgs <- listDirectory "."
|
pkgs <- listDirectory "."
|
||||||
forM_ pkgs $ \pkg -> do
|
forM_ pkgs $ \pkg -> do
|
||||||
withCurrentDirectory $ pkg </> ".stack-work/dist/x86_64-linux-tinfo6"
|
withCurrentDirectory $ pkg </> ".stack-work/dist/x86_64-linux-tinfo6"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user