]> git.ipfire.org Git - artwork.git/commitdiff
upload: Automatically compute parent directories master
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Jun 2026 17:39:08 +0000 (18:39 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Jun 2026 17:39:08 +0000 (18:39 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile

index 59897a68bb77e04195c8f3e8734969d30e51dc22..06fbf7b291fc005df74428dec61557682ef6fb35 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,12 @@ define TO_MONOCHROME
                < $< > $@
 endef
 
+# Macro to expand parent directories
+ancestors = $(if $(filter-out ./,$(1)),$(1) $(call ancestors,$(dir $(patsubst %/,%,$(1)))))
+
+# Deduplicated parent dirs needed to reach a list of files
+parents = $(sort $(foreach f,$(1),$(call ancestors,$(dir $(f)))))
+
 .PHONY: all
 all: $(OBJECTS)
 
@@ -213,8 +219,7 @@ clean:
 .PHONY: upload
 upload: $(OBJECTS)
        rsync -avHz --progress --delete --delete-excluded \
-               $(addprefix --filter="+ ",$(STYLES)) \
+               $(addprefix --filter="+ ",$(call parents,$(OBJECTS))) \
                $(addprefix --filter="+ ",$(OBJECTS)) \
-               --filter="+ bios/" \
                --filter="- */" --filter="- *" \
                . people.ipfire.org:/pub/artwork/