From 135be7235bc04af43ca7e3749096a4d1e00c3823 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 3 Oct 2019 21:12:03 -0400 Subject: debugging --- fsmgr.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fsmgr.hs b/fsmgr.hs index cc44796..752b142 100644 --- a/fsmgr.hs +++ b/fsmgr.hs @@ -36,9 +36,9 @@ buildRoot :: DiskImageConfig -> FilePath -> Action () buildRoot config@DiskImageConfig{..} finalOut = do let out = finalOut <.> "tmp" mountpoint = finalOut <.> "mnt" - cmd_ "sh -c" ["! mountpoint -q \"$0\" || umount \"$0\" ", mountpoint] + cmd_ "sh -xc" ["! mountpoint \"$0\" || umount \"$0\" ", mountpoint] - let (abortion :: IO ()) = do + let (abortion :: IO ()) = ignoreErrors' $ do cmd_ "umount" [mountpoint] cmd_ "rmdir" [mountpoint] cmd_ "rm -f" [out] @@ -122,6 +122,9 @@ buildInitialImage DiskImageConfig{..} mountpoint out = do cmd_ (Cwd mountpoint) "mkdir -p var/cache/debconf" cmd_ (Cwd mountpoint) "btrfs subvolume create var/cache/apt/archives" +ignoreErrors' :: IO () -> IO () +ignoreErrors' = flip catch (\(SomeException _) -> return ()) + ignoreErrors :: Action () -> Action () ignoreErrors = flip actionCatch (\(SomeException _) -> return ()) @@ -212,7 +215,7 @@ chrootImage target args = shakeBuildOneImage :: FilePath -> IO () shakeBuildOneImage target = - shake shakeOptions {shakeFiles = "_build"} $ do + shake shakeOptions {shakeFiles = "_build", shakeVerbosity = Loud} $ do want [target -<.> "btrfs"] shakeRules -- cgit v1.2.3