From 0f37cbf6a34eb57aa1b5ca09d1cbe3f607997b88 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 29 Sep 2017 19:29:11 -0400 Subject: sisupod.zip related fixes --- org/output_sisupod.org | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'org/output_sisupod.org') diff --git a/org/output_sisupod.org b/org/output_sisupod.org index a2085dd..a852b1c 100644 --- a/org/output_sisupod.org +++ b/org/output_sisupod.org @@ -76,6 +76,10 @@ assert (doc_matters.source_filename.match(rgx.src_fn)); #+name: source_sisupod_mkdirs #+BEGIN_SRC d /+ create directory structure +/ +if (!exists(pth_sisupod.sisupod_dir)) { + // used both by sisupod zipped (& sisupod filesystem (unzipped) which makes its own recursive dirs) + pth_sisupod.sisupod_dir.mkdirRecurse; +} if (doc_matters.opt_action["source"]) { if (!exists(pth_sisupod_filesystem.text_root(doc_matters.source_filename))) { pth_sisupod_filesystem.text_root(doc_matters.source_filename).mkdirRecurse; @@ -105,9 +109,8 @@ if (doc_matters.opt_action["source"]) { debug(sisupod) { writeln(__LINE__, ": ", doc_matters.source_filename, " -> ", - pth_sisupod_filesystem.fn_doc( - doc_matters.source_filename, - )); + pth_sisupod_filesystem.fn_doc(doc_matters.source_filename) + ); } auto zip = new ZipArchive(); auto fn_sisupod = pth_sisupod.sisupod_filename(doc_matters.source_filename); @@ -133,7 +136,6 @@ auto fn_sisupod = pth_sisupod.sisupod_filename(doc_matters.source_filename); zip_data.write(cast(char[]) ((fn_src).read)); zip_arc_member_file.expandedData = zip_data.toBytes(); zip.addMember(zip_arc_member_file); - createZipFile!()(pth_sisupod.sisupod_filename(fn_src), zip.build()); } } } @@ -153,7 +155,6 @@ auto fn_sisupod = pth_sisupod.sisupod_filename(doc_matters.source_filename); zip_data.write((fn_src).readText); zip_arc_member_file.expandedData = zip_data.toBytes(); zip.addMember(zip_arc_member_file); - createZipFile!()(pth_sisupod.sisupod_filename(fn_src), zip.build()); } } } @@ -172,7 +173,6 @@ auto fn_sisupod = pth_sisupod.sisupod_filename(doc_matters.source_filename); zip_data.write((fn_src).readText); zip_arc_member_file.expandedData = zip_data.toBytes(); zip.addMember(zip_arc_member_file); - createZipFile!()(pth_sisupod.sisupod_filename(fn_src), zip.build()); } } } @@ -202,17 +202,25 @@ auto fn_sisupod = pth_sisupod.sisupod_filename(doc_matters.source_filename); } if (doc_matters.opt_action["sisupod"]) { auto zip_arc_member_file = new ArchiveMember(); - zip_arc_member_file.name = insert_file; + zip_arc_member_file.name = fn_out; auto zip_data = new OutBuffer(); zip_data.write((fn_src).readText); zip_arc_member_file.expandedData = zip_data.toBytes(); zip.addMember(zip_arc_member_file); - createZipFile!()(pth_sisupod.sisupod_filename(fn_src), zip.build()); + createZipFile!()(fn_sisupod, zip.build()); } } } } } +{ + auto fn_src = doc_matters.source_filename; + if (exists(fn_src)) { + if (doc_matters.opt_action["sisupod"]) { + createZipFile!()(fn_sisupod, zip.build()); + } + } +} #+END_SRC ** sha256 of sisupod.zip, zip debug, read zip archive -- cgit v1.2.3