|
diff --git a/fsmgr.hs b/fsmgr.hs index c850d0f..2382f78 100644 --- a/ fsmgr.hs+++ b/ fsmgr.hs |
@@ -512,23 +512,26 @@ needSubvolume path = ioUnless (IO.doesDirectoryExist path) $ do |
512 | cmd_ "chmod" ["--reference="++path++"/.."] [path] |
512 | cmd_ "chmod" ["--reference="++path++"/.."] [path] |
513 | cmd_ "chown" ["--reference="++path++"/.."] [path] |
513 | cmd_ "chown" ["--reference="++path++"/.."] [path] |
514 | |
514 | |
| |
515 | needSubvolumes :: Action () |
| |
516 | needSubvolumes = mapM_ needSubvolume ["_build", "_filesystem"] |
| |
517 | |
515 | shakeRules :: Rules () |
518 | shakeRules :: Rules () |
516 | shakeRules = do |
519 | shakeRules = do |
517 | ["_build/*.yaml.canon", "_filesystem/*.yaml.canon"] |%> \out -> do |
520 | ["_build/*.yaml.canon", "_filesystem/*.yaml.canon"] |%> \out -> do |
518 | needSubvolume "_build" |
521 | needSubvolumes |
519 | let yaml = dropDirectory1 $ dropExtension out |
522 | let yaml = dropDirectory1 $ dropExtension out |
520 | need [yaml] |
523 | need [yaml] |
521 | cfg <- readCfg yaml |
524 | cfg <- readCfg yaml |
522 | writeFileChanged out (show cfg) |
525 | writeFileChanged out (show cfg) |
523 | ["_build/*.btrfs", "_filesystem/*.patch.btrfs"] |%> \out -> do |
526 | ["_build/*.btrfs", "_filesystem/*.patch.btrfs"] |%> \out -> do |
524 | needSubvolume "_build" |
527 | needSubvolumes |
525 | let cfgFile = (out -<.> "yaml.canon") |
528 | let cfgFile = (out -<.> "yaml.canon") |
526 | need [cfgFile] |
529 | need [cfgFile] |
527 | cfg <- readEither <$> readFile' cfgFile |
530 | cfg <- readEither <$> readFile' cfgFile |
528 | either (error . (("Error parsing file: " ++ cfgFile ++ ": ") ++)) (flip buildRoot out) cfg |
531 | either (error . (("Error parsing file: " ++ cfgFile ++ ": ") ++)) (flip buildRoot out) cfg |
529 | |
532 | |
530 | priority 2 $ "_filesystem/*.seed.btrfs" %> \out -> do |
533 | priority 2 $ "_filesystem/*.seed.btrfs" %> \out -> do |
531 | needSubvolume "_filesystem" |
534 | needSubvolumes |
532 | let inp = ("_build" </>) $ dropDirectory1 $ dropExtension out -<.> ".btrfs" |
535 | let inp = ("_build" </>) $ dropDirectory1 $ dropExtension out -<.> ".btrfs" |
533 | tmp = out <.> "tmp" |
536 | tmp = out <.> "tmp" |
534 | need [inp] |
537 | need [inp] |
|