From cc021857bbfed0d728e538308b87eb00bdd63efb Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 15 Jul 2017 12:39:11 -0700 Subject: ensure that cleaning up doesn't fail if nothing to clean up --- src/Propellor/Property/Sbuild.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 1ff4876a..35acb8bf 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -245,13 +245,16 @@ built s@(SbuildSchroot suite arch) mirror cc = -- clean up config from earlier versions of this module cleanupOldConfig :: Property UnixLike - cleanupOldConfig = property' "old sbuild module config cleaned up" $ \w -> do - void $ ensureProperty w $ - check (doesFileExist fstab) (File.lacksLine fstab aptCacheLine) - liftIO $ removeDirectoryRecursive "/etc/schroot/piuparts" - makeChange $ nukeFile (schrootPiupartsConf s) + cleanupOldConfig = + property' "old sbuild module config cleaned up" $ \w -> do + void $ ensureProperty w $ + check (doesFileExist fstab) + (File.lacksLine fstab aptCacheLine) + void $ liftIO . tryIO $ removeDirectoryRecursive profile + makeChange $ nukeFile (schrootPiupartsConf s) where fstab = "/etc/schroot/sbuild/fstab" + profile = "/etc/schroot/piuparts" -- A failed debootstrap run will leave a debootstrap directory; -- recover by deleting it and trying again. -- cgit v1.2.3