diff options
| author | Joey Hess <joeyh@joeyh.name> | 2018-01-02 13:10:17 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2018-01-02 13:10:17 -0400 |
| commit | 53619534832ecea2078df71bfa9dc0d666f1309a (patch) | |
| tree | 96a19035ddf22778a19f9564b1ba63cb799a586e | |
| parent | 445b1c051d1d2673bb99cfc740f4dbc08698fd28 (diff) | |
avoid bogus warning
Avoid bogus warning about new upstream version when /usr/bin/propellor is
run on a Debian system, but ~/.propellor was not cloned from the Debian git
bundle.
3 files changed, 31 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog index f4204e06..8923b94a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +propellor (5.2.1) UNRELEASED; urgency=medium + + * Avoid bogus warning about new upstream version when /usr/bin/propellor + is run on a Debian system, but ~/.propellor was not cloned from the + Debian git bundle. + + -- Joey Hess <id@joeyh.name> Tue, 02 Jan 2018 13:06:45 -0400 + propellor (5.2.0) unstable; urgency=medium [ Joey Hess ] diff --git a/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_5_af7919be09eb454b2dca235ede03008f._comment b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_5_af7919be09eb454b2dca235ede03008f._comment new file mode 100644 index 00000000..157e7803 --- /dev/null +++ b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_5_af7919be09eb454b2dca235ede03008f._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 5""" + date="2018-01-02T17:08:07Z" + content=""" +@spwhitton ah, I had not noticed that case. I found a way to avoid the +unncessary warning in that case; since there's no upstream/master ref when +~/.propellor has not been cloned from the debian git bundle, it can detect +that and avoid warning. Done so. +"""]] diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index e9253b87..200625e8 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -358,7 +358,7 @@ checkRepoUpToDate = whenM (gitbundleavail <&&> dotpropellorpopulated) $ do withQuietOutput createProcessSuccess $ proc "git" ["log", headrev] if (headknown == Nothing) - then setupUpstreamMaster headrev + then updateUpstreamMaster headrev else do theirhead <- getCurrentGitSha1 =<< getCurrentBranchRef when (theirhead /= headrev) $ do @@ -372,26 +372,29 @@ checkRepoUpToDate = whenM (gitbundleavail <&&> dotpropellorpopulated) $ do d <- dotPropellor doesFileExist (d </> "propellor.cabal") --- Makes upstream/master in dotPropellor be a usefully mergeable branch. +-- Updates upstream/master in dotPropellor so merging from it will update +-- to the latest distrepo. -- --- We cannot just use origin/master, because in the case of a distrepo, --- it only contains 1 commit. So, trying to merge with it will result --- in lots of merge conflicts, since git cannot find a common parent --- commit. +-- We cannot just fetch the distrepo because the distrepo contains only +-- 1 commit. So, trying to merge with it will result in lots of merge +-- conflicts, since git cannot find a common parent commit. -- --- Instead, the upstream/master branch is created by taking the +-- Instead, the upstream/master branch is updated by taking the -- upstream/master branch (which must be an old version of propellor, -- as distributed), and diffing from it to the current origin/master, -- and committing the result. This is done in a temporary clone of the -- repository, giving it a new master branch. That new branch is fetched -- into the user's repository, as if fetching from a upstream remote, -- yielding a new upstream/master branch. -setupUpstreamMaster :: String -> IO () -setupUpstreamMaster newref = do +-- +-- If there's no upstream/master, the user is not using the distrepo, +-- so does nothing. +updateUpstreamMaster :: String -> IO () +updateUpstreamMaster newref = do changeWorkingDirectory =<< dotPropellor go =<< catchMaybeIO getoldrev where - go Nothing = warnoutofdate False + go Nothing = return () go (Just oldref) = do let tmprepo = ".git/propellordisttmp" let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo |
