diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2017-07-15 12:39:11 -0700 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-07-15 12:39:11 -0700 |
| commit | cc021857bbfed0d728e538308b87eb00bdd63efb (patch) | |
| tree | ce5cf05db9eef184e77393b75e6c8941a6406686 /src | |
| parent | 83d1197cc26d0cbeff59013ad08391df9502bc04 (diff) | |
ensure that cleaning up doesn't fail if nothing to clean up
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Sbuild.hs | 13 |
1 files changed, 8 insertions, 5 deletions
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. |
