fixes
This commit is contained in:
parent
371f6077fd
commit
f72a1aa690
|
@ -112,12 +112,13 @@ wrapper args propellordir propellorbin = do
|
||||||
setupupstreammaster :: String -> FilePath -> IO ()
|
setupupstreammaster :: String -> FilePath -> IO ()
|
||||||
setupupstreammaster newref propellordir = do
|
setupupstreammaster newref propellordir = do
|
||||||
changeWorkingDirectory propellordir
|
changeWorkingDirectory propellordir
|
||||||
go =<< catchMaybeIO (readProcess "git" ["show-ref", upstreambranch, "--hash"])
|
go =<< catchMaybeIO getoldrev
|
||||||
where
|
where
|
||||||
go Nothing = warnoutofdate False
|
go Nothing = warnoutofdate False
|
||||||
go (Just oldref) = do
|
go (Just oldref) = do
|
||||||
let tmprepo = ".git/propellordisttmp"
|
let tmprepo = ".git/propellordisttmp"
|
||||||
removeDirectoryRecursive tmprepo
|
let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo
|
||||||
|
cleantmprepo
|
||||||
git ["clone", "--quiet", ".", tmprepo]
|
git ["clone", "--quiet", ".", tmprepo]
|
||||||
|
|
||||||
changeWorkingDirectory tmprepo
|
changeWorkingDirectory tmprepo
|
||||||
|
@ -127,9 +128,12 @@ setupupstreammaster newref propellordir = do
|
||||||
git ["commit", "-a", "-m", "merging upstream changes", "--quiet"]
|
git ["commit", "-a", "-m", "merging upstream changes", "--quiet"]
|
||||||
|
|
||||||
fetchUpstreamBranch propellordir tmprepo
|
fetchUpstreamBranch propellordir tmprepo
|
||||||
removeDirectoryRecursive tmprepo
|
cleantmprepo
|
||||||
warnoutofdate True
|
warnoutofdate True
|
||||||
|
|
||||||
|
getoldrev = takeWhile (/= '\n')
|
||||||
|
<$> readProcess "git" ["show-ref", upstreambranch, "--hash"]
|
||||||
|
|
||||||
git = run "git"
|
git = run "git"
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue