summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-06-19 09:22:41 -0400
committerAndrew Cady <d@jerkface.net>2019-06-19 09:22:41 -0400
commitdd84b6d803de6c2c3fe7826a7c32b1eb0e314067 (patch)
treeb8183d56117d0d53240d31b9f8dfd085364af360
parentdad378346e8643291e8f45ee79703e19778ee462 (diff)
style
-rw-r--r--fsmgr.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/fsmgr.hs b/fsmgr.hs
index 796863d..fa114ec 100644
--- a/fsmgr.hs
+++ b/fsmgr.hs
@@ -88,7 +88,7 @@ buildRoot DiskImageConfig{..} finalOut = do
88 {- 5. create a backup snapshot -} 88 {- 5. create a backup snapshot -}
89 cmd_ "umount" [mountpoint] 89 cmd_ "umount" [mountpoint]
90 cmd_ "mount -t btrfs -o subvol=/" [out, mountpoint] 90 cmd_ "mount -t btrfs -o subvol=/" [out, mountpoint]
91 flip actionCatch (\(SomeException _) -> return ()) $ cmd_ "btrfs subvolume delete" [mountpoint </> "root~orig"] 91 ignoreErrors $ cmd_ "btrfs subvolume delete" [mountpoint </> "root~orig"]
92 cmd_ "btrfs subvolume snapshot -r" [mountpoint </> "root", mountpoint </> "root~orig"] 92 cmd_ "btrfs subvolume snapshot -r" [mountpoint </> "root", mountpoint </> "root~orig"]
93 93
94 -- cleanup 94 -- cleanup
@@ -97,6 +97,9 @@ buildRoot DiskImageConfig{..} finalOut = do
97 cmd_ "btrfstune -S1" [out] 97 cmd_ "btrfstune -S1" [out]
98 cmd_ "mv" [out, finalOut] 98 cmd_ "mv" [out, finalOut]
99 99
100ignoreErrors :: Action () -> Action ()
101ignoreErrors = flip actionCatch (\(SomeException _) -> return ())
102
100partitionPackages :: [String] -> ([String], [String]) 103partitionPackages :: [String] -> ([String], [String])
101partitionPackages = partition (elem '/') 104partitionPackages = partition (elem '/')
102 105