aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/outputs/io_out/source_pod.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/outputs/io_out/source_pod.d')
-rw-r--r--src/sisudoc/outputs/io_out/source_pod.d28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/sisudoc/outputs/io_out/source_pod.d b/src/sisudoc/outputs/io_out/source_pod.d
index 0ed26db..0b014ca 100644
--- a/src/sisudoc/outputs/io_out/source_pod.d
+++ b/src/sisudoc/outputs/io_out/source_pod.d
@@ -77,11 +77,15 @@ template spinePod() {
regeneration, but only on the first language of a multi-language
document, so that subsequent languages' files are not wiped.
.
- media/abstraction/ is left alone: the .ssp files there are written
- by the abstraction stage, which runs before this, and for a
- multi-language document they accumulate one language at a time.
- That directory clears itself, in the .ssp writer, on the first
- language of a run.
+ media/abstraction/ is left standing: the .ssp files there are
+ written by the abstraction stage, which runs before this, and for
+ a multi-language document they accumulate one language at a time.
+ What is pruned from it instead is any .ssp that does not belong to
+ a language this document has, which would otherwise linger from an
+ earlier run and be bundled. That is done here rather than in the
+ writer because pod actions run serially and the manifest's list of
+ languages is to hand, where the writer may be one of several
+ languages running at once.
+/
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);
@@ -103,6 +107,20 @@ template spinePod() {
}
}
}
+ if (exists(keep_dir) && keep_dir.isDir) {
+ string _doc_uid_base
+ = doc_matters.src.doc_uid_out[0 .. $ - doc_matters.src.lng.length];
+ foreach (string _f; dirEntries(keep_dir, "*.ssp", SpanMode.shallow)) {
+ bool _wanted = false;
+ foreach (_lang; doc_matters.pod.manifest_list_of_languages) {
+ if (_f.baseName == (_doc_uid_base ~ _lang ~ ".ssp")) {
+ _wanted = true;
+ break;
+ }
+ }
+ if (!_wanted) { _f.remove; }
+ }
+ }
}
{
podArchive_directory_tree(doc_matters, pths_pod);