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,14 +145,15 @@ 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 ()
|
||||||
warningMessage ("** Your " ++ propellordir ++ " is out of date..")
|
warnoutofdate propellordir havebranch = do
|
||||||
let also s = hPutStrLn stderr (" " ++ s)
|
warningMessage ("** Your " ++ propellordir ++ " is out of date..")
|
||||||
also ("A newer upstream version is available in " ++ distrepo)
|
let also s = hPutStrLn stderr (" " ++ s)
|
||||||
if havebranch
|
also ("A newer upstream version is available in " ++ distrepo)
|
||||||
then also ("To merge it, run: git merge " ++ upstreambranch)
|
if havebranch
|
||||||
else also ("To merge it, find the most recent commit in your repository's history that corresponds to an upstream release of propellor, and set refs/remotes/" ++ upstreambranch ++ " to it. Then run propellor again.")
|
then also ("To merge it, run: git merge " ++ upstreambranch)
|
||||||
also ""
|
else also ("To merge it, find the most recent commit in your repository's history that corresponds to an upstream release of propellor, and set refs/remotes/" ++ upstreambranch ++ " to it. Then run propellor again.")
|
||||||
|
also ""
|
||||||
|
|
||||||
fetchUpstreamBranch :: FilePath -> FilePath -> IO ()
|
fetchUpstreamBranch :: FilePath -> FilePath -> IO ()
|
||||||
fetchUpstreamBranch propellordir repo = do
|
fetchUpstreamBranch propellordir repo = do
|
||||||
|
|
Loading…
Reference in New Issue