diff options
Diffstat (limited to 'org/out_src_pod.org')
| -rw-r--r-- | org/out_src_pod.org | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/org/out_src_pod.org b/org/out_src_pod.org index caf19b4..f0b381a 100644 --- a/org/out_src_pod.org +++ b/org/out_src_pod.org @@ -409,16 +409,20 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) { string _path_to_pod = _x.captures["path_to_pod"]; string _podname = _x.captures["podname"]; string _root_to_lang = _x.captures["from_root"]; - string _language = _x.captures["language"]; string _filename = _x.captures["filename"]; + /+ ↓ The digest key is the language being digested (as the sstm + digest above already does), not the language captured from the + resolved insert path. + +/ foreach (_lang; doc_matters.pod.manifest_list_of_languages) { string _pth_mkup_src_in = _path_to_pod ~ _podname ~ "/" ~ _root_to_lang ~ _lang ~ "/" ~ _filename; - { // take DIGEST write to pod file digests.txt - ST_file_stat file_ = getFileStat(_pth_mkup_src_in); - _digests[_language]["ssi"] ~= file_.sha256hash.toHexString ~ "::" ~ file_.fileSize.to!string ~ " - " ~ _filename ~ " - [" ~ _lang ~ "]" ~ "\n"; - } string _pth_mkup_src_out = "pod/" ~ _root_to_lang ~ _lang ~ "/" ~ _filename; + /+ ↓ the digest must be taken inside this guard, not before it (getFileStat opens the file) +/ if (exists(_pth_mkup_src_in)) { + { // take DIGEST write to pod file digests.txt + ST_file_stat file_ = getFileStat(_pth_mkup_src_in); + _digests[_lang]["ssi"] ~= file_.sha256hash.toHexString ~ "::" ~ file_.fileSize.to!string ~ " - " ~ _filename ~ " - [" ~ _lang ~ "]" ~ "\n"; + } if (doc_matters.opt.action.source_or_pod) { auto fn_src_out_filesystem // you need to change language sources = pths_pod.fn_doc_insert( @@ -440,9 +444,14 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) { } } else { auto fn_src_in = insert_file; - { // take DIGEST write to pod file digests.txt // FIX likely bug insert_file includes path, not what you wish to write + /+ ↓ keyed on the document's own language, not on hard-coded "en". The + emit loop looks each key up in the manifest's language list. + FIX likely bug: insert_file still includes its path, and the + line wants the filename as the pod carries it. + +/ + if (exists(fn_src_in)) { // take DIGEST write to pod file digests.txt ST_file_stat file_ = getFileStat(fn_src_in); - _digests["en"]["ssi"] ~= file_.sha256hash.toHexString ~ "::" ~ file_.fileSize.to!string ~ " - " ~ insert_file ~ "\n"; + _digests[doc_matters.src.language]["ssi"] ~= file_.sha256hash.toHexString ~ "::" ~ file_.fileSize.to!string ~ " - " ~ insert_file ~ "\n"; } auto fn_src_out_pod_zip_base = pths_pod.fn_doc_insert( |
