diff --git a/CURATORS.md b/CURATORS.md index b1f8c826..84f5361d 100644 --- a/CURATORS.md +++ b/CURATORS.md @@ -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. * 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: * `rm -r /var/stackage/stackage/automated/work/[nightly|lts-XX]/unpack-dir/unpacked/*/.stack-work/dist/x86_64-linux/Cabal-X.Y.0.0/` diff --git a/etc/diskspace/remove-old-stack-work-libs.hs b/etc/diskspace/remove-old-stack-work-libs.hs index 3d03bacb..bc7fa2d8 100755 --- a/etc/diskspace/remove-old-stack-work-libs.hs +++ b/etc/diskspace/remove-old-stack-work-libs.hs @@ -22,8 +22,9 @@ main = do home <- getHomeDirectory withCurrentDirectory (home "stackage/automated/work" stream "unpack-dir") $ do cleanStackWorkInstall + putStrLn "" 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-* cleanStackWorkInstall :: IO () @@ -65,7 +66,7 @@ cleanStackWorkInstall = removeOlder remover files = do oldfiles <- drop keepBuilds . reverse <$> sortByAge files - mapM_ putStrLn oldfiles + mapM_ remover oldfiles where sortByAge files = do timestamps <- mapM getModificationTime files @@ -79,6 +80,7 @@ removeOlder remover files = do cleanStackWorkPackages :: IO () cleanStackWorkPackages = withCurrentDirectory "unpacked" $ do + getCurrentDirectory >>= putStrLn pkgs <- listDirectory "." forM_ pkgs $ \pkg -> do withCurrentDirectory $ pkg ".stack-work/dist/x86_64-linux-tinfo6"