From fa77a253f2034f6185cf36b5407bc22a092e6ea5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Feb 2018 13:54:02 -0400 Subject: changelog --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d613401b..22d5637d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ propellor (5.3.2) UNRELEASED; urgency=medium (Inspired by Vaibhav Sagar's talk on Functional Devops in a Dysfunctional World at LCA 2018.) * Added Git.pulled. + * Systemd.machined: Install systemd-container on Debian + stretch. + Thanks, Sean Whitton -- Joey Hess Sun, 11 Feb 2018 11:58:04 -0400 -- cgit v1.2.3 From b0599c446cbcc5eb5f46687699115ea27b62ef3e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Feb 2018 14:31:47 -0400 Subject: releasing package propellor version 5.3.2 --- debian/changelog | 4 ++-- propellor.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 22d5637d..3515497b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -propellor (5.3.2) UNRELEASED; urgency=medium +propellor (5.3.2) unstable; urgency=medium * Added Propellor.Property.Atomic, which can make a non-atomic property that operates on a directory into an atomic property. @@ -9,7 +9,7 @@ propellor (5.3.2) UNRELEASED; urgency=medium stretch. Thanks, Sean Whitton - -- Joey Hess Sun, 11 Feb 2018 11:58:04 -0400 + -- Joey Hess Sun, 18 Feb 2018 14:31:39 -0400 propellor (5.3.1) unstable; urgency=medium diff --git a/propellor.cabal b/propellor.cabal index 48d34b47..d9157eb1 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 5.3.1 +Version: 5.3.2 Cabal-Version: >= 1.20 License: BSD2 Maintainer: Joey Hess -- cgit v1.2.3 From 6f18e665ca8d960a77e437d8edec8f3d14169585 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Feb 2018 12:46:16 -0400 Subject: Warn again about new upstream version when ~/.propellor was cloned from the Debian git bundle using an older version of propellor that set up an upstream remote. This commit was sponsored by Jake Vosloo on Patreon. --- debian/changelog | 8 ++++ ...nt_12_aea497eeecb077659db3f1dfb1e5f289._comment | 20 ++++++++++ src/Propellor/DotDir.hs | 45 +++++++++++++++++----- src/Propellor/Git.hs | 4 ++ 4 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_12_aea497eeecb077659db3f1dfb1e5f289._comment (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 3515497b..55ca5a93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +propellor (5.3.3) UNRELEASED; urgency=medium + + * Warn again about new upstream version when ~/.propellor was cloned from the + Debian git bundle using an older version of propellor that set up an + upstream remote. + + -- Joey Hess Mon, 19 Feb 2018 12:44:24 -0400 + propellor (5.3.2) unstable; urgency=medium * Added Propellor.Property.Atomic, which can make a non-atomic property diff --git a/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_12_aea497eeecb077659db3f1dfb1e5f289._comment b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_12_aea497eeecb077659db3f1dfb1e5f289._comment new file mode 100644 index 00000000..90d0ba2c --- /dev/null +++ b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_12_aea497eeecb077659db3f1dfb1e5f289._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 12""" + date="2018-02-19T15:48:21Z" + content=""" +What propellor --init sets up, when you select the clone option +and the Debian package is installed, is no remote +defined, but a remotes/upsteam/master tracking branch. + +So not normally this: + + upstream /usr/src/propellor/propellor.git (fetch) + +Aha! The very first revision of propellor --init +*did* set up an upstream remote pointing at the distrepo. At some point +that changed to the above described behavior. You're bitten by being an +early adopter. + +I've adjusted the logic to handle that case. +"""]] diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index 17eb095a..39c111f6 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -387,16 +387,17 @@ checkRepoUpToDate = whenM (gitbundleavail <&&> dotpropellorpopulated) $ do -- into the user's repository, as if fetching from a upstream remote, -- yielding a new upstream/master branch. -- --- If there's no upstream/master, the user is not using the distrepo, --- so do nothing. And, if there's a remote named "upstream", the user --- must have set that up and is not using the distrepo, so do nothing. +-- If there's no upstream/master, or the repo is not using the distrepo, +-- do nothing. updateUpstreamMaster :: String -> IO () -updateUpstreamMaster newref = unlessM (hasRemote "upstream") $ do +updateUpstreamMaster newref = do changeWorkingDirectory =<< dotPropellor - go =<< catchMaybeIO getoldrev + v <- getoldrev + case v of + Nothing -> return () + Just oldref -> go oldref where - go Nothing = return () - go (Just oldref) = do + go oldref = do let tmprepo = ".git/propellordisttmp" let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo cleantmprepo @@ -421,13 +422,37 @@ updateUpstreamMaster newref = unlessM (hasRemote "upstream") $ do cleantmprepo warnoutofdate True - getoldrev = takeWhile (/= '\n') - <$> readProcess "git" ["show-ref", upstreambranch, "--hash"] - git = run "git" run cmd ps = unlessM (boolSystem cmd (map Param ps)) $ error $ "Failed to run " ++ cmd ++ " " ++ show ps + -- Get ref that the upstreambranch points to, only when + -- the distrepo is being used. + getoldrev = do + mrev <- catchMaybeIO $ takeWhile (/= '\n') + <$> readProcess "git" ["show-ref", upstreambranch, "--hash"] + print mrev + case mrev of + Just _ -> do + -- Normally there will be no upstream + -- remote when the distrepo is used. + -- Older versions of propellor set up + -- an upstream remote pointing at the + -- distrepo. + ifM (hasRemote "upstream") + ( do + v <- remoteUrl "upstream" + print ("remote url", v) + return $ case v of + Just rurl | rurl == distrepo -> mrev + _ -> Nothing + , return mrev + ) + Nothing -> return mrev + +-- And, if there's a remote named "upstream" +-- that does not point at the distrepo, the user must have set that up +-- and is not using the distrepo, so do nothing. warnoutofdate :: Bool -> IO () warnoutofdate havebranch = do warningMessage ("** Your ~/.propellor/ is out of date..") diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs index 10b88ddd..c446f67a 100644 --- a/src/Propellor/Git.hs +++ b/src/Propellor/Git.hs @@ -30,6 +30,10 @@ hasRemote remotename = catchDefaultIO False $ do rs <- lines <$> readProcess "git" ["remote"] return $ remotename `elem` rs +remoteUrl :: String -> IO (Maybe String) +remoteUrl remotename = catchDefaultIO Nothing $ headMaybe . lines + <$> readProcess "git" ["config", "remote." ++ remotename ++ ".url"] + hasGitRepo :: IO Bool hasGitRepo = doesFileExist ".git/HEAD" -- cgit v1.2.3 From 530d9ff6bea5570d051d07546a128d456b3c5c3b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Feb 2018 11:41:57 -0400 Subject: Avoid crashing if initial fetch from origin fails when spinning a host. --- debian/changelog | 1 + .../comment_1_be4533d304096f431ac8d35bbf990dab._comment | 13 +++++++++++++ src/Propellor/Git/VerifiedBranch.hs | 11 ++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_1_be4533d304096f431ac8d35bbf990dab._comment (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 55ca5a93..bc7a4a69 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ propellor (5.3.3) UNRELEASED; urgency=medium * Warn again about new upstream version when ~/.propellor was cloned from the Debian git bundle using an older version of propellor that set up an upstream remote. + * Avoid crashing if initial fetch from origin fails when spinning a host. -- Joey Hess Mon, 19 Feb 2018 12:44:24 -0400 diff --git a/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_1_be4533d304096f431ac8d35bbf990dab._comment b/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_1_be4533d304096f431ac8d35bbf990dab._comment new file mode 100644 index 00000000..e79fabfb --- /dev/null +++ b/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_1_be4533d304096f431ac8d35bbf990dab._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2018-02-22T15:34:07Z" + content=""" +--spin has always pushed/pulled from origin, if there is +a central git repository. + +It's an optional thing though, since the update is pushed directly to the +host it spins too. + +I've improved the code to avoid this particular crash.. +"""]] diff --git a/src/Propellor/Git/VerifiedBranch.hs b/src/Propellor/Git/VerifiedBranch.hs index 51fcb573..df607bd2 100644 --- a/src/Propellor/Git/VerifiedBranch.hs +++ b/src/Propellor/Git/VerifiedBranch.hs @@ -30,12 +30,17 @@ verifyOriginBranch originbranch = do -- Returns True if HEAD is changed by fetching and merging from origin. fetchOrigin :: IO Bool fetchOrigin = do + fetched <- actionMessage "Pull from central git repository" $ + boolSystem "git" [Param "fetch"] + if fetched + then mergeOrigin + else return False + +mergeOrigin :: IO Bool +mergeOrigin = do branchref <- getCurrentBranch let originbranch = "origin" branchref - void $ actionMessage "Pull from central git repository" $ - boolSystem "git" [Param "fetch"] - oldsha <- getCurrentGitSha1 branchref keyring <- privDataKeyring -- cgit v1.2.3 From afb39c9e650826f4ef0855430040aefad67be92f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Feb 2018 14:08:27 -0400 Subject: Added Propllor.Property.Openssl module contributed by contributed by Félix Sipma. --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index bc7a4a69..e1a63d61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ propellor (5.3.3) UNRELEASED; urgency=medium Debian git bundle using an older version of propellor that set up an upstream remote. * Avoid crashing if initial fetch from origin fails when spinning a host. + * Added Propllor.Property.Openssl module contributed by contributed by + Félix Sipma. -- Joey Hess Mon, 19 Feb 2018 12:44:24 -0400 -- cgit v1.2.3 From e9c69dab91165cda0311d05e5b6a49697fae6e05 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Feb 2018 14:34:45 -0400 Subject: releasing package propellor version 5.3.3 --- debian/changelog | 4 ++-- propellor.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e1a63d61..b97b12b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -propellor (5.3.3) UNRELEASED; urgency=medium +propellor (5.3.3) unstable; urgency=medium * Warn again about new upstream version when ~/.propellor was cloned from the Debian git bundle using an older version of propellor that set up an @@ -7,7 +7,7 @@ propellor (5.3.3) UNRELEASED; urgency=medium * Added Propllor.Property.Openssl module contributed by contributed by Félix Sipma. - -- Joey Hess Mon, 19 Feb 2018 12:44:24 -0400 + -- Joey Hess Mon, 26 Feb 2018 14:34:37 -0400 propellor (5.3.2) unstable; urgency=medium diff --git a/propellor.cabal b/propellor.cabal index b22abcba..5f6abc8b 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 5.3.2 +Version: 5.3.3 Cabal-Version: >= 1.20 License: BSD2 Maintainer: Joey Hess -- cgit v1.2.3