]> git.cameronkatri.com Git - bsdgames-darwin.git/commitdiff
Simplify syncing with upstream
authorCameron Katri <me@cameronkatri.com>
Tue, 13 Apr 2021 19:33:30 +0000 (15:33 -0400)
committerCameron Katri <me@cameronkatri.com>
Tue, 13 Apr 2021 19:33:30 +0000 (15:33 -0400)
Makefile
upstream-commit [new file with mode: 0644]

index b3c9d43e93ccded2387fe1a9bd90c556f65a7695..fbb0be58618401312e6906f09c3d1485f8d0dd2c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,21 @@ config.h:
        @echo "#define LOCALSTATEDIR \"$(LOCALSTATEDIR)\"" >> config.h
        @echo "#define SYSCONFDIR \"$(SYSCONFDIR)\"" >> config.h
 
+update:
+       TEMP=$$(mktemp -d); \
+       cd ~/Documents/BSD/NetBSD; \
+       git format-patch -o $$TEMP $(shell cat upstream-commit) games; \
+       git rev-list HEAD -1 games/ > $(ROOT)/upstream-commit; \
+       cd $(ROOT); \
+       for patch in $$TEMP/*.patch; do \
+               if [ "$$(filterdiff -x '*/Makefile' --strip=1 $$patch --clean)" = "" ]; then \
+                       echo "Skipping $$(basename $$patch) because it's empty"; \
+               else \
+                       filterdiff -x '*/Makefile' --strip=1 $$patch | git am; \
+               fi; \
+       done
+
 clean:
        rm -f config.h
 
-.PHONY: $(TOPTARGETS) $(SUBDIR)
+.PHONY: $(TOPTARGETS) $(SUBDIR) update
diff --git a/upstream-commit b/upstream-commit
new file mode 100644 (file)
index 0000000..f9e4e77
--- /dev/null
@@ -0,0 +1 @@
+349df3fc42d56c343bcc12b6c33784a3492395c4