summaryrefslogtreecommitdiff
path: root/src/Propellor/DotDir.hs
diff options
context:
space:
mode:
authorJoey Hess2018-02-19 12:55:20 -0400
committerJoey Hess2018-02-19 12:55:20 -0400
commit9d167ac2e64fc3f791ac2695e7a65a70446c80ea (patch)
tree05cec4a82001a1a648f048169c371f0ce13c0fd2 /src/Propellor/DotDir.hs
parent335b5fba4f86929836c9eb59baa8fbd0d311dcf8 (diff)
cleanup debug
Diffstat (limited to 'src/Propellor/DotDir.hs')
-rw-r--r--src/Propellor/DotDir.hs22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs
index be5d614d..125cec3f 100644
--- a/src/Propellor/DotDir.hs
+++ b/src/Propellor/DotDir.hs
@@ -392,12 +392,10 @@ checkRepoUpToDate = whenM (gitbundleavail <&&> dotpropellorpopulated) $ do
updateUpstreamMaster :: String -> IO ()
updateUpstreamMaster newref = do
changeWorkingDirectory =<< dotPropellor
- v <- getoldrev
- case v of
- Nothing -> return ()
- Just oldref -> go oldref
+ go =<< getoldref
where
- go oldref = do
+ go Nothing = return ()
+ go (Just oldref) = do
let tmprepo = ".git/propellordisttmp"
let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo
cleantmprepo
@@ -428,11 +426,10 @@ updateUpstreamMaster newref = do
-- Get ref that the upstreambranch points to, only when
-- the distrepo is being used.
- getoldrev = do
- mrev <- catchMaybeIO $ takeWhile (/= '\n')
+ getoldref = do
+ mref <- catchMaybeIO $ takeWhile (/= '\n')
<$> readProcess "git" ["show-ref", upstreambranch, "--hash"]
- print mrev
- case mrev of
+ case mref of
Just _ -> do
-- Normally there will be no upstream
-- remote when the distrepo is used.
@@ -442,13 +439,12 @@ updateUpstreamMaster newref = do
ifM (hasRemote "upstream")
( do
v <- remoteUrl "upstream"
- print ("remote url", v)
return $ case v of
- Just rurl | rurl == distrepo -> mrev
+ Just rurl | rurl == distrepo -> mref
_ -> Nothing
- , return mrev
+ , return mref
)
- Nothing -> return mrev
+ Nothing -> return mref
-- And, if there's a remote named "upstream"
-- that does not point at the distrepo, the user must have set that up