From 07e007db294b7dcb22142811a49e2c65a2070a9b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Jul 2017 11:32:26 -0400 Subject: Bootstrap.clonedFrom: Fix bug that broke copying .git/config into chroot. --- src/Propellor/Property/Bootstrap.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property/Bootstrap.hs') diff --git a/src/Propellor/Property/Bootstrap.hs b/src/Propellor/Property/Bootstrap.hs index 5678a865..c6abe6b6 100644 --- a/src/Propellor/Property/Bootstrap.hs +++ b/src/Propellor/Property/Bootstrap.hs @@ -83,7 +83,7 @@ clonedFrom reposource = case reposource of -- configuration. copygitconfig :: Property Linux copygitconfig = property ("Propellor repo git config copied from outside the chroot") $ do - let gitconfig = localdir <> ".git" <> "config" + let gitconfig = localdir ".git" "config" cfg <- liftIO $ B.readFile gitconfig exposeTrueLocaldir $ const $ liftIO $ B.writeFile gitconfig cfg -- cgit v1.3-2-g0d8e From c503e4f8458f4794ef153f3eda2cceb9c9741804 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Jul 2017 12:23:41 -0400 Subject: Bootstrap.bootstrappedFrom: Fix bug that caused propellor to only be built from the bootstrapped config the first time. When the config changes, the bootstrapped propellor needs to get rebuilt. This commit was sponsored by Fernando Jimenez on Patreon. --- debian/changelog | 2 ++ src/Propellor/Bootstrap.hs | 2 ++ src/Propellor/Property/Bootstrap.hs | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Property/Bootstrap.hs') diff --git a/debian/changelog b/debian/changelog index 8fdfdf00..7ef4dfe7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ propellor (4.0.7) UNRELEASED; urgency=medium * Diskimage.imageExists: Align disk image size to multiple of 4096 sector size, since some programs (such as VBoxManage convertdd) refuse to operate on disk images not aligned to a sector size. + * Bootstrap.bootstrappedFrom: Fix bug that caused propellor to only + be built from the bootstrapped config the first time. -- Joey Hess Tue, 20 Jun 2017 10:55:37 -0400 diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index a3b7f315..4b3f2da2 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -3,6 +3,8 @@ module Propellor.Bootstrap ( checkBinaryCommand, installGitCommand, buildPropellor, + checkDepsCommand, + buildCommand, ) where import Propellor.Base diff --git a/src/Propellor/Property/Bootstrap.hs b/src/Propellor/Property/Bootstrap.hs index c6abe6b6..099559ad 100644 --- a/src/Propellor/Property/Bootstrap.hs +++ b/src/Propellor/Property/Bootstrap.hs @@ -35,7 +35,8 @@ bootstrappedFrom reposource = go `requires` clonedFrom reposource assumeChange $ exposeTrueLocaldir $ const $ runShellCommand $ buildShellCommand [ "cd " ++ localdir - , bootstrapPropellorCommand system + , checkDepsCommand system + , buildCommand ] -- | Clones the propellor repeository into /usr/local/propellor/ -- cgit v1.3-2-g0d8e From faca829d537fd1e284483ba1bd0cfb8eaf0ed047 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Jul 2017 12:38:21 -0400 Subject: Bootstrap.bootstrappedFrom: Avoid doing anything when not run in a chroot. This way, when a disk image is built using this property, and booted up, running propellor won't try to ensure this property again. This commit was sponsored by Jeff Goeke-Smith on Patreon. --- debian/changelog | 2 ++ src/Propellor/Property/Bootstrap.hs | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/Propellor/Property/Bootstrap.hs') diff --git a/debian/changelog b/debian/changelog index 7ef4dfe7..c52b8329 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ propellor (4.0.7) UNRELEASED; urgency=medium refuse to operate on disk images not aligned to a sector size. * Bootstrap.bootstrappedFrom: Fix bug that caused propellor to only be built from the bootstrapped config the first time. + * Bootstrap.bootstrappedFrom: Avoid doing anything when not run in a + chroot. -- Joey Hess Tue, 20 Jun 2017 10:55:37 -0400 diff --git a/src/Propellor/Property/Bootstrap.hs b/src/Propellor/Property/Bootstrap.hs index 099559ad..767d6ef7 100644 --- a/src/Propellor/Property/Bootstrap.hs +++ b/src/Propellor/Property/Bootstrap.hs @@ -17,17 +17,17 @@ data RepoSource -- | Bootstraps a propellor installation into -- /usr/local/propellor/ -- --- Normally, propellor is already bootstrapped when it runs, so this --- property is not useful. However, this can be useful inside a --- chroot used to build a disk image, to make the disk image --- have propellor installed. +-- This property only does anything when used inside a chroot. +-- This is particularly useful inside a chroot used to build a +-- disk image, to make the disk image have propellor installed. -- -- The git repository is cloned (or pulled to update if it already exists). -- -- All build dependencies are installed, using distribution packages -- or falling back to using cabal. bootstrappedFrom :: RepoSource -> Property Linux -bootstrappedFrom reposource = go `requires` clonedFrom reposource +bootstrappedFrom reposource = check inChroot $ + go `requires` clonedFrom reposource where go :: Property Linux go = property "Propellor bootstrapped" $ do -- cgit v1.3-2-g0d8e