Template directories are Makefile-configured.
parent
0c3a61f58d
commit
f40dbccc1f
|
@ -5,6 +5,8 @@ RC_DIRECTORY = "@SYSCONFDIR@/rc/services"
|
||||||
LOG_DIRECTORY = "@VARSTATEDIR@/log"
|
LOG_DIRECTORY = "@VARSTATEDIR@/log"
|
||||||
SERVICES_DIRECTORY = "@SHAREDIR@/services"
|
SERVICES_DIRECTORY = "@SHAREDIR@/services"
|
||||||
ENVIRONMENTS_DIRECTORY = "@SYSCONFDIR@/rc/environments"
|
ENVIRONMENTS_DIRECTORY = "@SYSCONFDIR@/rc/environments"
|
||||||
|
SYSTEM_CONFIGURATION_DIRECTORY = "@SYSCONFDIR@"
|
||||||
|
SHARED_DATA_DIRECTORY = "@SHAREDIR@"
|
||||||
OWN_LIBEXEC_DIR = "@LIBEXECDIR@/service"
|
OWN_LIBEXEC_DIR = "@LIBEXECDIR@/service"
|
||||||
CACHE_DIRECTORY = "@VARSTATEDIR@/cache"
|
CACHE_DIRECTORY = "@VARSTATEDIR@/cache"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
require "crinja"
|
require "crinja"
|
||||||
|
|
||||||
|
require "./config.cr"
|
||||||
|
|
||||||
def sanitize_path(path)
|
def sanitize_path(path)
|
||||||
path.gsub /\/\/+/, "/"
|
path.gsub /\/\/+/, "/"
|
||||||
end
|
end
|
||||||
|
@ -41,11 +43,9 @@ class Configure::Context
|
||||||
def generate(template, target : String, options : Hash(String, String | Array(String) | Crinja::Callable::Instance | Hash(String, String)))
|
def generate(template, target : String, options : Hash(String, String | Array(String) | Crinja::Callable::Instance | Hash(String, String)))
|
||||||
target_file = File.open target, "w"
|
target_file = File.open target, "w"
|
||||||
|
|
||||||
# FIXME: Alter default sources at build-time.
|
|
||||||
# FIXME: We’ll want a way to alter those context-wide.
|
|
||||||
sources = [
|
sources = [
|
||||||
"/etc/templates",
|
"#{SYSTEM_CONFIGURATION_DIRECTORY}/templates",
|
||||||
"/usr/share/templates"
|
"#{SHARED_DATA_DIRECTORY}/templates"
|
||||||
]
|
]
|
||||||
|
|
||||||
sources = sources
|
sources = sources
|
||||||
|
|
Loading…
Reference in New Issue