From: Lady Date: Fri, 3 May 2024 03:13:55 +0000 (-0400) Subject: Support “expanded” archives X-Git-Tag: 0.8.2~2 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/0b335c43a5bdac0c26d0a1eba117d0b8531ad6c1 Support “expanded” archives The intent is for this mechanism, which is much simpler to implement, to replace the pagination functionality which was recently added. --- diff --git a/GNUmakefile b/GNUmakefile index 27cefc1..0b0cd80 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -490,7 +490,7 @@ all : $(call built,$(recursivefiles) $(installablefiles)) ; # Destroy buildfiles. clean : - $(if $(BUILDDIR),$(silent)$(RM) -rf $(call quote,$(BUILDDIR)/),) + $(if $(BUILDDIR),$(silent)$(RM) -f -R $(call quote,$(BUILDDIR)/),) # Destroy build directory and installed files. gone : clean uninstall ; @@ -545,7 +545,7 @@ $(THISDIR)/GNUmakefile :: $(BUILDDIR)/dependencies $(BUILDDIR)/destinations ifeq ($(typeupdates),) @if $(TEST) ! -f $(call quote,$(BUILDDIR)/.update-types); then $(PRINTF) '%b\n' '\0033[1mDependency graph and output destinations updated. Restarting…\0033[22m'; fi else - $(silent)$(RM) $(BUILDDIR)/.update-types + $(silent)$(RM) $(call quote,$(BUILDDIR)/.update-types) @$(PRINTF) '%b\n' '\0033[1mDependency graph and output destinations updated. Restarting…\0033[22m' endif endif @@ -652,7 +652,7 @@ $(call built,$(filter $(assetfiles),$(sourcefiles))) : $(BUILDDIR)/public/% : $$ $(call installed,$(recursivefiles) $(installablefiles)) : $(DESTDIR)/% : $(BUILDDIR)/public/% @$(PRINTF) '%s\n' $(call quote,Installing …) $(silent)$(call ensuredirectory,$(dir $@)) - $(silent)$(CP) $(call quote,$<) $(call quote,$@) + $(silent)if $(TEST) -d $(call quote,$<); then $(RM) -f -R $(call quote,$@); $(CP) -R $(call quote,$<) $(call quote,$@); else $(CP) $(call quote,$<) $(call quote,$@); fi $(silent)for associated in $$($(call associatedfiles,$(dir $<),$(notdir $<))); do $(PRINTF) '%s\n' "$$associated" | $(SED) 's/^\(.*\)"{\(.*\)}"\(.*\)$$/\1\2\3/' | $(xargsquote) | $(XARGS) -E '' $(PRINTF) '%s%s\n' $(call quote,$(dir $@)) | $(xargsquote) | $(XARGS) -E '' $(CP) $(call quote,$(dir $<))"$$associated"; done # ━ § BEGIN ARCHIVE MAKE·FILE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -704,10 +704,10 @@ $(foreach file,$(archivefiles),$(BUILDDIR)/files/$(file)) : $(BUILDDIR)/files/% # Archive all components in the file to the destination. # # This is a match‐anything target, with the assumption that this make·file is being called recursively from the default mode. -$(DESTDIR)/% : $(foreach file,$(archivefiles),$(BUILDDIR)/files/$(file)) +$(DESTDIR)/% : $(SRC) $(foreach file,$(archivefiles),$(BUILDDIR)/files/$(file)) @$(PRINTF) '%s\n' $(call quote,Archiving …) $(silent)$(call ensuredirectory,$(dir $@)) - $(silent)cd $(call quote,$(BUILDDIR)/files); $(PRINTF) '%s\n' $(foreach file,$(archivefiles),$(call quote,$(file))) | $(PAX) -w > $(call quote,$(abspath $@)) + $(silent)cd $(call quote,$(BUILDDIR)/files); if $(call xpath,/*/@*[local-name()="expanded" and namespace-uri()="urn:fdc:ladys.computer:20231231:Shu1She4"],$(abspath $<)); then $(RM) -f -R $(call quote,$(abspath $@)); $(MKDIR) -p $(call quote,$(abspath $@)); $(PRINTF) '%s\n' $(foreach file,$(archivefiles),$(call quote,$(file))) | $(PAX) -r -w $(call quote,$(abspath $@)); else $(PRINTF) '%s\n' $(foreach file,$(archivefiles),$(call quote,$(file))) | $(PAX) -w > $(call quote,$(abspath $@)); fi # ━ § BEGIN PAGED MAKE·FILE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/README.markdown b/README.markdown index b83d49e..6616df7 100644 --- a/README.markdown +++ b/README.markdown @@ -685,6 +685,13 @@ They are :⁠— non X·M·L output types, ⁊·c). Other child elements will be ignored. + If the `<书社:archive>` element is given an `@书社:expanded` + attribute, rather than producing a tarball ⛩️📰 书社 will output + the directory which expanding the tarball would produce. + This mechanism can be used to generate multiple files from a single + source, provided all of the files are contained with·in the same + directory. + - **`<书社:base64-binary>`:** The text nodes in the transformation result will, after removing all Ascii whitespace, be treated as a Base·64 string, which is then