summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/Chroot.hs5
-rw-r--r--src/Propellor/Property/Schroot.hs5
-rw-r--r--src/Propellor/Property/SiteSpecific/JoeySites.hs2
-rw-r--r--src/Propellor/Shim.hs9
4 files changed, 13 insertions, 8 deletions
diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs
index 0dd1f05a..5d29538c 100644
--- a/src/Propellor/Property/Chroot.hs
+++ b/src/Propellor/Property/Chroot.hs
@@ -169,10 +169,7 @@ propellChroot :: Chroot -> ([String] -> IO (CreateProcess, IO ())) -> Bool -> Pr
propellChroot c@(Chroot loc _ _ _) mkproc systemdonly = property (chrootDesc c "provisioned") $ do
let d = localdir </> shimdir c
let me = localdir </> "propellor"
- shim <- liftIO $ ifM (doesDirectoryExist d)
- ( pure (Shim.file me d)
- , Shim.setup me Nothing d
- )
+ shim <- liftIO $ Shim.setup me Nothing d
ifM (liftIO $ bindmount shim)
( chainprovision shim
, return FailedChange
diff --git a/src/Propellor/Property/Schroot.hs b/src/Propellor/Property/Schroot.hs
index bb20f6e6..2f399b7c 100644
--- a/src/Propellor/Property/Schroot.hs
+++ b/src/Propellor/Property/Schroot.hs
@@ -32,8 +32,8 @@ usesOverlays = isJust . fromInfoVal
-- Implicitly sets 'useOverlays' info property.
--
-- Shell script from <https://wiki.debian.org/sbuild>.
-overlaysInTmpfs :: Property (HasInfo + DebianLike)
-overlaysInTmpfs = go `requires` installed
+overlaysInTmpfs :: RevertableProperty (HasInfo + DebianLike) UnixLike
+overlaysInTmpfs = (go `requires` installed) <!> undo
where
f = "/etc/schroot/setup.d/04tmpfs"
go :: Property (HasInfo + UnixLike)
@@ -58,6 +58,7 @@ overlaysInTmpfs = go `requires` installed
, "fi"
]
`onChange` (f `File.mode` combineModes (readModes ++ executeModes))
+ undo = File.notPresent f
installed :: Property DebianLike
installed = Apt.installed ["schroot"]
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs
index de93605e..9d7423d7 100644
--- a/src/Propellor/Property/SiteSpecific/JoeySites.hs
+++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs
@@ -1074,7 +1074,7 @@ laptopSoftware = Apt.installed
, "bsdgames", "nethack-console"
, "xmonad", "libghc-xmonad-dev", "libghc-xmonad-contrib-dev"
, "ttf-bitstream-vera"
- , "mairix", "offlineimap", "mutt"
+ , "mairix", "offlineimap", "mutt", "slrn"
, "mtr", "nmap", "whois", "wireshark", "tcpdump", "iftop"
, "pmount", "tree", "pv"
, "arbtt", "hledger", "bc"
diff --git a/src/Propellor/Shim.hs b/src/Propellor/Shim.hs
index 811ae7f0..b8ebdf46 100644
--- a/src/Propellor/Shim.hs
+++ b/src/Propellor/Shim.hs
@@ -16,12 +16,19 @@ import System.Posix.Files
-- | Sets up a shimmed version of the program, in a directory, and
-- returns its path.
--
+-- If the shim was already set up, it's refreshed, in case newer
+-- versions of libraries are needed.
+--
-- Propellor may be running from an existing shim, in which case it's
-- simply reused.
setup :: FilePath -> Maybe FilePath -> FilePath -> IO FilePath
-setup propellorbin propellorbinpath dest = checkAlreadyShimmed shim $ do
+setup propellorbin propellorbinpath dest = checkAlreadyShimmed propellorbin $ do
createDirectoryIfMissing True dest
+ -- Remove all old libraries inside dest, but do not delete the
+ -- directory itself, since it may be bind-mounted inside a chroot.
+ mapM_ nukeFile =<< dirContentsRecursive dest
+
libs <- parseLdd <$> readProcess "ldd" [propellorbin]
glibclibs <- glibcLibs
let libs' = nub $ libs ++ glibclibs