]> Lady’s Gitweb - Shushe/commitdiff
Force removal of existing directories 0.8.3
authorLady <redacted>
Sun, 19 May 2024 22:09:06 +0000 (18:09 -0400)
committerLady <redacted>
Tue, 21 May 2024 03:48:13 +0000 (23:48 -0400)
…prior to processing results or installing. Mostly, this prevents a
failure when an expanded archive is changed to no longer be expanded.
This also simplifies the installation code a bit.

GNUmakefile

index 495b8a4979f96312032e6ac3ae993791b346c638..0156970c9b352fa5c7e62430e7ac6beec527f627 100644 (file)
@@ -640,17 +640,20 @@ $(call compiled,$(compilablefiles)) : $(BUILDDIR)/results/% : $$(call parsed,$$(
 $(call built,$(compilablefiles)) : $(BUILDDIR)/public/% : $(BUILDDIR)/results/%
        @$(PRINTF) '%s\n' $(call quote,Building </$*>…)
        $(silent)$(call ensuredirectory,$(dir $@))
+       $(silent)$(RM) -f -R $(call quote,$@)
        $(silent)$(call processresultto,$<,$@,$*)
 $(call built,$(filter $(assetfiles),$(sourcefiles))) : $(BUILDDIR)/public/% : $$(call unbuilt,$$@)
        @$(PRINTF) '%s\n' $(call quote,Building </$*>…)
        $(silent)$(call ensuredirectory,$(dir $@))
+       $(silent)$(RM) -f -R $(call quote,$@)
        $(silent)$(CP) $(call quote,$<) $(call quote,$@)
 
 # Install compiled files (or error in the case of recursive ones).
 $(call installed,$(recursivefiles) $(installablefiles)) : $(DESTDIR)/% : $(BUILDDIR)/public/%
        @$(PRINTF) '%s\n' $(call quote,Installing </$*>…)
        $(silent)$(call ensuredirectory,$(dir $@))
-       $(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)$(RM) -f -R $(call quote,$@)
+       $(silent)$(CP) -R $(call quote,$<) $(call quote,$@)
        $(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 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -697,6 +700,7 @@ $(foreach file,$(archivefiles),$(BUILDDIR)/extracted/$(file)) : $(BUILDDIR)/inde
 $(foreach file,$(archivefiles),$(BUILDDIR)/files/$(file)) : $(BUILDDIR)/files/% : $(BUILDDIR)/extracted/%
        @$(PRINTF) '%s\n' $(call quote,Building </$(NAME)/$*>…)
        $(silent)$(call ensuredirectory,$(dir $@))
+       $(silent)$(RM) -f -R $(call quote,$@)
        $(silent)$(call processresultto,$<,$@,$*)
 
 # Archive all components in the file to the destination.
@@ -705,7 +709,8 @@ $(foreach file,$(archivefiles),$(BUILDDIR)/files/$(file)) : $(BUILDDIR)/files/%
 $(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); 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 -x ustar > $(call quote,$(abspath $@)); fi
+       $(silent)$(RM) -f -R $(call quote,$@)
+       $(silent)cd $(call quote,$(BUILDDIR)/files); if $(call xpath,/*/@*[local-name()="expanded" and namespace-uri()="urn:fdc:ladys.computer:20231231:Shu1She4"],$(abspath $<)); then $(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 -x ustar > $(call quote,$(abspath $@)); fi
 
 # ━ § BEGIN PAGED MAKE·FILE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 
This page took 0.026322 seconds and 4 git commands to generate.