From 1eae61a72a4b4636326d042cdf66d7cb94c7e708 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 8 Aug 2019 11:35:10 -0400 Subject: Localdir.hasOriginUrl: Depend on Git.installed. * Localdir.hasOriginUrl: Depend on Git.installed. * Localdir.hasOriginUrl: Type changed from UnixLike to DebianLike because Git.installed is not implemented for other unixes. (API change) This commit was sponsored by Denis Dzyubenko on Patreon. --- debian/changelog | 9 +++++++++ .../comment_1_2ef9109c5cd7e8ca89f309c48320ac20._comment | 12 ++++++++++++ src/Propellor/Property/Localdir.hs | 7 +++++-- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 doc/forum/hasOriginUrl_does_not_work_if_git_was_not_installed/comment_1_2ef9109c5cd7e8ca89f309c48320ac20._comment diff --git a/debian/changelog b/debian/changelog index 547cfb3a..3031d05a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +propellor (5.10.1) UNRELEASED; urgency=medium + + * Localdir.hasOriginUrl: Depend on Git.installed. + * Localdir.hasOriginUrl: Type changed from UnixLike to DebianLike + because Git.installed is not implemented for other unixes. + (API change) + + -- Joey Hess Thu, 08 Aug 2019 11:33:37 -0400 + propellor (5.9.1) unstable; urgency=medium * Apt: Debian has changed the name of the suite for testing security updates diff --git a/doc/forum/hasOriginUrl_does_not_work_if_git_was_not_installed/comment_1_2ef9109c5cd7e8ca89f309c48320ac20._comment b/doc/forum/hasOriginUrl_does_not_work_if_git_was_not_installed/comment_1_2ef9109c5cd7e8ca89f309c48320ac20._comment new file mode 100644 index 00000000..b11da49f --- /dev/null +++ b/doc/forum/hasOriginUrl_does_not_work_if_git_was_not_installed/comment_1_2ef9109c5cd7e8ca89f309c48320ac20._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2019-08-08T15:28:13Z" + content=""" +I've made the property require Git.installed. + +I guess this was not noticed because either I was using some other property +that also installed git, or I only tried it outside a virtual machine, and +so propellor had installed git as part of its process of bootstrapping a +host. +"""]] diff --git a/src/Propellor/Property/Localdir.hs b/src/Propellor/Property/Localdir.hs index 2323f569..69d9af74 100644 --- a/src/Propellor/Property/Localdir.hs +++ b/src/Propellor/Property/Localdir.hs @@ -9,6 +9,7 @@ import Propellor.Git.Config import Propellor.Types.Info import Propellor.Types.Container import Propellor.Property.Mount (partialBindMountsOf, umountLazy) +import qualified Propellor.Property.Git as Git -- | Sets the url to use as the origin of propellor's git repository. -- @@ -19,8 +20,10 @@ import Propellor.Property.Mount (partialBindMountsOf, umountLazy) -- When hosts are being updated without using -- --spin, eg when using -- the `Propellor.Property.Cron.runPropellor` cron job, this property can -- be set to redirect them to a new git repository url. -hasOriginUrl :: String -> Property (HasInfo + UnixLike) -hasOriginUrl u = setInfoProperty p (toInfo (InfoVal (OriginUrl u))) +hasOriginUrl :: String -> Property (HasInfo + DebianLike) +hasOriginUrl u = + setInfoProperty p (toInfo (InfoVal (OriginUrl u))) + `requires` Git.installed where p :: Property UnixLike p = property ("propellor repo url " ++ u) $ do -- cgit v1.2.3