summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-10-03 21:12:03 -0400
committerAndrew Cady <d@jerkface.net>2019-10-03 21:12:03 -0400
commit135be7235bc04af43ca7e3749096a4d1e00c3823 (patch)
treee6fa51032bf55698adcb0e584472992da1d5dc88
parent75ef900900131ef59b9c5a5c5aa2ff1b44c8dbf8 (diff)
debuggingwip
-rw-r--r--fsmgr.hs9
1 files 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 ()
36buildRoot config@DiskImageConfig{..} finalOut = do 36buildRoot config@DiskImageConfig{..} finalOut = do
37 let out = finalOut <.> "tmp" 37 let out = finalOut <.> "tmp"
38 mountpoint = finalOut <.> "mnt" 38 mountpoint = finalOut <.> "mnt"
39 cmd_ "sh -c" ["! mountpoint -q \"$0\" || umount \"$0\" ", mountpoint] 39 cmd_ "sh -xc" ["! mountpoint \"$0\" || umount \"$0\" ", mountpoint]
40 40
41 let (abortion :: IO ()) = do 41 let (abortion :: IO ()) = ignoreErrors' $ do
42 cmd_ "umount" [mountpoint] 42 cmd_ "umount" [mountpoint]
43 cmd_ "rmdir" [mountpoint] 43 cmd_ "rmdir" [mountpoint]
44 cmd_ "rm -f" [out] 44 cmd_ "rm -f" [out]
@@ -122,6 +122,9 @@ buildInitialImage DiskImageConfig{..} mountpoint out = do
122 cmd_ (Cwd mountpoint) "mkdir -p var/cache/debconf" 122 cmd_ (Cwd mountpoint) "mkdir -p var/cache/debconf"
123 cmd_ (Cwd mountpoint) "btrfs subvolume create var/cache/apt/archives" 123 cmd_ (Cwd mountpoint) "btrfs subvolume create var/cache/apt/archives"
124 124
125ignoreErrors' :: IO () -> IO ()
126ignoreErrors' = flip catch (\(SomeException _) -> return ())
127
125ignoreErrors :: Action () -> Action () 128ignoreErrors :: Action () -> Action ()
126ignoreErrors = flip actionCatch (\(SomeException _) -> return ()) 129ignoreErrors = flip actionCatch (\(SomeException _) -> return ())
127 130
@@ -212,7 +215,7 @@ chrootImage target args =
212 215
213shakeBuildOneImage :: FilePath -> IO () 216shakeBuildOneImage :: FilePath -> IO ()
214shakeBuildOneImage target = 217shakeBuildOneImage target =
215 shake shakeOptions {shakeFiles = "_build"} $ do 218 shake shakeOptions {shakeFiles = "_build", shakeVerbosity = Loud} $ do
216 want [target -<.> "btrfs"] 219 want [target -<.> "btrfs"]
217 shakeRules 220 shakeRules
218 221