1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-29 06:23:17 +03:00

Fixed bug in stackage update

This commit is contained in:
Boris M. Yartsev 2017-06-24 15:43:44 +03:00
parent b485a64f03
commit 6a3315faa7
5 changed files with 72933 additions and 6 deletions

View File

@ -18,6 +18,9 @@ import Network.HTTP.Client(Request(..), parseUrlThrow, newManager, responseBody,
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Network.HTTP.Types.Header
import qualified Control.Exception as X
import System.Posix.Files(touchFile)
import System.Directory(doesFileExist)
import Control.Monad(unless)
import Common
@ -78,7 +81,6 @@ write2File archive url range = do
BL.appendFile archive body
putStrLn "Append ok"
writeAll2File :: FilePath -> URL -> IO()
writeAll2File archive url = do
putStrLn $ "\tGetting body from " ++ url

View File

@ -83,9 +83,9 @@ buildCommand ui = processCommand
-- shows diff map between tar and tar.orig archives
| chk "system-tarcmp" = HC.showDiffMap trFile trFileC
| chk "ltsupdate" = let lts = parseValEnd command in
SC.updateLTSFile (getLTSGithubURL (sui ui) lts) (getLTSFile (sui ui) lts)
SC.updateLTSFile (getLTSFile (sui ui) lts) (getLTSGithubURL (sui ui) lts)
| chk "urlsize" = HD.calculateContentSize (parseValEnd command) >>= print
-- | chk "urlsize" = HD.calculateContentSize (parseValEnd command) >>= print
| otherwise = showHelp ui
where pc = map DC.toLower command
@ -123,9 +123,7 @@ showHelp ui = do
putStrLn $ "cmppersist - compares the state of " ++ trFile ++ " with map from persistent storage"
putStrLn $ "tarpersist - updates the persistent storage with " ++ trFile
putStrLn "querypersist name - queries the persistent storage with package"
putStrLn $ "snapshots - show the stackage snapshots from " ++ snapshotsURL
putStrLn "exit - exits this repl"
putStrLn "help - shows this help"

View File

View File

@ -40,5 +40,5 @@ fetchLTS file url = do
putStrLn $ "Getting LTS " ++ url ++ " to " ++ file
removeIfExists file
createDirectoryIfMissing True (takeDirectory file)
writeAll2File url file
writeAll2File file url

File diff suppressed because it is too large Load Diff