diff options
author | Andrew Cady <d@jerkface.net> | 2019-10-03 21:12:03 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2019-10-03 21:12:03 -0400 |
commit | 135be7235bc04af43ca7e3749096a4d1e00c3823 (patch) | |
tree | e6fa51032bf55698adcb0e584472992da1d5dc88 | |
parent | 75ef900900131ef59b9c5a5c5aa2ff1b44c8dbf8 (diff) |
debuggingwip
-rw-r--r-- | fsmgr.hs | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -36,9 +36,9 @@ buildRoot :: DiskImageConfig -> FilePath -> Action () | |||
36 | buildRoot config@DiskImageConfig{..} finalOut = do | 36 | buildRoot 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 | ||
125 | ignoreErrors' :: IO () -> IO () | ||
126 | ignoreErrors' = flip catch (\(SomeException _) -> return ()) | ||
127 | |||
125 | ignoreErrors :: Action () -> Action () | 128 | ignoreErrors :: Action () -> Action () |
126 | ignoreErrors = flip actionCatch (\(SomeException _) -> return ()) | 129 | ignoreErrors = flip actionCatch (\(SomeException _) -> return ()) |
127 | 130 | ||
@@ -212,7 +215,7 @@ chrootImage target args = | |||
212 | 215 | ||
213 | shakeBuildOneImage :: FilePath -> IO () | 216 | shakeBuildOneImage :: FilePath -> IO () |
214 | shakeBuildOneImage target = | 217 | shakeBuildOneImage 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 | ||