keep warning of out of date after updating upstream/master, until it gets merged
This commit is contained in:
parent
81544b37a8
commit
ceb56ac32b
|
@ -82,8 +82,13 @@ wrapper args propellordir propellorbin = do
|
||||||
headknown <- catchMaybeIO $
|
headknown <- catchMaybeIO $
|
||||||
withQuietOutput createProcessSuccess $
|
withQuietOutput createProcessSuccess $
|
||||||
proc "git" ["log", headrev]
|
proc "git" ["log", headrev]
|
||||||
when (headknown == Nothing) $
|
if (headknown == Nothing)
|
||||||
setupupstreammaster headrev propellordir
|
then setupupstreammaster headrev propellordir
|
||||||
|
else do
|
||||||
|
merged <- not . null <$>
|
||||||
|
readProcess "git" ["log", headrev ++ "..HEAD", "--ancestry-path"]
|
||||||
|
unless merged $
|
||||||
|
warnoutofdate propellordir True
|
||||||
buildruncfg = do
|
buildruncfg = do
|
||||||
changeWorkingDirectory propellordir
|
changeWorkingDirectory propellordir
|
||||||
ifM (boolSystem "make" [Param "build"])
|
ifM (boolSystem "make" [Param "build"])
|
||||||
|
@ -117,7 +122,7 @@ setupupstreammaster newref propellordir = do
|
||||||
changeWorkingDirectory propellordir
|
changeWorkingDirectory propellordir
|
||||||
go =<< catchMaybeIO getoldrev
|
go =<< catchMaybeIO getoldrev
|
||||||
where
|
where
|
||||||
go Nothing = warnoutofdate False
|
go Nothing = warnoutofdate propellordir False
|
||||||
go (Just oldref) = do
|
go (Just oldref) = do
|
||||||
let tmprepo = ".git/propellordisttmp"
|
let tmprepo = ".git/propellordisttmp"
|
||||||
let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo
|
let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo
|
||||||
|
@ -131,7 +136,7 @@ setupupstreammaster newref propellordir = do
|
||||||
|
|
||||||
fetchUpstreamBranch propellordir tmprepo
|
fetchUpstreamBranch propellordir tmprepo
|
||||||
cleantmprepo
|
cleantmprepo
|
||||||
warnoutofdate True
|
warnoutofdate propellordir True
|
||||||
|
|
||||||
getoldrev = takeWhile (/= '\n')
|
getoldrev = takeWhile (/= '\n')
|
||||||
<$> readProcess "git" ["show-ref", upstreambranch, "--hash"]
|
<$> readProcess "git" ["show-ref", upstreambranch, "--hash"]
|
||||||
|
@ -140,7 +145,8 @@ setupupstreammaster newref propellordir = do
|
||||||
run cmd ps = unlessM (boolSystem cmd (map Param ps)) $
|
run cmd ps = unlessM (boolSystem cmd (map Param ps)) $
|
||||||
error $ "Failed to run " ++ cmd ++ " " ++ show ps
|
error $ "Failed to run " ++ cmd ++ " " ++ show ps
|
||||||
|
|
||||||
warnoutofdate havebranch = do
|
warnoutofdate :: FilePath -> Bool -> IO ()
|
||||||
|
warnoutofdate propellordir havebranch = do
|
||||||
warningMessage ("** Your " ++ propellordir ++ " is out of date..")
|
warningMessage ("** Your " ++ propellordir ++ " is out of date..")
|
||||||
let also s = hPutStrLn stderr (" " ++ s)
|
let also s = hPutStrLn stderr (" " ++ s)
|
||||||
also ("A newer upstream version is available in " ++ distrepo)
|
also ("A newer upstream version is available in " ++ distrepo)
|
||||||
|
|
Loading…
Reference in New Issue