summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
l---------config.hs2
-rwxr-xr-xdebian/rules2
-rw-r--r--doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn41
-rw-r--r--doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn1
4 files changed, 44 insertions, 2 deletions
diff --git a/config.hs b/config.hs
index 07959a0a..ec313725 120000
--- a/config.hs
+++ b/config.hs
@@ -1 +1 @@
-config-joey.hs \ No newline at end of file
+config-simple.hs \ No newline at end of file
diff --git a/debian/rules b/debian/rules
index c88cc004..a71212db 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,4 @@
-#!/bin/false
+#!/usr/bin/make -f
# Avoid using cabal, as it writes to $HOME
export CABAL=./Setup
diff --git a/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn b/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn
new file mode 100644
index 00000000..c9f5ec8b
--- /dev/null
+++ b/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn
@@ -0,0 +1,41 @@
+This script turns
+
+ Section "Monitor"
+ Identifier "Configured Monitor"
+ EndSection
+
+into this:
+
+ [ "Section \"Monitor\""
+ , "\tIdentifier \"Configured Monitor\""
+ , "EndSection"
+ ]
+
+for the inclusion of short config files in your Propellor config using `File.hasContent`.
+
+[[!format haskell """
+#!/usr/bin/runhaskell
+
+main = interact $ unlines . propellorLines . lines
+
+propellorLines :: [String] -> [String]
+propellorLines (x:xs) = ("[ " ++ wrapEscapeLine x) : propellorLines' xs
+
+propellorLines' :: [String] -> [String]
+propellorLines' = foldr step ["]"]
+ where
+ step x xs = (", " ++ wrapEscapeLine x) : xs
+
+wrapEscapeLine :: String -> String
+wrapEscapeLine line = "\"" ++ (foldr step "" line) ++ "\""
+ where
+ step x xs
+ | x == '\t' = "\\t" ++ xs
+ | x == '\\' = x : x : xs
+ | x == '"' = '\\' : x : xs
+ | otherwise = x : xs
+"""]]
+
+Usage: `cat config_file | propellor_lines` (or in Emacs, dump the config file into your propellor config, select the region and use `C-u M-|` to pipe it through).
+
+-- [[spwhitton|https://spwhitton.name]]
diff --git a/doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn b/doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn
index 6bdd0b42..c1df5461 100644
--- a/doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn
+++ b/doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn
@@ -10,3 +10,4 @@ This branch adds
Note that `Git.repoConfigured` uses a tuple instead of just two function arguments in order that it can be used infix in `config.hs` when connected to other properties with `&`, as `ConfFile.containsIniSetting`.
> [[done]], thank you (had to fix some indents) --[[Joey]]
+>> Sorry about that! Thought I had Emacs set up for your style guide. --spwhitton