summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Propellor.hs3
-rw-r--r--Property/File.hs8
3 files changed, 14 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..245a2ac1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+dist/*
+propellor
+tags
diff --git a/Propellor.hs b/Propellor.hs
index 91f130e4..ea2188f7 100644
--- a/Propellor.hs
+++ b/Propellor.hs
@@ -64,4 +64,7 @@ cleanCloudAtCost hostname = propertyList "cloudatcost cleanup"
, "/etc/default/grub" `File.containsLine` "GRUB_DISABLE_LINUX_UUID=true"
`onChange` cmdProperty "update-grub" []
`onChange` cmdProperty "update-initramfs" [Param "-u"]
+ -- Cruft
+ , File.notPresent "/etc/rc.local"
+ , File.notPresent "/etc/init.d/S97-setup.sh"
]
diff --git a/Property/File.hs b/Property/File.hs
index a4b21961..9d07f130 100644
--- a/Property/File.hs
+++ b/Property/File.hs
@@ -1,6 +1,9 @@
module Property.File where
+import System.Directory
+
import Property
+import Utility.Directory
{- Replaces all the content of a file. -}
hasContent :: FilePath -> [Line] -> Property
@@ -20,3 +23,8 @@ f `containsLine` l = FileProperty (f ++ " contains:" ++ l) f go
- file will be written. -}
lacksLine :: FilePath -> Line -> Property
f `lacksLine` l = FileProperty (f ++ " remove: " ++ l) f (filter (/= l))
+
+{- Note: Does not remove symlinks or non-plain-files. -}
+notPresent :: FilePath -> Property
+notPresent f = check (doesFileExist f) $ IOProperty (f ++ " not present") $
+ makeChange $ nukeFile f