mirror of
https://github.com/aelve/guide.git
synced 2024-11-25 18:56:52 +03:00
Fixed bug in stackage update
This commit is contained in:
parent
b485a64f03
commit
6a3315faa7
@ -18,6 +18,9 @@ import Network.HTTP.Client(Request(..), parseUrlThrow, newManager, responseBody,
|
|||||||
import Network.HTTP.Client.TLS (tlsManagerSettings)
|
import Network.HTTP.Client.TLS (tlsManagerSettings)
|
||||||
import Network.HTTP.Types.Header
|
import Network.HTTP.Types.Header
|
||||||
import qualified Control.Exception as X
|
import qualified Control.Exception as X
|
||||||
|
import System.Posix.Files(touchFile)
|
||||||
|
import System.Directory(doesFileExist)
|
||||||
|
import Control.Monad(unless)
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
|
|
||||||
@ -78,7 +81,6 @@ write2File archive url range = do
|
|||||||
BL.appendFile archive body
|
BL.appendFile archive body
|
||||||
putStrLn "Append ok"
|
putStrLn "Append ok"
|
||||||
|
|
||||||
|
|
||||||
writeAll2File :: FilePath -> URL -> IO()
|
writeAll2File :: FilePath -> URL -> IO()
|
||||||
writeAll2File archive url = do
|
writeAll2File archive url = do
|
||||||
putStrLn $ "\tGetting body from " ++ url
|
putStrLn $ "\tGetting body from " ++ url
|
||||||
|
@ -83,9 +83,9 @@ buildCommand ui = processCommand
|
|||||||
-- shows diff map between tar and tar.orig archives
|
-- shows diff map between tar and tar.orig archives
|
||||||
| chk "system-tarcmp" = HC.showDiffMap trFile trFileC
|
| chk "system-tarcmp" = HC.showDiffMap trFile trFileC
|
||||||
| chk "ltsupdate" = let lts = parseValEnd command in
|
| 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
|
| otherwise = showHelp ui
|
||||||
|
|
||||||
where pc = map DC.toLower command
|
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 $ "cmppersist - compares the state of " ++ trFile ++ " with map from persistent storage"
|
||||||
putStrLn $ "tarpersist - updates the persistent storage with " ++ trFile
|
putStrLn $ "tarpersist - updates the persistent storage with " ++ trFile
|
||||||
putStrLn "querypersist name - queries the persistent storage with package"
|
putStrLn "querypersist name - queries the persistent storage with package"
|
||||||
|
|
||||||
putStrLn $ "snapshots - show the stackage snapshots from " ++ snapshotsURL
|
putStrLn $ "snapshots - show the stackage snapshots from " ++ snapshotsURL
|
||||||
|
|
||||||
putStrLn "exit - exits this repl"
|
putStrLn "exit - exits this repl"
|
||||||
putStrLn "help - shows this help"
|
putStrLn "help - shows this help"
|
||||||
|
|
||||||
|
0
REPL/src/StackageLTSGithub.hs
Normal file
0
REPL/src/StackageLTSGithub.hs
Normal file
@ -40,5 +40,5 @@ fetchLTS file url = do
|
|||||||
putStrLn $ "Getting LTS " ++ url ++ " to " ++ file
|
putStrLn $ "Getting LTS " ++ url ++ " to " ++ file
|
||||||
removeIfExists file
|
removeIfExists file
|
||||||
createDirectoryIfMissing True (takeDirectory file)
|
createDirectoryIfMissing True (takeDirectory file)
|
||||||
writeAll2File url file
|
writeAll2File file url
|
||||||
|
|
||||||
|
72927
REPL/stackagefiles/ltsfiles/lts-2.10.yaml
Normal file
72927
REPL/stackagefiles/ltsfiles/lts-2.10.yaml
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user