]> Lady’s Gitweb - Shushe/commitdiff
Support “expanded” archives
authorLady <redacted>
Fri, 3 May 2024 03:13:55 +0000 (23:13 -0400)
committerLady <redacted>
Fri, 3 May 2024 03:17:19 +0000 (23:17 -0400)
The intent is for this mechanism, which is much simpler to implement,
to replace the pagination functionality which was recently added.

GNUmakefile
README.markdown

index 27cefc1f9643343111fa0aa540ccbfc7f3782cdc..0b0cd80b8e87d790d39804729f2a8be2e91aed5d 100644 (file)
@@ -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 </$(NAME)>…)
        $(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 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 
index b83d49ecd24272d33ece6f19ec210683e4133492..6616df72751b32bc6dfb9c22fea2df86f8c3d026 100644 (file)
@@ -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
This page took 0.064033 seconds and 4 git commands to generate.