From 6dc69228f20b3566320b52966b3782d633171e71 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 27 Nov 2017 20:35:14 -0500 Subject: 0.20.2 paths, config & manifest files --- src/sdp/meta/read_config_files.d | 27 ++++----------------------- src/sdp/meta/read_source_files.d | 1 + src/sdp/meta/rgx.d | 10 +++++----- 3 files changed, 10 insertions(+), 28 deletions(-) (limited to 'src/sdp/meta') diff --git a/src/sdp/meta/read_config_files.d b/src/sdp/meta/read_config_files.d index 012ccb6..369d9c2 100644 --- a/src/sdp/meta/read_config_files.d +++ b/src/sdp/meta/read_config_files.d @@ -7,32 +7,11 @@ module sdp.meta.read_config_files; static template configIn() { import sdp.meta, + sdp.output.paths_source, std.file, std.path; final string configIn(C,E)(C conf_sdl, E env) { - /+ FIX clean up conf paths ↓ +/ - string sisudoc_conf_pwd = chainPath(to!string(env["pwd"]), "sisudoc/conf").array; - string sisudoc_conf_pwd_a = chainPath(to!string(env["pwd"]), "conf").array; - string sisudoc_conf_pwd_b = chainPath(to!string(env["pwd"]), "../conf").array; - string sisudoc_conf_pwd_c = chainPath(to!string(env["pwd"]), "../../conf").array; - string sisudoc_conf_pwd_d = chainPath(to!string(env["pwd"]), "../../../conf").array; - /+ FIX clean up conf paths ↑ - (compare pwd to doc path location, and build config path) - +/ - string dot_pwd = chainPath(to!string(env["pwd"]), ".sisu").array; - string underscore_pwd = chainPath(to!string(env["pwd"]), "_sisu").array; - string dot_home = chainPath(to!string(env["home"]), ".sisu").array; - string[] possible_config_path_locations = [ - sisudoc_conf_pwd, - sisudoc_conf_pwd_a, - sisudoc_conf_pwd_b, - sisudoc_conf_pwd_c, - sisudoc_conf_pwd_d, - dot_pwd, - underscore_pwd, - dot_home, - "/etc/sisu" - ]; + auto possible_config_path_locations = ConfigFilePaths!()(env).possible_config_path_locations; string config_file_str; foreach(pth; possible_config_path_locations) { auto conf_file = format( @@ -67,6 +46,7 @@ static template ConfigSDLang() { import sdlang; import sdp.meta, + sdp.output.paths_source, std.file, std.path; auto ConfigSDLang(string configuration, string conf_sdl_filename) { @@ -86,6 +66,7 @@ static template ConfigSDLang() { static template configRead() { import sdp.meta, + sdp.output.paths_source, std.file, std.path; diff --git a/src/sdp/meta/read_source_files.d b/src/sdp/meta/read_source_files.d index 0443ded..ccda78c 100644 --- a/src/sdp/meta/read_source_files.d +++ b/src/sdp/meta/read_source_files.d @@ -9,6 +9,7 @@ static template SiSUrawMarkupContent() { sdp.meta.rgx; import sdp.meta, + sdp.output.paths_source, std.file, std.path; mixin SiSUrgxInit; diff --git a/src/sdp/meta/rgx.d b/src/sdp/meta/rgx.d index bf1b175..70f48bb 100644 --- a/src/sdp/meta/rgx.d +++ b/src/sdp/meta/rgx.d @@ -196,13 +196,13 @@ static template SiSUrgxInit() { static nbsp_chars_line_start = ctRegex!(`^░+`, "mg"); static nbsp_and_space = ctRegex!(` [ ]`, "mg"); static nbsp_char_and_space = ctRegex!(`░[ ]`, "mg"); - static src_pth = ctRegex!(`^(?P(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.]ss[tm])$`); - static src_pth_contents = ctRegex!(`^(?P(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+)/sisudoc[.]txt$`); - static src_pth_zip = ctRegex!(`^(?P(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.]zip)$`); + static src_pth = ctRegex!(`^(?P[/]?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.]ss[tm])$`); + static src_pth_contents = ctRegex!(`^(?P[/]?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+)/sisudoc[.]txt$`); + static src_pth_zip = ctRegex!(`^(?P[/]?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.]zip)$`); static src_pth_unzip_pod = ctRegex!(`^(?Pmedia/text/[a-z]{2}/)*(?P[a-zA-Z0-9._-]+[.]ss[im])$`); - static src_pth_types = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P(?P[a-zA-Z0-9._-]+[.]ss[tm])|(?P[a-zA-Z0-9._-]+/sisudoc[.]txt)|(?P[a-zA-Z0-9._-]+[.]zip))$`); + static src_pth_types = ctRegex!(`^(?P[/]?[a-zA-Z0-9._-]+/)*(?P(?P[a-zA-Z0-9._-]+[.]ss[tm])|(?P[a-zA-Z0-9._-]+/sisudoc[.]txt)|(?P[a-zA-Z0-9._-]+[.]zip))$`); static src_fn = - ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P(?P[a-zA-Z0-9._-]+)[.](?Pss[tm]))$`); + ctRegex!(`^([/]?(?:[a-zA-Z0-9._-]+/)*)(?P(?P[a-zA-Z0-9._-]+)[.](?Pss[tm]))$`); static src_fn_master = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ssm)$`); static src_fn_text = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]sst)$`); static src_fn_insert = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ssi)$`); -- cgit v1.2.3