diff options
Diffstat (limited to 'org/out_src_pod.org')
| -rw-r--r-- | org/out_src_pod.org | 65 |
1 files changed, 37 insertions, 28 deletions
diff --git a/org/out_src_pod.org b/org/out_src_pod.org index 3062d1e..e1076c2 100644 --- a/org/out_src_pod.org +++ b/org/out_src_pod.org @@ -33,6 +33,15 @@ template spinePod() { <<source_pod_init>> if (doc_matters.opt.action.source_or_pod) { try { + /+ ↓ clean slate: remove per-document pod directory before regeneration, + but only on the first language of a multi-language document, + so that subsequent languages' files are not wiped +/ + if (doc_matters.src.language == doc_matters.pod.manifest_list_of_languages[0]) { + string doc_pod_dir = pths_pod.base_filesystem_(doc_matters.src.filename); + if (exists(doc_pod_dir) && doc_pod_dir.isDir) { + doc_pod_dir.rmdirRecurse; + } + } { podArchive_directory_tree(doc_matters, pths_pod); } @@ -145,34 +154,32 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) { } } } - } { // bundle abstraction .ssp file - import sisudoc.io_out.paths_output; - auto out_pth = spineOutPaths!()(doc_matters.output_path, doc_matters.src.language); - string abstraction_dir = ((out_pth.output_base.chainPath("abstraction")).asNormalizedPath).array; - string ssp_filename = doc_matters.src.doc_uid_out ~ ".ssp"; - string fn_src_in = ((abstraction_dir.chainPath(ssp_filename)).asNormalizedPath).array.to!string; - auto fn_src_out_pod_zip_base - = pths_pod.abstraction_root(doc_matters.src.filename).zpod.to!string - ~ "/" ~ ssp_filename; - auto fn_src_out_filesystem - = pths_pod.abstraction_root(doc_matters.src.filename).filesystem_open_zpod.to!string - ~ "/" ~ ssp_filename; - if (exists(fn_src_in)) { - debug(io) { writeln("(io debug) src out found: ", fn_src_in); } - { // take DIGEST write to pod file digests.txt - auto data = (cast(byte[]) (fn_src_in).read); - _digests[doc_matters.src.language]["ssp"] ~= data.sha256Of.toHexString - ~ "::" ~ data.length.to!string ~ " - " ~ ssp_filename ~ "\n"; - } - if (doc_matters.opt.action.source_or_pod) { + } { // bundle abstraction .ssp file (only for --pod2) + if (doc_matters.opt.action.pod2) { + import sisudoc.io_out.paths_output; + auto out_pth = spineOutPaths!()(doc_matters.output_path, doc_matters.src.language); + string abstraction_dir = ((out_pth.output_base.chainPath("abstraction")).asNormalizedPath).array; + string ssp_filename = doc_matters.src.doc_uid_out ~ ".ssp"; + string fn_src_in = ((abstraction_dir.chainPath(ssp_filename)).asNormalizedPath).array.to!string; + auto fn_src_out_pod_zip_base + = pths_pod.abstraction_root(doc_matters.src.filename).zpod.to!string + ~ "/" ~ ssp_filename; + auto fn_src_out_filesystem + = pths_pod.abstraction_root(doc_matters.src.filename).filesystem_open_zpod.to!string + ~ "/" ~ ssp_filename; + if (exists(fn_src_in)) { + debug(io) { writeln("(io debug) src out found: ", fn_src_in); } + { // take DIGEST write to pod file digests.txt + auto data = (cast(byte[]) (fn_src_in).read); + _digests[doc_matters.src.language]["ssp"] ~= data.sha256Of.toHexString + ~ "::" ~ data.length.to!string ~ " - " ~ ssp_filename ~ "\n"; + } fn_src_in.copy(fn_src_out_filesystem); - } - if (doc_matters.opt.action.source_or_pod) { zip = podArchive("file_path_text", fn_src_in, fn_src_out_pod_zip_base, zip); - } - } else { - if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { - writeln("WARNING (io) src out NOT found (abstraction): ", fn_src_in); + } else { + if (doc_matters.opt.action.debug_do_pod && doc_matters.opt.action.vox_gt_2) { + writeln("WARNING (io) src out NOT found (abstraction): ", fn_src_in); + } } } } { // bundle dr_document_make @@ -418,8 +425,10 @@ void podArchive_directory_tree(M,P)(M doc_matters, P pths_pod) { // create direc if (!exists(pths_pod.css(doc_matters.src.filename).filesystem_open_zpod)) { pths_pod.css(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse; } - if (!exists(pths_pod.abstraction_root(doc_matters.src.filename).filesystem_open_zpod)) { - pths_pod.abstraction_root(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse; + if (doc_matters.opt.action.pod2) { + if (!exists(pths_pod.abstraction_root(doc_matters.src.filename).filesystem_open_zpod)) { + pths_pod.abstraction_root(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse; + } } if (!exists(pths_pod.image_root(doc_matters.src.filename).filesystem_open_zpod)) { pths_pod.image_root(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse; |
